/* Firesweeps Portal Modern Theme (inspired by firesweeps.playmy.site) */
:root {
    --color-primary: #3b82f6;
    --color-primary-dark: #2563eb;
    --color-secondary: #8b5cf6;
    --color-accent: #f59e0b;
    --color-background: #fff;
    --color-surface: #111827;
    --color-text: #f9fafb;
    --color-text-secondary: #9ca3af;
    --color-gray-800: #1e2939;
    --color-blue-600: #155dfc;
    --color-blue-500: #3080ff;
    --color-yellow-500: #edb200;
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --shadow-lg: 0 10px 15px -3px #0000001a;
    --shadow-xl: 0 20px 25px -5px #0000001a;
    --section-padding: 5rem;
    --container-max-width: 1280px;
    --nav-sidebar-width: 96px;
    --font-family: 'Geist', Arial, Helvetica, sans-serif;

    /* ── Button system ── */
    --gradient-fire: linear-gradient(135deg, #CC1111, #8B0000);
    --gradient-fire-hover: linear-gradient(135deg, #e01212, #a00000);
    --btn-bg: var(--gradient-primary);
    --btn-bg-hover: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    --btn-color: #fff;
    --btn-radius: 10px;
    --btn-padding: 10px 18px;
    --btn-font-size: 0.875rem;
    --btn-font-weight: 700;
    --btn-letter-spacing: 0.5px;
    --btn-transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;

    /* ── Semantic status & form colours ── */
    --color-fire: #CC1111;
    --color-input-bg: #0f172a;
    --color-input-border: rgba(255, 255, 255, 0.1);
    --color-border-faint: rgba(255, 255, 255, 0.08);
    --color-err: #ff6b6b;
    --color-ok: #4ade80;
    --color-warn: #fbbf24;
    --color-info: #60a5fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: #111827;
    background: var(--color-background);
    min-height: 100vh;
}

#app {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 1.5rem 1rem 1.5rem;
    width: 100%;
}

@media (max-width: 720px) {
    #app {
        padding-bottom: 1rem;
    }
}

.page {
    padding: 1.2rem 0;
}

.page h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.page p {
    color: #374151;
    line-height: 1.75;
}

/* Floating action button */
.fab {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: auto;
    min-width: 56px;
    height: 48px;
    padding: 0 16px;
    border-radius: 20px;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-shadow: var(--shadow-xl);
    cursor: pointer;
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
    z-index: 1160;
}

.fab:hover {
    opacity: 0.9;
    box-shadow: 0 18px 28px rgba(0, 0, 0, 0.35);
}

/* Scroll-to-top button */
#scroll-top-btn {
    position: fixed;
    bottom: 90px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(17, 17, 17, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--color-primary);
    font-size: 20px;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    z-index: 1160;
    transition: opacity 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#scroll-top-btn.visible {
    display: flex;
}

#scroll-top-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

@media (max-width: 720px) {
    #scroll-top-btn {
        bottom: 72px;
        left: 14px;
    }
}

@media (max-width: 720px) {
    .fab {
        /* Sit above the 56px tab bar with comfortable clearance */
        bottom: 72px;
        right: 14px;
        height: 44px;
        font-size: 0.9rem;
        padding: 0 14px;
    }
}

/* Header */
header {
    background: #0a0a0a;
    color: #fff;
    padding: 0;
    display: grid;
    grid-template-columns: var(--nav-sidebar-width) 1fr 56px;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-lg);
    position: relative;
    height: 128px;
    overflow: hidden;
}

header .logo {
    grid-column: 1;
    justify-self: start;
    align-self: center;
    display: flex;
    align-items: center;
    margin-left: 8px;
    z-index: 60;
}

