:root {
    --bg-base: #0a0b10;
    --bg-alt: #13151f;
    --surface: rgba(19, 21, 31, 0.6);
    --surface-hover: rgba(26, 29, 43, 0.8);
    --border: rgba(255, 255, 255, 0.06);
    --primary: #00e5ff;
    --primary-dim: rgba(0, 229, 255, 0.15);
    --purple: #8b5cf6;
    --live: #10b981;
    --dead: #ef4444;
    --unknown: #f59e0b;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 10px 30px -5px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 25px var(--primary-dim);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-base);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.08), transparent 30%),
        radial-gradient(circle at 85% 30%, rgba(0, 229, 255, 0.08), transparent 30%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100svh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

main.container {
    min-width: 0;
}

img, video, canvas, iframe, svg {
    max-width: 100%;
}

/* Typography Enhancements */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    letter-spacing: -0.05em;
    color: #fff;
}

h1 { font-size: 3.5rem; background: linear-gradient(to right, #fff, #9ca3af); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
h3 { font-size: 1.25rem; margin-bottom: 15px; }

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { filter: brightness(1.2); text-shadow: 0 0 10px var(--primary-dim); }

.text-primary { color: var(--primary); }
.text-purple { color: var(--purple); }
.text-live { color: var(--live); text-shadow: 0 0 12px rgba(16,185,129,0.3); }
.text-dead { color: var(--dead); text-shadow: 0 0 12px rgba(239,68,68,0.3); }
.text-unknown { color: var(--unknown); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-mono { font-family: 'Space Mono', monospace; }
.text-sm { font-size: 0.85rem; letter-spacing: 0.02em; }

/* Layouts */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; width: 100%; }
.grid { display: grid; gap: 24px; }
.grid > div { min-width: 0; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; } .mt-5 { margin-top: 48px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }

/* Navigation */
.navbar {
    background: rgba(10, 11, 16, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1280px; margin: 0 auto; padding: 20px 24px;
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; min-width: 0;
}

.nav-brand {
    font-family: 'Space Mono', monospace; font-size: 1.5rem; font-weight: 700; color: #fff;
    letter-spacing: -0.05em; text-transform: uppercase;
}
.nav-brand span { color: var(--primary); }

.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a {
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
}
.nav-links a:hover {
    background: rgba(0, 229, 255, 0.1);
    color: var(--primary);
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}
.nav-user { display: inline-flex; align-items: center; gap: 12px; margin-left: 16px; padding-left: 24px; border-left: 1px solid var(--border); }
.mobile-menu-btn { display: none; background: none; border: none; color: #fff; font-size: 1.8rem; cursor: pointer; transition: var(--transition); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 28px; border-radius: 12px; font-family: 'Space Mono', monospace;
    font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: var(--transition);
    border: 1px solid transparent; text-transform: uppercase; letter-spacing: 0.05em;
    position: relative; overflow: hidden;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #00a3ff);
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 229, 255, 0.4);
    filter: brightness(1.1);
}
.btn-outline {
    background: rgba(255,255,255,0.03); color: var(--text-main); border: 1px solid var(--border);
}
.btn-outline:hover {
    background: var(--surface-hover); border-color: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; border-radius: 8px; }
.btn:disabled { opacity: 0.4; pointer-events: none; filter: grayscale(1); box-shadow: none; transform: none; }

/* Cards & Glassmorphism */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); z-index: 10000;
    align-items: center; justify-content: center;
}
.modal.active { display: flex; animation: fadeIn 0.3s; }
.modal-content {
    background: var(--surface); border: 1px solid var(--border);
    padding: 30px; border-radius: var(--radius-md); width: 90%; max-width: 450px;
    box-shadow: var(--shadow-md); position: relative;
    animation: slideUp 0.3s;
}
.modal-close { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.card:hover {
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.7);
}

/* Badges */
.badge { padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.plan-free { background: rgba(156, 163, 175, 0.1); color: var(--text-muted); border: 1px solid rgba(156, 163, 175, 0.2); }
.plan-pro { background: rgba(139, 92, 246, 0.15); color: var(--purple); border: 1px solid rgba(139, 92, 246, 0.3); box-shadow: 0 0 15px rgba(139, 92, 246, 0.2); }
.plan-lifetime { background: rgba(16, 185, 129, 0.15); color: var(--live); border: 1px solid rgba(16, 185, 129, 0.3); box-shadow: 0 0 15px rgba(16, 185, 129, 0.2); }

/* Forms */
.form-group { margin-bottom: 24px; }
.form-group label { display: block; margin-bottom: 10px; font-size: 0.85rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; font-family: 'Space Mono', monospace;}
.form-control {
    width: 100%; padding: 14px 18px; background: rgba(0,0,0,0.2); border: 1px solid var(--border);
    border-radius: 10px; color: #fff; font-family: 'Space Mono', monospace; transition: var(--transition);
    font-size: 0.95rem;
}
.form-control:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-dim);
    background: rgba(0,0,0,0.4);
}
.form-control::placeholder { color: rgba(255,255,255,0.2); }
textarea.form-control { resize: vertical; min-height: 120px; line-height: 1.8; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%239ca3af%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E"); background-repeat: no-repeat; background-position: right 18px top 50%; background-size: 12px auto; padding-right: 48px; }

/* Tables */
.table-responsive { width: 100%; overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 700px; }
.table th, .table td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; font-family: 'Space Mono', monospace; background: rgba(0,0,0,0.2); }
.table tbody tr { transition: var(--transition); background: transparent; }
.table tbody tr:hover { background: rgba(255,255,255,0.02); }
.table tbody tr:last-child td { border-bottom: none; }

