/**
 * css/mobile.css — TronScan.energy
 * Mobile & Responsive Styles
 *
 * Breakpoints:
 *   768px — tablet / mobile boundary (main)
 *   480px — small phones
 *
 * VISIBILITY RULE (critical):
 *   .sell-table-desktop  → default: block  | hidden at ≤768px
 *   .sell-cards-mobile   → default: none   | shown  at ≤768px
 */

/* ═══════════════════════════════════════════════════════════════
   GLOBAL DEFAULTS (all screen sizes)
   ═══════════════════════════════════════════════════════════════ */

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Desktop/mobile visibility toggles ────────────────────────
   These MUST be set here as global defaults BEFORE any media
   query so the breakpoint can safely override them.           */
.sell-table-desktop {
    display: block;       /* shown on desktop by default */
}

.sell-cards-mobile {
    display: none;        /* hidden on desktop by default */
}

/* ── Hero badge ─────────────────────────────────────────────── */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent-tertiary);
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    border-radius: 100px;
    padding: 0.35rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
}

/* ── Hero sub-headline ──────────────────────────────────────── */
.hero-sub {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 2rem;
}

/* ── Hero stats bar ─────────────────────────────────────────── */
.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1.25rem 2rem;
    max-width: 580px;
    margin: 0 auto;
    box-shadow: 0 2px 8px var(--shadow-light);
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    gap: 0.2rem;
}

.hero-stat-number {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent-primary);
    line-height: 1;
}

.hero-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
}

.hero-stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-primary);
    flex-shrink: 0;
    margin: 0 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   BUY.PHP — LOADING / SEARCHING ANIMATION
   ═══════════════════════════════════════════════════════════════ */

/* Overlay shown while form is submitting */
.search-loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.search-loading-overlay.is-visible {
    display: flex;
}

.search-loading__card {
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border-primary, rgba(255,255,255,0.1));
    border-radius: 16px;
    padding: 2rem 2.5rem;
    text-align: center;
    max-width: 340px;
    width: 90%;
}

.search-loading__spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-primary, rgba(255,255,255,0.1));
    border-top-color: var(--accent-primary, #dc2626);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
    margin: 0 auto 1.25rem;
}

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

.search-loading__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #f1f5f9);
    margin-bottom: 0.35rem;
}

.search-loading__subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 1.25rem;
}

/* Animated dots — platform names cycling */
.search-loading__platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
}