@keyframes fire-pulse {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    30% {
        transform: scale(1.06);
        filter: brightness(1.12);
    }

    60% {
        transform: scale(0.97);
        filter: brightness(0.95);
    }

    80% {
        transform: scale(1.04);
        filter: brightness(1.08);
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

header .logo img {
    height: 128px;
    width: auto;
    display: block;
    opacity: 0.98;
    animation: fire-pulse 4.6s ease-in-out infinite;
    transform-origin: center bottom;
}

header .branding {
    grid-column: 2;
    justify-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    max-width: calc(100% - 144px);
    /* leave room for wider logo + hamburger */
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: clamp(1.2rem, 3.5vw, 2.2rem);
    /* larger max for header prominence */
    line-height: 1.05;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

header .tagline {
    margin: 0;
    font-size: clamp(0.7rem, 2.2vw, 0.9rem);
    color: #fff;
}

.hamburger {
    grid-column: 3;
    justify-self: end;
    display: none;
    min-width: 44px;
    min-height: 44px;
    padding: 6px;
    box-sizing: content-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1200;
    border-radius: 8px;
}

@media (max-width: 720px) {
    header {
        grid-template-columns: 96px 1fr 44px;
        padding: 0 0.5rem;
        height: 96px;
        overflow: hidden;
    }

    header .branding {
        max-width: calc(100% - 116px);
        justify-self: center;
        align-items: center;
        text-align: center;
        white-space: normal;
    }

    header .logo img {
        height: 96px;
    }

    .hamburger {
        display: flex;
    }
}

nav {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    width: 100%;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 640px;
}

/* Mobile hamburger menu */
.hamburger {
    display: none;
    width: 38px;
    height: 32px;
    flex-direction: column;
    justify-content: space-between;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1200;
    grid-column: 3;
    justify-self: end;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

@media (max-width: 720px) {
    .hamburger {
        display: flex;
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
    }

    nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(10, 10, 10, 0.95);
        padding: 0;
        display: flex;
        justify-content: center;
        /* center menu vertically and horizontally */
        align-items: center;
        transform: translateX(-110%);
        transition: transform 0.25s ease;
    }

    nav.open {
        transform: translateX(0);
    }

    nav ul {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 1.5rem;
        width: 100%;
        max-width: 720px;
        align-items: center;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        /* allow scrolling when there are many items */
    }

    nav ul li {
        width: 100%;
    }

    nav ul li a {
        justify-content: center;
        padding: 0.85rem;
        font-size: 1.1rem;
    }

    header {
        justify-content: space-between;
        text-align: left;
        flex-wrap: nowrap;
        align-items: center;
    }
}

nav ul li {
    position: relative;
    flex: 1;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: 0.65rem 0.75rem;
    font-size: 0.95rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

nav ul li a:hover {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--shadow-lg);
}

nav ul li a.active {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--shadow-lg);
}

.chat-button-header {
    background: var(--gradient-primary);
    color: #fff;
    padding: 10px 24px;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    box-shadow: var(--shadow-lg);
    transition: background 0.3s, transform 0.3s;
    margin-left: 1rem;
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
}

.chat-button-header:hover {
    background: var(--color-primary);
    transform: scale(1.05);
}

/* Main Content */
main {
    padding: 3rem 1rem;
}

#downloads {
    padding: 2rem;
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-xl);
    max-width: var(--container-max-width);
    margin: 0 auto;
}

#downloads h1 {
    margin-bottom: 2rem;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.download-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.download-item {
    background: var(--color-background);
    border: 1px solid var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    width: calc(33.333% - 1rem);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
}

.download-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.download-item h3 {
    margin: 1rem 0 0.5rem 0;
    color: var(--color-primary-dark);
    font-size: 1.2rem;
    font-weight: 600;
}

.download-item .download-btn {
    display: block;
    background: var(--gradient-primary);
    color: #fff;
    padding: 10px 24px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s, transform 0.3s;
    margin: 1rem auto 0 auto;
    box-shadow: var(--shadow-lg);
}

.download-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

.download-item .download-btn:hover {
    background: var(--color-primary-dark);
    transform: scale(1.05);
}

/* Footer */
.site-footer {
    background: var(--color-primary-dark);
    color: #fff;
    text-align: center;
    padding: 1.25rem 1rem;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.08);
}

.site-footer .footer-inner {
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.site-footer .footer-left {
    font-size: 0.95rem;
}

.site-footer .footer-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    margin-left: 0.5rem;
}

.mobile-footer {
    display: none;
}

/* Cards, grid and buttons used by the SPA */
.platform-card,
.wallet-card {
    background: var(--color-surface);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
}

.wallet-card h3 {
    margin: 0 0 6px 0;
    color: var(--color-primary);
}

.wallet-balance {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-text);
}

.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    width: 100%;
}

.platform-tile {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    text-align: center;
}

.platform-icon {
    font-size: 28px;
}

.platform-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #111827;
}

.platform-balance {
    font-size: 1rem;
    color: #111827;
}

.platform-actions {
    margin-top: 6px;
}

.btn.small {
    padding: 6px 10px;
    font-size: 0.8rem;
}

@media (max-width: 720px) {
    .mobile-footer {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--color-primary-dark);
        color: #fff;
        padding: 8px 12px;
        text-align: center;
        z-index: 1200;
    }
}

/* Responsive Design */
@media (max-width: 900px) {
    .download-item {
        width: calc(50% - 1rem);
    }
}

@media (max-width: 600px) {
    header {
        height: 96px;
        padding: 0 0.5rem;
        overflow: hidden;
    }

    .logo img {
        height: 96px;
    }

    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    .chat-button-header {
        margin-top: 1rem;
        width: 100%;
        text-align: center;
        position: static;
        transform: none;
    }

    .download-item {
        width: 100%;
        padding: 1rem 0.5rem;
    }

    #downloads {
        padding: 1rem 0.5rem;
    }

    footer .chat-button-footer {
        position: static;
        margin: 1rem auto 0 auto;
        width: 100%;
        text-align: center;
    }
}

/* Utility classes used by app.js */
.center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}

.mt-3 {
    margin-top: 3rem;
}