/* Radio Checkboxes */
.radio-label { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; cursor: pointer; transition: var(--transition); padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border); background: rgba(0,0,0,0.1); }
.radio-label:hover { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.15); transform: translateX(4px); }
.radio-label.disabled { opacity: 0.3; pointer-events: none; }
.radio-label input[type="radio"] { accent-color: var(--primary); transform: scale(1.3); }

/* Progress Element */
.progress { height: 8px; background: rgba(0,0,0,0.3); border-radius: 10px; overflow: hidden; }
.progress-bar { height: 100%; transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1); border-radius: 10px; background: linear-gradient(90deg, var(--primary), var(--purple)); box-shadow: 0 0 10px var(--primary-dim); }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 60px 0; margin-top: 100px; font-size: 0.9rem; color: var(--text-muted); background: var(--bg-alt); }

/* Checker Columns & Interactions */
.checker-tabs { border-bottom: 1px solid var(--border); padding-bottom: 16px; display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; }
.checker-tabs::-webkit-scrollbar { display: none; }
.checker-columns .result-col { background: transparent; transition: var(--transition); }
.col-header { padding: 12px 16px; border-radius: 8px; font-family: 'Space Mono', monospace; font-size: 0.9rem; font-weight: 700; text-transform: uppercase; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.2); border: 1px solid var(--border); }

#colLive .col-header { color: var(--live); border-color: rgba(16,185,129,0.2); background: rgba(16,185,129,0.05); }
#colDead .col-header { color: var(--dead); border-color: rgba(239,68,68,0.2); background: rgba(239,68,68,0.05); }
#colUnknown .col-header { color: var(--unknown); border-color: rgba(245,158,11,0.2); background: rgba(245,158,11,0.05); }

.col-content { display: flex; flex-direction: column; gap: 12px; }
.card-item {
    background: rgba(0,0,0,0.2); border: 1px solid var(--border); border-left-width: 4px;
    padding: 16px; border-radius: 10px; font-family: 'Space Mono', monospace; font-size: 0.85rem;
    word-break: break-all; animation: slideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    transition: var(--transition);
}
.card-item:hover { transform: translateX(4px); background: rgba(255,255,255,0.03); }