.search-loading__platform {
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    background: var(--bg-secondary, rgba(255,255,255,0.05));
    color: var(--text-secondary, #94a3b8);
    border: 1px solid var(--border-primary, rgba(255,255,255,0.08));
    opacity: 0.4;
    transition: opacity 0.4s, border-color 0.4s, color 0.4s;
}

.search-loading__platform.is-active {
    opacity: 1;
    border-color: var(--accent-primary, #dc2626);
    color: var(--accent-primary, #dc2626);
}

/* ── Buy results: desktop/mobile visibility ─────────────────── */
.buy-results-desktop {
    display: block;
}

.buy-results-mobile {
    display: none;
}

/* ── Homepage search notice ─────────────────────────────────── */
.homepage-search-notice {
    color: var(--accent-primary);
    font-weight: 600;
    margin-top: 0.5rem;
}

/* ── Results heading ────────────────────────────────────────── */
.results-heading {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-primary);
}

/* ── Best result row highlight ──────────────────────────────── */
.best-result-row td {
    background: rgba(34, 197, 94, 0.06);
}

/* ── Rank badges ─────────────────────────────────────────────── */
.rank-cell {
    text-align: center;
    width: 40px;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.rank-badge.rank-best {
    background: rgba(34, 197, 94, 0.15);
    font-size: 1rem;
    width: 32px;
    height: 32px;
}

.rank-badge.rank-error {
    background: transparent;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ── Cell types ─────────────────────────────────────────────── */
.cell-cost {
    font-weight: 700;
    color: var(--text-primary);
}

.cell-error {
    color: #b91c1c;
    font-size: 0.9em;
}

.cell-info {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* ── Debug column: always last, low priority on mobile ──────── */
.debug-col {
    max-width: 220px;
    word-break: break-word;
}

/* ── Buy result cards (mobile) ──────────────────────────────── */
.buy-results-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.buy-result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.buy-result-card--best {
    border-color: #16a34a;
    box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.25), 0 4px 16px rgba(22, 163, 74, 0.1);
}

.buy-result-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.buy-result-card__platform {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.buy-result-card__badge {
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(22, 163, 74, 0.12);
    color: #16a34a;
    border: 1px solid rgba(22, 163, 74, 0.3);
    border-radius: 20px;
    padding: 0.2rem 0.6rem;
}

.buy-result-card__rank {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-radius: 20px;
    padding: 0.2rem 0.6rem;
}

.buy-result-card__metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
}

.buy-result-card__metric {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.buy-result-card__metric-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    font-weight: 600;
}

.buy-result-card__metric-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.buy-result-card__metric-value--main {
    font-size: 1.2rem;
    color: #16a34a;
}

.buy-result-card__metric-unit {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.buy-result-card__error {
    color: #b91c1c;
    font-size: 0.9rem;
    margin: 0.25rem 0 0.75rem;
}

.buy-result-card__info {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.25rem 0 0.75rem;
}

.buy-result-card__footer {
    border-top: 1px solid var(--border-primary);
    padding-top: 0.75rem;
}

.buy-result-card__footer .referral-button {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.7rem;
    font-size: 0.95rem;
}

/* ── Buy results table wrapper ──────────────────────────────── */
.buy-results-table-wrap {
    overflow-x: auto;
}
.exchange-logo {
    height: 22px !important;
    width: auto !important;
    max-width: 90px !important;
    object-fit: contain;
    vertical-align: middle;
}

/* Logo inside sell cards: slightly smaller */
.sell-card__logo {
    height: 20px;
    width: auto;
    max-width: 80px;
    object-fit: contain;
    vertical-align: middle;
}

/* ── Buy table wrapper ──────────────────────────────────────── */
.buy-table-wrapper {
    overflow-x: auto;
}

/* ── No offers message ──────────────────────────────────────── */
.no-offers-msg {
    text-align: center;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: 8px;
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

/* ── View all wrap ──────────────────────────────────────────── */
.view-all-wrap {
    text-align: center;
    margin-top: 1.5rem;
}

.view-all-link {
    padding: 0.75rem 1.5rem !important;
    font-size: 1rem !important;
}

/* ── SEO content block ──────────────────────────────────────── */
.seo-content {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 0;
}

.seo-content h2 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.seo-content p {
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.seo-content p:last-of-type {
    margin-bottom: 1.25rem;
}

.seo-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.seo-links a {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.seo-links a:hover {
    border-color: var(--accent-primary);
}

/* ── Sell cards (mobile view) ───────────────────────────────── */
.sell-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 6px var(--shadow-light);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.sell-card:last-child {
    margin-bottom: 0;
}

.sell-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 12px var(--shadow-medium);
}

.sell-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.9rem;
}

.sell-card__platform {
    font-weight: 700;
    font-size: 1rem;
}

/* Reuse platform colors from style.css */
.sell-card__platform.platform-tronify           { color: var(--success); }
.sell-card__platform.platform-tronenergize      { color: var(--info); }
.sell-card__platform.platform-tronenergy-market { color: var(--warning); }

.sell-card__badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 100px;
    border: 1px solid;
}

.sell-card__badge--energy {
    background: rgba(234, 179, 8, 0.1);
    color: #ca8a04;
    border-color: rgba(234, 179, 8, 0.3);
}

.sell-card__badge--bandwidth {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Metrics: 2-column grid */
.sell-card__metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.sell-card__metric {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sell-card__metric-label {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.sell-card__metric-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sell-card__metric-value--highlight {
    color: var(--accent-primary);
    font-size: 1.05rem;
    font-weight: 700;
}

.sell-card__metric-unit {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: 0.2rem;
}

.sell-card__footer {
    border-top: 1px solid var(--border-primary);
    padding-top: 0.75rem;
}

.sell-card__cta {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.65rem 1rem;
    background: var(--accent-primary);
    color: #fff;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    box-sizing: border-box;
}

.sell-card__cta:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.sell-card__cta:active {
    transform: translateY(0);
}

/* ── Sell page: status bar ──────────────────────────────────── */
.sell-status-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.sell-status-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.sell-status-filter {
    color: var(--accent-primary);
    font-weight: 600;
}

/* ── Sell page: filters panel ───────────────────────────────── */
.sell-filters {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
}

.filters-title {
    margin: 0 0 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.filters-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    min-height: 44px;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.filter-btn-apply {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--accent-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    min-height: 44px;
    transition: background 0.2s, transform 0.15s;
}

.filter-btn-apply:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.filter-btn-reset {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
    border: 1px solid var(--border-secondary);
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.filter-btn-reset:hover {
    background: var(--border-primary);
}

/* ── Sell cards: full page version (sell.php) ───────────────── */
.sell-cards-full {
    margin-top: 0;
}

/* Progress inside card */
.sell-card__progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.sell-card__progress .progress-bar {
    flex: 1;
    margin-bottom: 0;
}

.sell-card__progress-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ── Jump-to-page form ──────────────────────────────────────── */
.jump-to-page {
    text-align: center;
    margin-top: 1rem;
}

.jump-form {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-primary);
}

.jump-form label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.jump-form input[type="number"] {
    width: 60px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    text-align: center;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.jump-form button {
    padding: 0.3rem 0.75rem;
    background: var(--accent-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.jump-form button:hover {
    background: var(--accent-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   BREAKPOINT: TABLET  ≤ 1024px
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .hero-stats {
        padding: 1rem 1.5rem;
    }

    .hero-stat-number {
        font-size: 1.4rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   BREAKPOINT: MOBILE  ≤ 768px
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    /* ── Container padding ── */
    .container {
        padding: 0 16px;
    }

    /* ── Hero ── */
    .hero-section {
        padding: 2rem 0 1.5rem;
        text-align: center;
    }

    .hero-section h1 {
        font-size: 1.65rem;
        line-height: 1.25;
    }

    .hero-sub {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .hero-badge {
        font-size: 0.7rem;
    }

    .hero-stats {
        padding: 0.9rem 1rem;
        max-width: 100%;
    }

    .hero-stat-number {
        font-size: 1.2rem;
    }

    .hero-stat-label {
        font-size: 0.65rem;
    }

    .hero-stat-divider {
        height: 30px;
        margin: 0 0.25rem;
    }

    /* ── Buy results: SWITCH TABLE → CARDS ── */
    .buy-results-desktop {
        display: none !important;
    }

    .buy-results-mobile {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem;
    }

    /* ── Buy results table wrapper (fallback for very wide mobiles) ── */
    .buy-results-table-wrap {
        overflow-x: auto;
    }

    /* ── Buy energy layout: stack vertically ── */
    .buy-energy-container {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    /* Form first on mobile */
    .form-column {
        order: -1;
        position: static !important;
    }

    .energy-form-card {
        padding: 1.25rem;
    }

    .energy-form-card h3 {
        font-size: 1.2rem;
        margin-bottom: 1.25rem;
    }

    /* Benefits column heading */
    .benefits-column {
        padding: 0;
    }

    .benefits-column h2 {
        font-size: 1.1rem !important;
        margin-bottom: 0.75rem;
    }

    /* ── Buy table: card-style on mobile ── */
    .buy-table-wrapper {
        overflow-x: visible;    /* disable scroll, we reshape the table */
    }

    /* Hide columns that don't fit: Type and SUN/h */
    .buy-table-wrapper table thead tr th:nth-child(2),
    .buy-table-wrapper table thead tr th:nth-child(5),
    .buy-table-wrapper table tbody tr td:nth-child(2),
    .buy-table-wrapper table tbody tr td:nth-child(5) {
        display: none;
    }

    /* Tighten remaining columns */
    .buy-table-wrapper table {
        font-size: 0.82rem !important;
    }

    .buy-table-wrapper table th,
    .buy-table-wrapper table td {
        padding: 8px 6px;
    }

    /* Platform cell: constrain logo width */
    .buy-table-wrapper table td:first-child {
        max-width: 90px;
        white-space: normal !important;
        word-break: break-word;
    }

    .buy-table-wrapper .exchange-logo {
        height: 18px !important;
        max-width: 70px !important;
    }

    /* Buy link: compact */
    .buy-table-wrapper .order-link {
        padding: 4px 8px;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    /* Buy button: slightly larger touch target */
    .buy-button {
        min-height: 52px;
    }

    /* ── Sell preview: SWITCH TABLE → CARDS ── */
    .sell-table-desktop {
        display: none !important;
    }

    .sell-cards-mobile {
        display: block !important;
        margin-top: 1.25rem;
    }

    /* ── Sell status bar: stack on mobile ── */
    .sell-status-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        font-size: 0.82rem;
    }

    /* ── Filters: single column on mobile ── */
    .filters-form {
        grid-template-columns: 1fr;
    }

    .filter-group select {
        font-size: 1rem;  /* prevent iOS auto-zoom */
        min-height: 48px;
    }

    .filter-btn-apply,
    .filter-btn-reset {
        min-height: 48px;
    }

    /* ── Jump form: stack on mobile ── */
    .jump-form {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* ── Pagination: tighter on mobile ── */
    .pagination-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination a,
    .pagination span {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
        min-width: 36px;
        text-align: center;
    }

    /* ── Section headings ── */
    #sell-preview h2,
    #buy-energy h2 {
        font-size: 1.15rem;
    }

    /* ── SEO block ── */
    .seo-content {
        padding: 1.25rem;
    }

    .seo-content h2 {
        font-size: 1.1rem;
    }

    .seo-content p {
        font-size: 0.88rem;
    }

    .seo-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* ── View all CTA ── */
    .view-all-link {
        display: block;
        text-align: center;
    }
}

/* ═══════════════════════════════════════════════════════════════
   BREAKPOINT: SMALL PHONES  ≤ 480px
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {

    .hero-section h1 {
        font-size: 1.35rem;
    }

    /* Stack stats vertically */
    .hero-stats {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }

    .hero-stat-divider {
        width: 50px;
        height: 1px;
    }

    /* Quick amounts: 2 cols on very small screens */
    .quick-amounts {
        grid-template-columns: repeat(2, 1fr);
    }

    .sell-card {
        padding: 0.9rem 1rem;
    }

    .sell-card__metrics {
        gap: 0.5rem 0.6rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   BUY PAGE — TABS
   ═══════════════════════════════════════════════════════════════ */

.buy-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--border-primary, rgba(255,255,255,0.08));
    padding-bottom: 0;
    flex-wrap: wrap;
}

.buy-tab {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary, #94a3b8);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.buy-tab:hover {
    color: var(--text-primary, #f1f5f9);
}

.buy-tab--active {
    color: var(--accent-primary, #dc2626);
    border-bottom-color: var(--accent-primary, #dc2626);
}

.buy-tab-panel {
    display: none;
}

.buy-tab-panel--active {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════
   BUY PAGE — POOL LOGO (no text, logo only)
   ═══════════════════════════════════════════════════════════════ */

.pool-logo-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}

/* Desktop: medium logo */
.pool-logo {
    height: 32px;
    max-width: 110px;
    width: auto;
    object-fit: contain;
    display: block;
}

.pool-logo-fallback {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
    white-space: nowrap;
}

/* Badge helpers */
.badge-fixed {
    background: rgba(217,119,6,0.2);
    color: #fbbf24;
    border-radius: 4px;
    padding: 0.15rem 0.45rem;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-variable {
    background: rgba(37,99,235,0.15);
    color: #60a5fa;
    border-radius: 4px;
    padding: 0.15rem 0.45rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.small-note {
    font-size: 0.72rem;
    font-weight: 400;
    opacity: 0.7;
}

/* Buy result card rank badge */
.buy-result-card__rank {
    font-size: 0.8rem;
    color: var(--text-tertiary, #64748b);
    font-weight: 600;
}

/* ─── Mobile overrides for pool logo ─── */
@media (max-width: 768px) {
    .pool-logo {
        height: 28px;
        max-width: 90px;
    }

    .buy-tabs {
        gap: 0.25rem;
    }

    .buy-tab {
        font-size: 0.82rem;
        padding: 0.5rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .pool-logo {
        height: 24px;
        max-width: 76px;
    }
}