.mt-4 {
    margin-top: 4rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mb-3 {
    margin-bottom: 3rem;
}

.mb-4 {
    margin-bottom: 4rem;
}

.btn {
    background: var(--btn-bg);
    color: var(--btn-color);
    border: none;
    border-radius: var(--btn-radius);
    padding: var(--btn-padding);
    font-size: var(--btn-font-size);
    font-weight: var(--btn-font-weight);
    letter-spacing: var(--btn-letter-spacing);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background 0.18s ease;
    border-radius: inherit;
    pointer-events: none;
}

.btn:hover:not(:disabled)::after {
    background: rgba(255, 255, 255, 0.1);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.4);
    filter: brightness(1.08);
}

.btn:active:not(:disabled) {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.2);
    filter: brightness(0.95);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ── crypto selector & quick-amount buttons ── */
.dep-crypto-btn {
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease !important;
}

.dep-crypto-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35) !important;
    filter: brightness(1.1);
}

.dep-crypto-btn:active {
    transform: translateY(1px) scale(0.97) !important;
    filter: brightness(0.9);
}

.dep-quick,
.ltp-quick {
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.dep-quick:hover,
.ltp-quick:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    filter: brightness(1.12);
}

.dep-quick:active,
.ltp-quick:active {
    transform: translateY(1px) scale(0.97);
    filter: brightness(0.9);
}

/* ── tab toggle buttons (ADD FUNDS / LOAD CREDITS) ── */
#dep-tab-btn-add,
#dep-tab-btn-load {
    transition: filter 0.18s ease, opacity 0.18s ease;
}

#dep-tab-btn-add:hover,
#dep-tab-btn-load:hover {
    filter: brightness(1.15);
}

#dep-tab-btn-add:active,
#dep-tab-btn-load:active {
    filter: brightness(0.9);
}

.tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 1.25rem 0 1rem 0;
}

.tab {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.65rem 1.1rem;
    border-radius: var(--radius-xl);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s ease, border 0.2s ease;
}

/* ── Deposit / Withdraw / History — shared form-element classes ─────────────── */

/* Card section headings */
.page-card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #111827;
}

.page-card-sub {
    font-size: 12px;
    color: #374151;
    margin-bottom: 16px;
    opacity: 0.8;
}

/* Uppercase field labels */
.form-label {
    font-size: 11px;
    font-weight: 700;
    color: #374151;
    letter-spacing: 1.5px;
    display: block;
    margin-bottom: 6px;
    text-transform: uppercase;
}

/* Text / number / select inputs */
.form-field {
    width: 100%;
    padding: 11px 12px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    color: #111827;
    font-size: 14px;
    font-family: var(--font-family);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.form-field:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-field--lg {
    font-size: 22px !important;
    font-weight: 700 !important;
}

.form-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 5px;
}

/* Deposit: ADD FUNDS / LOAD CREDITS tab bar */
.dep-tab-bar {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.10);
    background: #f1f5f9;
}

.dep-tab-btn {
    flex: 1;
    padding: 12px 0;
    background: transparent;
    color: #374151;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.dep-tab-btn.dep-tab-active {
    background: var(--gradient-primary);
    color: #fff;
}

/* Coin / network selector buttons */
.coin-selector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.coin-btn {
    padding: 12px;
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.10);
    border-radius: 8px;
    color: #111827;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.coin-icon-wrap {
    width: 48px;
    height: 48px;
    min-width: 48px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 50%;
    padding: 6px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coin-btn-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.coin-btn.coin-btn--active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
}

.coin-btn-name {
    font-size: 13px;
    font-weight: 700;
}

.coin-btn-sub {
    font-size: 10px;
    opacity: 0.8;
    margin-top: 2px;
}

/* Quick-amount preset buttons — base color set here */
.dep-quick,
.ltp-quick,
.wd-quick {
    flex: 1;
    padding: 7px 0;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.10);
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dep-quick.quick-active,
.ltp-quick.quick-active,
.wd-quick.quick-active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
}

.wd-quick:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

.wd-quick:active {
    filter: brightness(0.9);
    transform: translateY(1px) scale(0.97);
}

/* Status / result panel */
.status-panel {
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    font-size: 13px;
    line-height: 1.7;
}

.status-panel--error {
    border-color: var(--color-err) !important;
}

.status-panel--success {
    border-color: #1a4a8a !important;
}

.status-panel--warn {
    border-color: #4a3a00 !important;
}

/* Inline text colour helpers */
.text-err {
    color: var(--color-err);
}

.text-ok {
    color: var(--color-ok);
}

.text-warn {
    color: var(--color-warn);
}

.text-info {
    color: var(--color-info);
}

.text-muted {
    color: var(--color-text-secondary);
}

/* Withdraw progress bar */
.wd-progress-track {
    background: var(--color-input-bg);
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
}

.wd-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #16a34a 0%, #4ade80 100%);
    border-radius: 6px;
    transition: width 0.4s ease;
}

/* Invoice / status box (reusable tile) */
.invoice-box {
    padding: 16px;
    background: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    border-radius: 10px;
}

/* Inline retry/action button */
.inline-action-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--color-text);
    border: 1px solid var(--color-input-border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s ease;
}

.inline-action-btn:hover {
    background: rgba(255, 255, 255, 0.13);
}