@keyframes slideIn {
    0% { opacity: 0; transform: translateY(-10px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}
.toast {
    background: rgba(15, 17, 24, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    color: #fff;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    transform: translateX(120%);
    opacity: 0;
    animation: toastIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: auto;
}
.toast.toast-success { border-left-color: var(--live); box-shadow: 0 10px 30px rgba(16,185,129,0.25); }
.toast.toast-error { border-left-color: var(--dead); box-shadow: 0 10px 30px rgba(239,68,68,0.25); }

@keyframes toastIn { to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateX(120%); opacity: 0; } }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; border: 2px solid var(--bg-base); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ═══════════════════════════════════════════════
   RESPONSIVE — Mobile First Breakpoints
   ═══════════════════════════════════════════════ */
body, html { overflow-x: hidden; width: 100%; }
img, video, canvas, iframe, svg, pre, code { max-width: 100%; height: auto; }
table { max-width: 100%; }
pre { white-space: pre-wrap; word-break: break-word; }

/* ── Tablet & Below ── */
@media (max-width: 1100px) {
    h1 { font-size: 2.5rem !important; }
    .hero h1 { font-size: 2.5rem !important; }
    .pricing-header h2 { font-size: 2rem !important; }
}

@media (max-width: 900px) {
    body, html { width: 100%; overflow-x: hidden; }
    .container { padding: 0 12px; max-width: 100%; width: 100%; }

    /* Force single-column grids */
    .grid { display: grid !important; grid-template-columns: 1fr !important; gap: 16px !important; }
    .layout-grid, .checker-columns { display: grid !important; grid-template-columns: 1fr !important; gap: 16px !important; }
    .full-span { grid-column: span 1 !important; }

    /* Typography */
    h1 { font-size: 2rem !important; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.1rem !important; }

    /* Toast */
    .toast-container { right: 10px; left: 10px; top: 10px; }

    /* Cards */
    .card { margin-left: 0 !important; margin-right: 0 !important; max-width: 100% !important; box-sizing: border-box; padding: 16px !important; width: 100% !important; border-radius: 12px; }

    /* Stats grid */
    .dashboard-stats-grid { grid-template-columns: repeat(2, 1fr) !important; }

    /* Checker columns */
    .checker-columns .col-content { max-height: 350px !important; }

    /* Profile grid */
    .profile-grid { grid-template-columns: 1fr !important; }

    /* Checkout grid */
    .checkout-grid { grid-template-columns: 1fr !important; }

    /* API docs grid */
    .api-docs-grid { grid-template-columns: 1fr !important; }

    /* Pricing cards */
    .pricing-grid { grid-template-columns: 1fr !important; max-width: 400px !important; margin: 0 auto !important; }
    .pricing-card .ribbon { display: none; }

    /* Dashboard layout */
    .dashboard-main-grid { grid-template-columns: 1fr !important; }
    .dashboard-left-col { grid-template-columns: 1fr !important; }
    .dashboard-chart-grid { grid-template-columns: 1fr !important; }

    /* Dashboard stats row */
    .stats-row { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }

    /* Affiliate link */
    .affiliate-link-row { flex-direction: column !important; }
    .affiliate-link-row > div { width: 100% !important; }
    .affiliate-link-row button { width: 100% !important; }

    /* Gateway grid */
    .gateway-reference-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important; }

    /* Checker header */
    .checker-header { flex-direction: column !important; align-items: stretch !important; gap: 12px !important; }
    .checker-header > div { text-align: left !important; }

    /* Checker buttons */
    .checker-actions { flex-direction: column !important; }
    .checker-actions .btn { width: 100% !important; min-width: 0 !important; flex: none !important; }

    /* Step method URL */
    .pg-step-method-url { min-width: 0 !important; flex-wrap: wrap !important; }
    .pg-step-method-url .pg-select { width: 100% !important; }
    .pg-step-method-url .pg-url-input { width: 100% !important; }

    /* Playground topbar */
    .pg-topbar { flex-direction: column !important; align-items: stretch !important; }
    .pg-topbar-left, .pg-topbar-center, .pg-topbar-right { width: 100% !important; justify-content: center !important; }
    .pg-topbar-center { order: 3 !important; }
    .pg-topbar-right { flex-wrap: wrap !important; }

    /* Playground card input */
    .pg-card-input-row { flex-wrap: wrap !important; }
    .pg-card-field { width: 100% !important; }

    /* Dashboard header */
    .dashboard-header { flex-direction: column !important; align-items: flex-start !important; gap: 16px !important; }
    .dashboard-header .btn { width: 100% !important; justify-content: center !important; }

    /* Header h2 font shrink */
    .dashboard-header h2 { font-size: 1.3rem !important; }

    /* Row flexbox to column */
    .flex-row-to-col { flex-direction: column !important; }
    .my-gate-row { flex-direction: column !important; align-items: stretch !important; }
    .my-gate-row > div { min-width: 0 !important; }
    .my-gate-row .gate-actions { margin-left: 0 !important; justify-content: flex-end !important; }

    /* Notifications */
    .notif-dropdown { width: 280px !important; right: -60px !important; }

    /* Form rows */
    .form-row-inline { flex-direction: column !important; align-items: stretch !important; }
    .form-row-inline > * { width: 100% !important; }

    /* Hero section */
    .hero { padding: 40px 16px 30px !important; }
    .hero p { font-size: 1rem !important; }
    .hero .btn { font-size: 1rem !important; padding: 12px 24px !important; }

    /* Footer */
    .footer .grid { grid-template-columns: repeat(2, 1fr) !important; gap: 20px !important; }
    .footer-bottom { flex-direction: column !important; text-align: center !important; }

    /* Modal */
    .modal-content { width: 95% !important; max-width: 95% !important; padding: 20px !important; }

    /* Checker tabs */
    .checker-tabs { overflow-x: auto !important; flex-wrap: nowrap !important; }
    .checker-tabs .btn { white-space: nowrap !important; flex-shrink: 0 !important; }

    /* Telegram integration row */
    .tg-integration-row { flex-direction: column !important; align-items: stretch !important; gap: 12px !important; }
    .tg-integration-row > div { width: 100% !important; }

    /* Summary bar */
    .summary-bar { gap: 8px !important; }
    .summary-bar > div { flex: 1 1 40% !important; }

    /* API Key box */
    .api-key-box { overflow-x: auto !important; }

    /* Step header */
    .pg-step-header { flex-wrap: wrap !important; }
    .pg-step-actions { margin-left: 0 !important; width: 100% !important; justify-content: flex-end !important; }

    /* Body type row */
    .pg-body-type-row { flex-wrap: wrap !important; gap: 8px !important; }

    /* Snippet modal */
    .snippet-content pre { font-size: 0.7rem !important; overflow-x: auto !important; }

    /* Checkout */
    .checkout-card { padding: 20px !important; }

    /* Gate detail view */
    .pg-grid-2 { grid-template-columns: 1fr !important; }
    .pg-form-row .pg-grid-2 { grid-template-columns: 1fr !important; }
}

@media (max-width: 768px) {
    /* Navigation */
    .nav-links {
        display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; width: 65%; max-width: 280px; height: calc(100vh - 70px);
        background: rgba(10,11,16,0.98); backdrop-filter: blur(20px); padding: 20px;
        border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); z-index: 999;
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
    }
    .nav-links.active {
        transform: translateX(0);
        visibility: visible;
    }
    .nav-links a { width: 100%; text-align: left; padding: 12px 16px; border-radius: 8px; }
    .nav-user { margin: 16px 0 0 0; padding: 16px 0 0 0; border-left: none; border-top: 1px solid var(--border); width: 100%; justify-content: flex-start; gap: 10px; flex-wrap: wrap; }
    .nav-user .badge { width: 100%; text-align: center; }
    .mobile-menu-btn { display: block; }

    .container { padding: 0 10px; }
    .card { padding: 15px !important; border-radius: 10px; }
    .btn { width: 100%; justify-content: center; padding: 14px; }
    .dashboard-header { flex-direction: column; align-items: flex-start !important; }

    /* Nav padding */
    .nav-container { padding: 16px 12px !important; }

    /* Stats */
    .stats-row { grid-template-columns: repeat(2, 1fr) !important; }
    .stats-row .stat-card { padding: 12px !important; }
    .stats-row .stat-card div[style*="font-size: 2rem"] { font-size: 1.5rem !important; }

    /* Checker textarea */
    #cardInput { height: 120px !important; }

    /* Pricing cards */
    .pricing-card { padding: 20px !important; }
    .pricing-card h3 { font-size: 1.5rem !important; }
    .pricing-card ul { padding-left: 10px !important; font-size: 0.9rem !important; }

    /* Profile */
    .profile-grid { gap: 16px !important; }
    .profile-card { padding: 16px !important; }

    /* Table font size */
    .table th, .table td { padding: 10px 12px !important; font-size: 0.8rem !important; }

    /* Radio labels */
    .radio-label { flex-direction: column !important; align-items: flex-start !important; gap: 8px !important; }

    /* Checkout address row */
    .checkout-addr-row { flex-direction: column !important; }
    .checkout-addr-row button { width: 100% !important; }

    /* Playground */
    .pg-steps-sidebar { width: 180px !important; }
    .pg-response-panel { width: 100% !important; }
    .pg-step-method-url { min-width: 0 !important; }
    .pg-url-input { width: 100% !important; }

    /* Footer */
    .footer { padding: 30px 0 !important; }
    .footer .grid { grid-template-columns: 1fr 1fr !important; gap: 16px !important; }

    /* Gate reference items */
    .gate-ref-item { padding: 12px !important; }

    /* Dashboard notifications */
    .dashboard-notif-card { padding: 12px !important; }
}

@media (max-width: 640px) {
    body.page-dashboard .gateway-reference-grid {
        grid-template-columns: 1fr !important;
    }
    body.page-dashboard .table {
        min-width: 0 !important;
    }
    body.page-login .container > .card > div:last-child,
    body.page-register .container > .card > div:last-child {
        padding: 24px 18px !important;
    }

    /* Smaller stats */
    .stats-row { grid-template-columns: repeat(2, 1fr) !important; }
    .stats-row .stat-card { padding: 10px !important; }
    .stats-row .stat-card div[style*="font-size: 2rem"] { font-size: 1.3rem !important; }

    /* Table scroll */
    .table-responsive { overflow-x: auto !important; }
    .table { min-width: 500px !important; }

    /* Footer single column */
    .footer .grid { grid-template-columns: 1fr !important; text-align: center !important; }

    /* Profile table */
    .profile-proxy-table { min-width: 0 !important; }
    .profile-proxy-table .table { min-width: 0 !important; }

    /* Playground */
    .pg-steps-sidebar { display: none !important; }
    .pg-steps-panel { padding: 12px !important; }
    .pg-topbar .pg-card-input-row { flex-direction: column !important; align-items: stretch !important; }
    .pg-topbar .pg-card-input-row .pg-card-field { width: 100% !important; border-right: none !important; margin-right: 0 !important; }
    .pg-topbar .pg-card-input-row .pg-sep { display: none !important; }

    /* Checkout */
    .checkout-order-details { padding: 16px !important; }
}