/* ── Invoice / BTCPay payment panel ─────────────────────────────────────────── */
.pay-invoice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.pay-invoice-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: 1.5px;
}

/* Tab bar — Lightning vs On-Chain */
.pay-tab-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.pay-tab-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    background: var(--color-input-bg);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 700;
    border: 1px solid var(--color-border-faint);
    cursor: pointer;
    transition: all 0.18s;
}

.pay-tab-btn.pay-tab-active {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
}

/* Amount to send box */
.pay-amount-box {
    background: var(--color-input-bg);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.pay-amount-box .pay-exact-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-info);
    letter-spacing: 1.5px;
    margin-bottom: 6px;
}

.pay-amount-box .pay-exact-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-text);
    flex: 1;
    font-family: monospace;
}

.pay-amount-box .pay-exact-sub {
    font-size: 10px;
    color: var(--color-text);
    margin-top: 6px;
    opacity: 0.8;
}

/* Network / warning note */
.pay-network-note {
    background: var(--color-input-bg);
    border: 1px solid var(--color-border-faint);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    font-size: 11px;
    color: var(--color-text);
    line-height: 1.6;
}

.pay-network-note--warn {
    background: rgba(56, 189, 193, 0.07);
    border-color: rgba(56, 189, 193, 0.25);
    color: #94d8da;
}

/* Address row */
.addr-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    background: var(--color-input-bg);
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.addr-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text);
    flex: 1;
    font-family: monospace;
    word-break: break-all;
    white-space: normal;
}

.addr-copy-btn {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--color-info);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s;
}

.addr-copy-btn:hover {
    background: rgba(59, 130, 246, 0.2);
}

/* Wallet open link */
.wallet-open-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: var(--color-input-bg);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    transition: background 0.15s;
}

.wallet-open-btn:hover {
    background: rgba(59, 130, 246, 0.08);
}

/* BTC due amount */
.pay-due-amount {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text);
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

/* On-chain timing note */
.pay-chain-note {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 7px;
    background: var(--color-input-bg);
    border: 1px solid var(--color-border-faint);
    font-size: 11px;
    color: var(--color-text);
}

/* BTCPay fallback checkout button */
.btcpay-checkout-btn {
    display: block;
    width: 100%;
    padding: 13px;
    background: var(--gradient-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    margin-bottom: 10px;
    box-sizing: border-box;
    transition: opacity 0.15s;
}

.btcpay-checkout-btn:hover {
    opacity: 0.88;
}

/* Settled / payment ok banner */
.pay-settled-ok {
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(56, 189, 193, 0.07);
    border: 1px solid rgba(56, 189, 193, 0.25);
    font-size: 12px;
    color: #94d8da;
}

/* ── Dashboard v2 ───────────────────────────────────────────────────────────── */
.dash-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

.dash-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 0.25rem;
}

/* Wallet card — fire gradient */
.dash-wallet {
    background: linear-gradient(135deg, #1a0800 0%, #2a0a0a 100%) !important;
    border: 1px solid #4a1a0a !important;
}

.wallet-card-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.wallet-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.3rem;
    color: #ffffff;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
}

#wallet-usd,
.wallet-balance {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

#wallet-usd {
    padding-left: 37px;
}

.wallet-btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-self: flex-end;
    margin-left: auto;
    padding-bottom: 2px;
}

.wallet-hist-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    text-decoration: none;
    color: #fff !important;
    box-shadow: none !important;
}

.wallet-wd-btn {
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #e2e8f0 !important;
    box-shadow: none !important;
}

/* Platform grid v2 — wider cards, responsive columns */
.platform-grid-v2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
}