@media (max-width: 480px) {
    .table-responsive { border: none; border-radius: 0; margin: 0 -10px; width: calc(100% + 20px); }
    .card { padding: 12px !important; }
    .nav-container { padding: 12px 10px !important; }

    .nav-brand { font-size: 1.2rem !important; }

    h1 { font-size: 1.6rem !important; }
    h2 { font-size: 1.2rem !important; }
    h3 { font-size: 1rem !important; }

    .stats-row { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }

    .checker-tabs { gap: 6px !important; }
    .checker-tabs .btn { font-size: 0.75rem !important; padding: 6px 12px !important; }

    .summary-bar > div { flex: 1 1 100% !important; }

    /* Playground full width response */
    .pg-layout { flex-direction: column !important; }
    .pg-response-panel { width: 100% !important; border-left: none !important; border-top: 1px solid var(--border); height: 300px !important; }
    .pg-steps-panel { padding: 8px !important; }
    .pg-step-header { padding: 10px 12px !important; }
    .pg-step-tabs { padding: 0 8px !important; }
    .pg-stab { padding: 8px 10px !important; font-size: 0.78rem !important; }

    .pg-topbar { padding: 8px 12px !important; }
    .pg-topbar .pg-btn-outline, .pg-topbar .pg-btn-primary { font-size: 0.78rem !important; padding: 6px 10px !important; }
    .pg-topbar .pg-logo { font-size: 0.95rem !important; }

    .pg-card-input-row { padding: 6px 10px !important; }
    .pg-card-field { font-size: 0.8rem !important; }

    /* Footer */
    .footer .grid { grid-template-columns: 1fr !important; padding: 20px 0 !important; }
    .footer-bottom { flex-direction: column !important; align-items: center !important; gap: 8px !important; }

    /* Telegram button area */
    .nav-user { flex-direction: column !important; align-items: stretch !important; }
    .nav-user a, .nav-user .badge { width: 100% !important; text-align: center !important; }

    /* Notifications smaller */
    .notif-dropdown { left: 10px !important; right: 10px !important; width: auto !important; max-width: none !important; position: fixed !important; top: 70px !important; }

    /* API Docs */
    .api-docs-pre { font-size: 0.7rem !important; padding: 12px !important; }

    /* Gate modal */
    .pg-modal-box { max-width: 98vw !important; }
    .pg-modal-lg { width: 100% !important; }

    /* Checkout */
    .checkout-card { padding: 16px !important; }
    .checkout-order-details { padding: 14px !important; }

    /* Snippet modal */
    #snippetModal .modal-content { max-width: 95% !important; padding: 16px !important; }

    /* Chart containers */
    canvas { max-height: 200px !important; }
}

body.page-login main.container,
body.page-register main.container {
    min-height: calc(100vh - 72px);
    min-height: calc(100svh - 72px);
    display: flex;
    align-items: center;
}

body.page-login .container,
body.page-register .container {
    width: 100%;
}

body.page-login .container > .card,
body.page-register .container > .card {
    width: 100%;
    max-width: 980px;
    min-width: 0;
}

body.page-dashboard .container {
    max-width: 1440px;
}

body.page-dashboard .dashboard-header {
    gap: 14px;
}

body.page-dashboard .dashboard-header .btn {
    white-space: nowrap;
}

body.page-dashboard .gateway-reference-grid {
    min-width: 0;
}

body.page-dashboard .my-gate-row,
body.page-dashboard .gate-ref-item,
body.page-dashboard .api-key-box {
    min-width: 0;
}

body.page-playground main.container {
    max-width: none;
    width: 100%;
    padding: 0;
}

body.page-playground .footer {
    display: none;
}

body.page-playground .navbar .nav-container {
    max-width: none;
}

@media (max-width: 900px) {
    body.page-login main.container,
    body.page-register main.container {
        min-height: auto;
        padding-top: 16px;
        padding-bottom: 16px;
    }

    body.page-login .container > .auth-card,
    body.page-register .container > .auth-card,
    body.page-login .auth-card,
    body.page-register .auth-card {
        grid-template-columns: 1fr !important;
        max-width: 450px !important;
    }

    body.page-login .container > .auth-card > div:first-child,
    body.page-register .container > .auth-card > div:first-child {
        display: none !important;
    }

    body.page-login .container > .auth-card > div:last-child,
    body.page-register .container > .auth-card > div:last-child {
        padding: 28px 22px !important;
    }

    body.page-dashboard .dashboard-header {
        align-items: stretch !important;
    }

    body.page-dashboard .dashboard-header .btn {
        width: 100%;
        justify-content: center;
    }

    body.page-dashboard .my-gate-row {
        flex-direction: column;
        align-items: stretch;
    }

    body.page-dashboard .my-gate-row > div {
        min-width: 0;
    }

    body.page-dashboard .gateway-reference-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    body.page-dashboard .gateway-reference-grid {
        grid-template-columns: 1fr !important;
    }

    body.page-dashboard .table {
        min-width: 620px;
    }

    body.page-login .container > .card > div:last-child,
    body.page-register .container > .card > div:last-child {
        padding: 24px 18px !important;
    }
}