@media (min-width: 480px) {
    .platform-grid-v2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 640px) {
    .platform-grid-v2 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Platform card v2 ── */
.platform-tile-v2 {
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.platform-tile-v2:hover {
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
}

/* Banner */
.ptile-banner {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    background: #0a0a0a;
    flex-shrink: 0;
}

.ptile-banner-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 0;
    border-bottom: 1px solid rgb(252, 182, 4);
    box-shadow: 0 0 20px rgba(241, 190, 4, 0.6);
    transition: transform 0.5s ease, opacity 0.5s ease, box-shadow 0.5s ease;
    will-change: transform, opacity;
}

.platform-tile-v2:hover .ptile-banner-img,
.platform-tile-v2:focus-within .ptile-banner-img {
    transform: scale(1.06);
    box-shadow: 0 0 32px rgba(252, 182, 4, 0.85);
}

.ptile-banner-fb {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(160deg, #1a0a00, #0a0a0a);
}

.ptile-banner-icon {
    font-size: 36px;
    opacity: 0.65;
}

.ptile-banner-name {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #555;
}

/* Body */
.ptile-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.ptile-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.ptile-name {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ptile-balance {
    font-size: 0.78rem;
    color: #fff;
    flex-shrink: 0;
}

.ptile-balance.has-bal {
    color: #4cde7a;
    font-weight: 700;
    font-size: 0.88rem;
}

/* Credentials */
.ptile-creds {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ptile-val--blur {
    filter: blur(5px);
    user-select: none;
    pointer-events: none;
    transition: filter 0.2s;
    flex: 1;
}

.ptile-reveal-trigger {
    cursor: pointer;
}

.ptile-reveal-trigger:hover .ptile-val--blur {
    filter: blur(3px);
}

.ptile-hint-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #a78bfa;
    opacity: 0.8;
}

.ptile-reveal-trigger:hover .ptile-hint-label {
    opacity: 1;
}

.ptile-creds-footer {
    padding-top: 2px;
    min-height: 20px;
}

.ptile-creds-pending {
    display: flex;
    align-items: center;
    padding: 6px 0;
}

.ptile-creating-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 6px;
    padding: 4px 10px;
    animation: ptile-pulse 1.6s ease-in-out infinite;
}

@keyframes ptile-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.ptile-row {
    display: flex;
    align-items: center;
    gap: 0;
    min-height: 28px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ptile-row:last-child {
    border-bottom: none;
}

.ptile-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    width: 36px;
    flex-shrink: 0;
    letter-spacing: 0.5px;
    margin-right: 10px;
}

.ptile-val {
    flex: 0 0 auto;
    font-size: 0.74rem;
    font-family: 'Courier New', monospace;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
    margin-right: 4px;
}

.ptile-pw {
    letter-spacing: 3px;
    color: #fff;
}

.ptile-icon-btn {
    background: none;
    border: none;
    padding: 2px 5px;
    font-size: 0.72rem;
    cursor: pointer;
    color: #fff;
    flex-shrink: 0;
    transition: color 0.15s;
    line-height: 1.4;
}

.ptile-icon-btn:hover {
    color: #fcb604;
}

/* Action buttons */
.ptile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: auto;
    padding-top: 4px;
}

.ptile-pill {
    border-radius: 50px;
    padding: 8px 0;
    font-size: 0.76rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    flex: 1;
}

.ptile-pill:hover {
    opacity: 0.82;
    text-decoration: none;
}

.ptile-play {
    background: #1c5c2a;
    color: #fff !important;
}

.ptile-dl {
    background: #1a2e7a;
    color: #fff !important;
}

.ptile-load-btn {
    background: #5c1c1c;
    color: #fff !important;
}

.ptile-redeem-btn {
    background: #1a3a1c;
    color: #4cde7a !important;
    border: 1px solid rgba(76, 222, 122, 0.3);
}

.ptile-redeem-btn:hover {
    background: #204a22;
    border-color: rgba(76, 222, 122, 0.6);
}

.ptile-refresh-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.72rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s;
}

.ptile-refresh-btn:hover {
    color: #111827;
}

.ptile-reset-btn {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.ptile-reset-btn:hover {
    background: rgba(252, 182, 4, 0.18);
    color: #fcb604;
    border-color: rgba(252, 182, 4, 0.4);
}


.tab.active {
    background: var(--gradient-primary);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.platform-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.platform-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    padding: 1rem;
    text-align: left;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: var(--text);
}

.platform-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.platform-icon {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.platform-balance {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 0.5rem;
    color: var(--color-primary);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.12);
    font-weight: 700;
    color: var(--text);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    margin: 0.75rem 0;
}

.progress-bar-inner {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 999px;
}

input[type="text"],
input[type="password"],
input[type="tel"],
input[type="number"] {
    width: 100%;
    max-width: 400px;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    margin: 0.5rem 0;
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus {
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 3px rgba(56, 168, 255, 0.18);
}

.logo-img {
    height: 64px;
    margin-bottom: 0.7rem;
    opacity: 0.85;
}

/* Form and register/login specific tweaks */
.platform-card form {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    text-align: left;
}

.platform-card input[type="text"],
.platform-card input[type="email"],
.platform-card input[type="tel"],
.platform-card input[type="password"] {
    background: #fff;
    color: #111827;
    border: 1px solid rgba(0, 0, 0, 0.06);
    max-width: 100%;
    padding: 10px 12px;
    margin: 0.5rem 0;
    box-shadow: none;
}

.platform-card .error {
    display: block;
    color: #ffb4b4;
    font-size: 0.9rem;
    margin-top: 6px;
}

.platform-card .note {
    color: var(--color-text);
    font-size: 0.95rem;
    margin-top: 8px;
}

.oauth-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    color: #222;
    border-radius: 8px;
    border: 1px solid #dcdcdc;
    text-decoration: none;
    font-weight: 700;
}

.center .platform-card {
    margin: 0 auto;
}

.wallet-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.crypto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.75rem;
    width: 100%;
    margin: 1rem 0;
}

.crypto-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-lg);
    color: var(--text);
    padding: 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    font-weight: 600;
}

.crypto-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

/* Ensure the portal always fills viewport in mobile */
html,
body {
    height: 100%;
}