/* Notification Center Dropdown */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 320px;
    background: rgba(15, 16, 26, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5), 0 5px 15px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.98);
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 1000;
}
.notif-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.notif-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 0.95rem;
}
.notif-body {
    max-height: 350px;
    overflow-y: auto;
}
.notif-body::-webkit-scrollbar { width: 4px; }
.notif-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.notif-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: var(--transition);
    cursor: pointer;
}
.notif-item:hover {
    background: rgba(255,255,255,0.03);
}
.notif-item-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.notif-item-content { flex: 1; min-width: 0; }
.notif-item-title { font-weight: 600; font-size: 0.85rem; color: #fff; margin-bottom: 2px; }
.notif-item-text { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }

.notif-footer {
    padding: 12px;
    text-align: center;
    border-top: 1px solid var(--border);
}
.notif-footer a {
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.notif-footer a:hover { text-decoration: underline; }

@media (max-width: 480px) {
    .notif-dropdown {
        position: fixed;
        top: 70px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
    }
}

/* Modern Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: .4s;
    border-radius: 24px;
    border: 1px solid var(--border);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: #fff;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-color: var(--live);
    border-color: var(--live);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--live);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

input:disabled + .slider {
    opacity: 0.3;
    cursor: not-allowed;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

button, input, select, textarea {
    max-width: 100%;
}

.nav-container {
    position: relative;
}

.nav-brand {
    max-width: calc(100vw - 160px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-user {
    min-width: 0;
}

.nav-user > span:first-child {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero {
    max-width: 100%;
}

.hero p {
    overflow-wrap: anywhere;
}

.stats-row {
    min-width: 0;
}

.stats-row .stat-card {
    min-width: 0;
    overflow-wrap: anywhere;
}

.dashboard-header {
    min-width: 0;
}

.dashboard-header h2 {
    overflow-wrap: anywhere;
}

.gate-name-display,
.api-key-box,
#refLink,
#addrText,
code {
    min-width: 0;
    overflow-wrap: anywhere;
}

.footer {
    border-top: 1px solid var(--border);
    margin-top: 64px !important;
    padding: 42px 0 22px !important;
    background: linear-gradient(180deg, rgba(19, 21, 31, 0.82), rgba(10, 11, 16, 0.96));
}

.footer-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
    gap: 32px;
    align-items: center;
}

.footer-brand {
    font-family: 'Space Mono', monospace;
    color: var(--primary);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.footer p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    max-width: 680px;
}

.footer-links {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px 18px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
    text-shadow: none;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

.footer-bottom a {
    color: var(--primary);
    text-decoration: none;
}

.footer-bottom a:hover {
    text-shadow: none;
}

@media (max-width: 1024px) {
    .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .hero {
        padding-top: 64px !important;
        padding-bottom: 36px !important;
    }

    .hero h1,
    .hero .text-primary[style*="font-size: 3.5rem"] {
        font-size: 2.45rem !important;
    }

    .hero p {
        font-size: 1.05rem !important;
    }

    .checkout-grid,
    .profile-grid,
    .api-docs-grid,
    .dashboard-main-grid,
    .dashboard-chart-grid {
        grid-template-columns: 1fr !important;
    }

    .footer {
        margin-top: 56px !important;
    }
}

@media (max-width: 768px) {
    body {
        background-attachment: scroll !important;
        min-height: 100vh;
        min-height: 100svh;
    }

    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
        max-width: 100% !important;
    }

    .nav-container {
        padding: 14px 12px !important;
    }

    .nav-brand {
        font-size: 1.25rem !important;
        max-width: calc(100vw - 126px) !important;
    }

    .nav-links {
        padding: 16px !important;
    }

    .nav-links a,
    .nav-user a,
    .nav-user .badge {
        width: 100% !important;
        text-align: center !important;
    }

    .btn,
    .hero .btn {
        width: 100% !important;
        min-height: 44px;
        justify-content: center !important;
        font-size: 1rem !important;
        padding: 13px 16px !important;
        white-space: normal !important;
    }

    .btn-sm {
        padding: 9px 12px !important;
        font-size: 0.78rem !important;
    }

    .hero {
        padding: 44px 0 28px !important;
    }

    .hero h1,
    .hero .text-primary[style*="font-size: 3.5rem"] {
        font-size: 2rem !important;
        line-height: 1.12 !important;
    }

    .hero p {
        font-size: 1rem !important;
    }

    .grid,
    .checkout-grid,
    .profile-grid,
    .api-docs-grid,
    .dashboard-main-grid,
    .dashboard-chart-grid,
    .gateway-reference-grid {
        grid-template-columns: 1fr !important;
    }

    .card,
    .checkout-card {
        padding: 16px !important;
        border-radius: 12px !important;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .stats-row .stat-card {
        padding: 12px !important;
    }

    .stats-row .stat-card div[style*="font-size: 2rem"] {
        font-size: 1.45rem !important;
    }

    .dashboard-header {
        align-items: stretch !important;
    }

    .dashboard-header .btn {
        width: 100% !important;
        justify-content: center !important;
    }

    .my-gate-row,
    .affiliate-link-row,
    .checkout-addr-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .my-gate-row > div:last-child,
    .affiliate-link-row > div:last-child,
    .checkout-addr-row > div:last-child {
        width: 100% !important;
    }

    .form-row-inline,
    .tg-integration-row,
    .pg-card-input-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .form-row-inline > *,
    .tg-integration-row > *,
    .pg-card-input-row > * {
        width: 100% !important;
    }

    .table-responsive {
        max-width: 100%;
    }

    .table {
        min-width: 560px !important;
    }

    .footer {
        margin-top: 48px !important;
        padding: 32px 0 18px !important;
    }

    .footer-inner {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }

    .footer-links {
        justify-content: flex-start !important;
    }

    .footer-bottom {
        justify-content: center !important;
    }

    body.page-checkout .container {
        margin: 32px auto 0 !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    body.page-checkout .text-center h2 {
        font-size: 1.8rem !important;
    }

    #qrArea img {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .nav-container {
        padding: 12px 10px !important;
    }

    .nav-brand {
        font-size: 1.1rem !important;
        max-width: calc(100vw - 118px) !important;
    }

    .hero {
        padding: 36px 0 24px !important;
    }

    .hero h1,
    .hero .text-primary[style*="font-size: 3.5rem"] {
        font-size: 1.72rem !important;
    }

    .hero p {
        font-size: 0.95rem !important;
    }

    .btn,
    .hero .btn {
        font-size: 0.92rem !important;
        padding: 12px 14px !important;
    }

    .btn-sm {
        font-size: 0.72rem !important;
        padding: 8px 10px !important;
    }

    .card,
    .checkout-card {
        padding: 13px !important;
        border-radius: 10px !important;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .stats-row .stat-card {
        padding: 10px !important;
    }

    .stats-row .stat-card div[style*="font-size: 2rem"] {
        font-size: 1.22rem !important;
    }

    .table-responsive {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        border-radius: 8px !important;
    }

    .table {
        min-width: 520px !important;
    }

    .footer {
        padding: 28px 0 16px !important;
    }

    .footer-links {
        gap: 8px 14px !important;
    }

    .footer-bottom {
        font-size: 0.78rem !important;
    }

    body.page-checkout .container {
        margin: 24px auto 0 !important;
    }

    body.page-checkout .text-center h2 {
        font-size: 1.55rem !important;
    }

    .checkout-card {
        padding: 14px !important;
    }
}