/* Desktop: left nav inside page flow using CSS grid */
@media (min-width: 900px) {
    body {
        display: grid;
        grid-template-columns: var(--nav-sidebar-width) 1fr;
        grid-template-rows: auto 1fr auto;
        min-height: 100vh;
    }

    /* header spans both columns, stays visible */
    header {
        grid-column: 1 / -1;
        margin-left: 0;
        z-index: 1100;
        position: relative;
    }

    nav {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
        position: relative;
        width: 100%;
        align-self: start;
        margin-top: 8px;
        height: auto;
        min-height: 36.6vh;
        background: #0a0a0a;
        padding: 12px 0 24px;
        border-right: 1px solid rgba(255, 255, 255, 0.03);
        border-top-right-radius: 12px;
        box-shadow: 2px 8px 18px rgba(0, 0, 0, 0.08);
        display: flex;
        align-items: flex-start;
        z-index: 1000;
    }

    nav ul {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem 0;
        width: 100%;
        align-items: center;
        max-height: calc(50vh - 120px);
        overflow-y: auto;
    }

    nav ul li {
        width: 100%;
    }

    nav ul li a {
        padding: 0.6rem 0.5rem;
        justify-content: center;
        font-size: 0.95rem;
        width: 100%;
        text-align: center;
    }

    /* main content sits in the second column */
    main,
    #app {
        grid-column: 2 / -1;
        grid-row: 2 / 3;
        margin-left: 0;
    }
}

/* ── Mobile hamburger nav — slides above tab bar when open; hamburger (z:1200) stays on top ── */
@media (max-width: 720px) {
    nav:not(.mobile-tab-bar) {
        z-index: 1160;
    }
}

/* ── Mobile tab bar ──────────────────────────────────────────────────────────── */
.mobile-tab-bar {
    display: none;
}

@media (max-width: 720px) {
    .mobile-tab-bar {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: 56px;
        background: rgba(10, 10, 10, 0.97);
        border-top: 1px solid rgba(255, 255, 255, 0.07);
        z-index: 1150;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .tab-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: rgba(255, 255, 255, 0.45);
        text-decoration: none;
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.3px;
        padding: 6px 0 4px;
        transition: color 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .tab-item svg {
        stroke: currentColor;
        flex-shrink: 0;
        transition: stroke 0.15s ease;
    }

    .tab-item.active {
        color: #3b82f6;
    }

    .tab-item:active {
        color: rgba(59, 130, 246, 0.7);
    }

    /* ensure main content isn't obscured by the 56px fixed tab bar */
    main,
    #app {
        padding-bottom: calc(56px + 1.5rem);
    }
}

/* Old mobile-footer: keep class but hide — replaced by tab bar */
.mobile-footer {
    display: none !important;
}

/* Desktop site footer (in-page, spans full width) */
.site-footer {
    display: none;
}

@media (min-width: 721px) {
    .site-footer {
        display: block;
        grid-column: 1 / -1;
        grid-row: 3 / 4;
        background: #0a0a0a;
        color: #fff;
        padding: 1rem 2rem;
        border-top: 1px solid rgba(255, 255, 255, 0.04);
        box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.06);
    }

    .site-footer .footer-inner {
        max-width: var(--container-max-width);
        margin: 0 auto;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }

    .site-footer a {
        color: #fff;
        opacity: 0.9;
        text-decoration: none;
        font-size: 0.95rem;
        margin-left: 0.5rem;
    }
}

@media (max-width: 720px) {

    /* Footer shows in-flow above the fixed tab bar */
    .site-footer {
        display: block;
        background: #0a0a0a;
        color: rgba(255, 255, 255, 0.55);
        padding: 0.75rem 1rem 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        font-size: 0.8rem;
        text-align: center;
        /* Clear the fixed 56px tab bar */
        margin-bottom: 56px;
    }

    .site-footer .footer-inner {
        flex-direction: column;
        gap: 4px;
    }

    .site-footer a {
        color: rgba(255, 255, 255, 0.6);
        text-decoration: none;
        font-size: 0.8rem;
        margin-left: 0.4rem;
    }
}

/* ── Messages Page — Mobile fixes ──────────────────────────────────────────── */
@media (max-width: 720px) {

    /* Lock body scroll — prevent background content from scrolling behind the panel */
    body.fullscreen-messages {
        overflow: hidden;
        overscroll-behavior: none;
    }

    /* Full-screen chat layout: fills viewport below the header */
    body.fullscreen-messages #page-messages {
        position: fixed;
        top: 96px;
        left: 0;
        right: 0;
        bottom: 0;
        overflow: hidden;
        padding: 0;
        z-index: 10;
        display: flex;
        flex-direction: column;
    }

    /* Hide footer and FAB — they are in-flow and show inside the locked viewport on messages page */
    body.fullscreen-messages .site-footer,
    body.fullscreen-messages .fab {
        display: none !important;
    }

    /* Hide tab bar on messages — compose + back button replace it */
    body.fullscreen-messages .mobile-tab-bar {
        display: none !important;
    }

    /* Show back button on mobile */
    #msg-back-btn {
        display: inline-flex !important;
    }

    /* Inner wrapper becomes a flex column filling the full height */
    body.fullscreen-messages #page-messages .center.mt-1 {
        flex: 1 1 0;
        min-height: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        max-width: 100% !important;
        width: 100%;
        padding: 20px 10px 0 !important;
        overflow-x: hidden;
        overflow-y: hidden;
        box-sizing: border-box;
    }

    /* Compact heading */
    #page-messages h2 {
        font-size: 16px !important;
        margin-bottom: 1px !important;
        flex-shrink: 0;
    }

    #page-messages p {
        font-size: 11px !important;
        margin-bottom: 8px !important;
        flex-shrink: 0;
    }

    /* Thread card expands to fill all remaining space */
    #msg-thread-card {
        flex: 1 1 0;
        overflow: hidden;
        min-height: 0;
        margin-bottom: 8px !important;
        padding: 10px !important;
    }

    #msg-thread {
        max-height: none !important;
        height: 100%;
        overflow-y: auto;
    }

    /* Hide topic chips on mobile — save all space for conversation */
    #msg-topics {
        display: none !important;
    }

    /* Compose pinned at bottom, never scrolls away */
    #msg-compose-wrap {
        flex-shrink: 0;
        margin-bottom: 0 !important;
        border-radius: 12px 12px 0 0 !important;
    }

    /* Textarea: native font size ≥16px prevents iOS zoom */
    #msg-body {
        font-size: 16px !important;
    }
}

/* ── Mobile compact sizing (≤720px) ─────────────────────────────────────────── */
@media (max-width: 720px) {

    /* Buttons: smaller padding + font */
    .btn {
        padding: 8px 14px;
        font-size: 0.82rem;
        border-radius: 8px;
    }

    /* Inputs: reduced padding, keep ≥16px font to prevent iOS zoom */
    input[type="text"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    input[type="email"],
    select,
    textarea {
        padding: 0.6rem 0.75rem;
        font-size: 16px;
        border-radius: 10px;
        max-width: 100%;
    }

    /* Cards: tighter padding + full-width */
    .platform-card,
    .wallet-card {
        padding: 0.75rem;
        border-radius: 10px;
    }

    /* Page headings */
    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1rem;
    }

    /* Quick amount / crypto selector buttons */
    .dep-quick,
    .ltp-quick,
    .dep-crypto-btn {
        padding: 6px 10px !important;
        font-size: 0.78rem !important;
    }

    /* Tab toggles (ADD FUNDS / LOAD CREDITS) */
    .tab {
        padding: 0.5rem 0.8rem;
        font-size: 0.82rem;
    }

    /* Center content blocks */
    .center.mt-1 {
        padding: 0 0.25rem;
    }
}

/* ── History Page ───────────────────────────────────────────────────────────── */
.hist-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 0.5rem 0.5rem 5rem;
}

.hist-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    margin-bottom: 1rem;
}

.hist-tab {
    background: none;
    border: none;
    padding: 10px 18px 9px;
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

.hist-tab.active {
    color: #111827;
    font-weight: 700;
    border-bottom-color: var(--color-fire);
}

.hist-tab:hover:not(.active) {
    color: #374151;
}

.hist-pane {}

.hist-list {
    background: #0a0a0a;
    border-radius: 8px;
    overflow-y: auto;
    max-height: 70vh;
}

/* Individual row */
.hrow {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 10px 14px 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 2px solid transparent;
}

.hrow-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.hrow:last-child {
    border-bottom: none;
}

.hrow-ok {
    border-left-color: #1e5c30;
}

.hrow-fail {
    border-left-color: #5c1e1e;
}

.hrow-live {
    border-left-color: #4a4010;
}

/* Action-type accent borders */
.hrow-c-deposit {
    border-left-color: #1a4d28;
}

/* green  — crypto in        */
.hrow-c-load {
    border-left-color: #1a2e4d;
}

/* blue   — funds to platform */
.hrow-c-redeem {
    border-left-color: #30174d;
}

/* purple — winnings back     */
.hrow-c-withdraw {
    border-left-color: #4d2410;
}

/* amber  — money out         */
.hrow-c-bonus {
    border-left-color: #3d2e0a;
}

/* gold   — bonus credit      */
.hrow-c-other {
    border-left-color: #1f2530;
}

/* neutral                    */
.hrow-c-failed {
    border-left-color: #4d1010;
}

/* red    — expired/failed/cancelled */

.hrow-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.hrow-plat {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: 0.3px;
}

.hrow-action {
    font-size: 11px;
    color: var(--color-text);
}

.hrow-user {
    font-size: 11px;
    color: var(--color-text);
}

.hrow-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}

.hrow-amt {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.hrow-amt-in {
    color: var(--color-ok);
}

.hrow-amt-out {
    color: var(--color-text);
}

.hrow-amt-void {
    color: var(--color-text-secondary);
    text-decoration: line-through;
}

.hrow-note {
    font-size: 10px;
    color: var(--color-text);
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--color-border-faint);
    width: 100%;
    line-height: 1.4;
}

.hrow-status {
    font-size: 10px;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 4px;
}

.hrow-when {
    font-size: 10px;
    color: var(--color-text);
    white-space: nowrap;
}

.hrow-live-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--color-warn);
    display: inline-block;
    flex-shrink: 0;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.hist-empty {
    padding: 24px 16px;
    color: var(--color-text);
    font-size: 13px;
}

/* remove old rules that are no longer used */
.hist-page,
.hist-section,
.hist-section-header,
.hist-scroll,
.hist-row,
.hist-row-left,
.hist-row-right,
.hist-row-platform,
.hist-row-detail,
.hist-row-user,
.hist-row-time,
.hist-badge,
.hbadge-ok,
.hbadge-pending,
.hbadge-fail,
.hist-loading {}

/* ═══════════════════════════════════════════════════════════════════
   Wide-screen responsive layout — scales the sidebar, header, and
   content grid for 1200 px, 1440 px, and 1920 px+ viewports.
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1200 px: medium-large desktop ──────────────────────────────── */
@media (min-width: 1200px) {
    :root {
        --nav-sidebar-width: 160px;
        --container-max-width: 1400px;
    }

    nav ul li a {
        font-size: 0.9rem;
        padding: 0.65rem 0.75rem;
    }

    .platform-grid-v2 {
        grid-template-columns: repeat(4, 1fr);
    }

    .ptile-val {
        max-width: 160px;
    }

    .dash-wrap {
        max-width: 100%;
    }

    #app {
        padding: 1.5rem 1.5rem 1.5rem;
    }
}

/* ── 1440 px: 1440p / large widescreen ──────────────────────────── */
@media (min-width: 1440px) {
    :root {
        --nav-sidebar-width: 200px;
        --container-max-width: 1500px;
    }

    nav ul li a {
        font-size: 0.95rem;
        padding: 0.7rem 1rem;
    }

    .platform-grid-v2 {
        grid-template-columns: repeat(4, 1fr);
    }

    .ptile-val {
        max-width: 180px;
    }

    #app {
        padding: 1.75rem 2rem 1.75rem;
    }
}

/* ── 1920 px+: Full HD / ultra-wide ─────────────────────────────── */
@media (min-width: 1920px) {
    :root {
        --nav-sidebar-width: 220px;
        --container-max-width: 1700px;
    }

    header h1 {
        font-size: 2rem;
    }

    nav ul li a {
        font-size: 1rem;
        padding: 0.75rem 1.1rem;
    }

    nav {
        height: 40vh;
    }

    nav ul {
        max-height: calc(40vh - 120px);
    }

    .platform-grid-v2 {
        grid-template-columns: repeat(5, 1fr);
    }

    .ptile-val {
        max-width: 220px;
    }

    .ptile-banner,
    .ptile-banner-img {
        height: 220px;
    }

    #wallet-usd,
    .wallet-balance {
        font-size: 2.4rem;
    }

    #app {
        padding: 2rem 2.5rem;
    }
}

/* ── Context-aware platform card buttons ─────────────────────────────────── */
.ptile-load-btn.ptile-pill--active {
    background: linear-gradient(135deg, #3b82f6, #6366f1) !important;
    color: #fff !important;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

.ptile-play.ptile-pill--active,
.ptile-play-btn.ptile-pill--active {
    background: linear-gradient(135deg, #22c55e, #15803d) !important;
    color: #fff !important;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.4);
}

/* ── Loading skeleton for card credentials ───────────────────────────────── */
.ptile-skel-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ptile-skel-row:last-child {
    border-bottom: none;
}

.ptile-skel-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 36px;
    flex-shrink: 0;
}

.ptile-skel-line {
    height: 11px;
    border-radius: 4px;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.12) 50%,
            rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: ptile-skel-shimmer 1.4s ease-in-out infinite;
    flex: 1;
}

@keyframes ptile-skel-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ── Collapsible credentials section ─────────────────────────────────────── */
.ptile-creds-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 0 5px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
    text-align: left;
}

.ptile-creds-toggle:hover {
    color: rgba(255, 255, 255, 0.65);
}

.ptile-toggle-arrow {
    display: inline-block;
    font-style: normal;
    transition: transform 0.2s ease;
    line-height: 1;
}

.ptile-creds-toggle.is-open .ptile-toggle-arrow {
    transform: rotate(180deg);
}

.ptile-creds-collapsible {
    overflow: hidden;
    transition: max-height 0.22s ease, opacity 0.18s ease;
    max-height: 0;
    opacity: 0;
}

.ptile-creds-collapsible.is-open {
    max-height: 200px;
    opacity: 1;
}

/* ── History "Load More" button ──────────────────────────────────────────── */
.hist-load-more {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: center;
    letter-spacing: 0.3px;
}

.hist-load-more:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}

@media (max-width: 480px) {
    header {
        grid-template-columns: 68px 1fr 44px;
        height: 72px;
    }

    header .logo img {
        height: 72px;
    }

    header h1 {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        font-size: clamp(1rem, 4.5vw, 1.4rem);
    }

    header .branding {
        max-width: calc(100% - 90px);
    }

    #app {
        padding: 0.75rem 0.6rem 1rem;
    }
}