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

:root {
    /* Professional dark UI: neutral zinc + violet accent */
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --accent-dark: #7c3aed;
    --accent-secondary: #c4b5fd;
    --accent-rgb: 139, 92, 246;
    --accent-secondary-rgb: 167, 139, 250;
    --accent-deep-rgb: 124, 58, 237;
    --bubble-tint-rgb: 255, 255, 255;
    --bg-dark: #09090b;
    --bg-darker: #050506;
    --surface: #18181b;
    --surface-elevated: #27272a;
    --text-primary: #fafafa;
    --text-secondary: rgba(250, 250, 250, 0.62);
    --text-accent-muted: #a1a1aa;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.35);

    /* Legacy token names (used across the stylesheet) */
    --primary-purple: var(--accent);
    --primary-purple-light: var(--accent-light);
    --primary-purple-dark: var(--accent-dark);
    --gradient-purple: linear-gradient(180deg, var(--accent-light) 0%, var(--accent) 100%);
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
    font-family: "Inter", sans-serif;
    position: relative;
}

/* Purple glowing grid lines only */
.background-pattern {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.4s ease;
    background-color: var(--bg-dark);
    background-image:
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 63px,
            rgba(var(--accent-rgb), 0.14) 63px,
            rgba(var(--accent-rgb), 0.14) 64px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 63px,
            rgba(var(--accent-rgb), 0.14) 63px,
            rgba(var(--accent-rgb), 0.14) 64px
        );
    background-size: 64px 64px;
}

.background-pattern::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 63px,
            rgba(var(--accent-rgb), 0.12) 63px,
            rgba(var(--accent-rgb), 0.12) 64px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 63px,
            rgba(var(--accent-rgb), 0.12) 63px,
            rgba(var(--accent-rgb), 0.12) 64px
        );
    background-size: 64px 64px;
    filter: blur(1.6px);
    opacity: 0.35;
}


/* Minimal ambient depth — neutral only */
.cursor-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(
        720px circle at var(--x, 50%) var(--y, 50%),
        rgba(255, 255, 255, 0.03),
        transparent 70%
    );
    filter: blur(32px);
    transition: opacity 0.3s ease;
}

/* Show grid when mouse is hovering - always show on body */
body .background-pattern {
    opacity: 1;
}

/* Landing page: slightly brighter grid with subtle glow */
body.page-home .background-pattern {
    background-image:
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 63px,
            rgba(var(--accent-rgb), 0.22) 63px,
            rgba(var(--accent-rgb), 0.22) 64px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 63px,
            rgba(var(--accent-rgb), 0.22) 63px,
            rgba(var(--accent-rgb), 0.22) 64px
        );
}
body.page-home .background-pattern::after {
    filter: blur(2px);
    opacity: 0.45;
}

/* Make sure content sits above the glow */
main, nav, header, section, .content, .navbar {
  position: relative;
    z-index: 2;
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-primary);
    background: rgba(12, 12, 14, 0.38);
    backdrop-filter: blur(36px) saturate(200%) brightness(1.08);
    -webkit-backdrop-filter: blur(36px) saturate(200%) brightness(1.08);
    border: 1px solid rgba(255, 255, 255, 0.09);
    padding: 14px 22px;
    height: auto;
    min-height: 52px;
    position: fixed;
    top: 16px;
    left: 20px;
    right: 20px;
    z-index: 100;
    border-radius: 10px;
    font-family: "Inter", sans-serif;
    font-size: 15px;
    margin-bottom: 5px;
    animation: slideDown 0.5s ease-out;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.11),
        inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}

.navbar:hover {
    background: rgba(12, 12, 14, 0.52);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.nav-logo {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.03em;
    font-size: 24px;
}

.x-icon {
    width: 22px;
    height: 22px;
    cursor: pointer;
    opacity: 0.65;
    transition: opacity 0.2s ease;
    filter: brightness(0) invert(1);
}

.x-icon:hover {
    opacity: 1;
}

h1 {
    font-family: "Inter", sans-serif;
    font-size: 24px;
    font-weight: 600;
}
/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.container {
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 60px;
}

.main-title {
    font-family: "Inter", sans-serif;
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.15;
    margin-bottom: 20px;
    font-weight: 600;
    letter-spacing: -0.035em;
    color: var(--text-primary);
}

.psol {
    color: var(--accent-light);
    position: relative;
    display: inline-block;
}

.psol::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    opacity: 0.45;
    transform: scaleX(0);
    transform-origin: left;
    animation: underlineExpand 0.8s ease-out 0.5s forwards;
}

.subtxt {
    font-family: "Inter", sans-serif;
    font-size: clamp(16px, 2.2vw, 20px);
    line-height: 1.65;
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 560px;
    margin: 0 auto;
    letter-spacing: 0;
}

/* Button — same glass effect as .navbar */
.btn {
    position: relative;
    margin-top: 36px;
    margin-bottom: 40px;
    width: auto;
    min-width: 220px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-primary);
    background: rgba(12, 12, 14, 0.38);
    backdrop-filter: blur(36px) saturate(200%) brightness(1.08);
    -webkit-backdrop-filter: blur(36px) saturate(200%) brightness(1.08);
    border: 1px solid rgba(255, 255, 255, 0.09);
    padding: 14px 28px;
    height: auto;
    min-height: 52px;
    border-radius: 10px;
    font-family: "Inter", sans-serif;
    font-size: 15px;
    font-weight: 600;
    animation: slideDown 0.5s ease-out;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.11),
        inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}
.btn:hover {
    background: rgba(20, 20, 24, 0.48);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}
.btn:active {
    transform: translateY(1px);
}

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-arrow {
    position: relative;
    z-index: 1;
    font-size: 16px;
    font-weight: 500;
}

/* Dashboard Styles */

.dashboard-greeting {
    font-family: "Inter", sans-serif;
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 40px;
    letter-spacing: -0.03em;
}

.dashboard-cards {
    display: flex;
    gap: 24px;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
    max-width: 2000px;
    width: 100%;
    margin: 0 auto;
}

/* Swipe deck: stacked cards (dashboard) */
.dashboard-cards.deck-shell {
    display: block;
    max-width: 360px;
    min-height: 400px;
    position: relative;
}

.works-deck {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    min-height: 400px;
    touch-action: none;
}

.works-deck .work-swipe-card {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    flex: none;
    max-width: 320px;
    width: 100%;
    touch-action: none;
    transition: transform 0.22s ease, opacity 0.22s ease, box-shadow 0.3s ease;
    will-change: transform, opacity;
}

.works-deck .work-swipe-card.is-dragging {
    transition: none;
}

.works-deck .work-swipe-card.is-active {
    z-index: 3;
    transform: translateX(0) rotate(0deg);
}

.works-deck .work-swipe-card.is-next {
    z-index: 2;
    transform: scale(0.96) translateY(14px);
    pointer-events: none;
}

.works-deck .work-swipe-card.is-last {
    z-index: 1;
    transform: scale(0.92) translateY(28px);
    pointer-events: none;
}

.works-deck .work-swipe-card.is-active:hover {
    transform: translateX(0) rotate(0deg);
    box-shadow: var(--shadow-md);
}

.dashboard-card.work-swipe-card.is-active {
    border: 1px solid rgba(var(--accent-rgb), 0.45);
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.2), var(--shadow-md);
}

/* Dashboard desktop: side-by-side cards, no swipe stack */
@media (min-width: 769px) {
    .dashboard-cards.deck-shell {
        display: flex;
        max-width: 1040px;
        min-height: auto;
    }

    .works-deck {
        display: flex;
        gap: 20px;
        position: static;
        min-height: auto;
        max-width: 100%;
        touch-action: auto;
    }

    .works-deck .work-swipe-card {
        position: relative;
        flex: 1;
        max-width: 320px;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto;
    }

    .works-deck .work-swipe-card.is-next,
    .works-deck .work-swipe-card.is-last {
        transform: none !important;
        pointer-events: auto;
    }

    .swipe-hint {
        display: none;
    }
}

.dashboard-card {
    flex: 1;
    min-width: 280px;
    max-width: 320px;
    height: 400px;
    background: var(--surface);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.32s ease, box-shadow 0.32s ease, transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.dashboard-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.09) 0%, transparent 55%);
    opacity: 0;
    transition: opacity 0.32s ease;
    pointer-events: none;
}

@media (hover: hover) and (min-width: 769px) {
    .dashboard-card:hover {
        transform: translateY(-10px) scale(1.02);
        border-color: rgba(var(--accent-rgb), 0.5);
        box-shadow: 0 28px 52px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(var(--accent-rgb), 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.07);
    }

    .dashboard-card:hover::after {
        opacity: 1;
    }
}

.dashboard-card.active {
    border: 1px solid rgba(var(--accent-rgb), 0.45);
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.15), var(--shadow-md);
}

.card-content {
    padding: 32px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
}

.card-number {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(var(--accent-rgb), 0.55);
    margin-bottom: auto;
}

.card-description {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 6px;
    line-height: 1.4;
}

.swipe-hint {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.45;
    letter-spacing: 0.04em;
    margin-top: 20px;
    text-align: center;
    user-select: none;
}

.card-title {
    font-family: "Inter", sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    letter-spacing: -0.02em;
}


/* Responsive */
@media (max-width: 768px) {
    .dashboard-cards {
        flex-direction: column;
        align-items: center;
    }

    .dashboard-card {
        width: 100%;
        max-width: 100%;
        height: 500px;
    }

    .dashboard-cards.deck-shell {
        max-width: 100%;
        min-height: 500px;
    }

    .works-deck {
        max-width: 100%;
        min-height: 500px;
    }

    .works-deck .work-swipe-card {
        max-width: 100%;
        height: 500px;
    }

    .greeting-block {
        margin-bottom: 28px;
    }

    .greeting-label {
        font-size: 13px;
        font-weight: 500;
        color: var(--text-secondary);
        letter-spacing: 0.04em;
        text-transform: uppercase;
        margin: 0 0 4px 0;
        text-align: center;
    }

    .dashboard-greeting {
        font-size: 26px;
        margin-bottom: 0;
        word-break: break-word;
    }

    .main-content.dashboard-main {
        padding-top: 90px;
        justify-content: flex-start;
    }

    .card-content {
        justify-content: flex-end;
        align-items: flex-start;
        padding: 28px 24px;
    }

    .card-title {
        font-size: 22px;
    }

    .card-description {
        font-size: 13px;
        color: var(--text-secondary);
        margin-top: 6px;
        font-weight: 400;
        line-height: 1.4;
    }
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes underlineExpand {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.2s;
}

.delay-2 {
    transition-delay: 0.4s;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }

    .navbar {
        padding: 12px 18px;
        font-size: 15px;
        margin-bottom: 30px;
    }

    .main-content {
        padding: 20px 0;
    }

    .container {
        margin-bottom: 40px;
    }

    .btn {
        min-width: 180px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 10px 16px;
        font-size: 14px;
    }

    .main-title {
        font-size: 32px;
    }

    .subtxt {
        font-size: 16px;
    }

    .btn {
        min-width: 160px;
        font-size: 14px;
    }
}

.footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: auto;
    position: relative;
    z-index: 2;
}

/* Authentication Styles */
.auth-container {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 28px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(40px) saturate(200%) brightness(1.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

.auth-title {
    font-family: "Inter", sans-serif;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
    margin-top: 0;
    font-weight: 400;
    line-height: 1.5;
}

.auth-section {
    margin-bottom: 24px;
}

.auth-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--bg-dark);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-default);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: "Inter", sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-tab.active {
    background: var(--surface-elevated);
    color: var(--text-primary);
    box-shadow: none;
}

.auth-form {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.auth-form.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: slideInForm 0.4s ease-out;
}

@keyframes slideInForm {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.password-group {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.password-toggle:hover {
    opacity: 1;
}

.eye-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.eye-icon img {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

.password-toggle:hover .eye-icon img {
    transform: scale(1.1);
    opacity: 1;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: "Inter", sans-serif;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.password-group .form-input {
    padding-right: 50px;
}

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.form-input:focus {
    border-color: rgba(var(--accent-rgb), 0.55);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.auth-btn {
    position: relative;
    width: 200px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border: none;
    border-radius: 16px;
    font-family: "Inter", sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 auto 16px;
    overflow: hidden;
}


.primary-btn {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(24px) saturate(180%) brightness(1.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

.primary-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.primary-btn:active {
    transform: translateY(0);
}

.primary-btn .btn-arrow {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.primary-btn:hover .btn-arrow {
    transform: translateX(4px);
}


.auth-message {
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 16px;
    min-height: 20px;
    transition: all 0.3s ease;
}

.auth-message:empty {
    display: none;
}

.auth-message.loading {
    color: var(--primary-purple-light);
}

.auth-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.auth-message.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-container {
        padding: 32px 24px;
        margin: 20px;
    }

    .auth-title {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 24px 20px;
        margin: 16px;
    }

    .auth-title {
        font-size: 24px;
    }
}

/* Floating Back Button */
.floating-back-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-default);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 20px;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.floating-back-btn:hover {
    background: var(--surface-elevated);
    border-color: var(--border-strong);
    transform: none;
    box-shadow: var(--shadow-md);
}

.floating-back-btn:active {
    transform: translateY(-2px) scale(1);
}

.floating-back-btn span {
    display: block;
    transition: transform 0.3s ease;
}

.floating-back-btn:hover span {
    transform: translateX(-3px);
}

@media (max-width: 768px) {
    .floating-back-btn {
        bottom: max(42px, calc(24px + env(safe-area-inset-bottom, 0px)));
        right: max(20px, env(safe-area-inset-right, 0px));
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

/* Admin Panel Styles */
.admin-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    justify-content: center;
}

.stat-card {
    background: var(--surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 24px 32px;
    text-align: center;
    min-width: 150px;
    box-shadow: var(--shadow-sm);
}

.stat-number {
    display: block;
    font-family: "Inter", sans-serif;
    font-size: 32px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.stat-label {
    display: block;
    font-family: "Inter", sans-serif;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.users-table-container {
    margin-top: 30px;
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    overflow: hidden;
}

.users-table thead {
    background: var(--bg-dark);
}

.users-table th {
    padding: 16px;
    text-align: left;
    font-family: "Inter", sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table td {
    padding: 16px;
    font-family: "Inter", sans-serif;
    font-size: 14px;
    color: var(--text-secondary);
    border-top: 1px solid rgba(var(--accent-secondary-rgb), 0.1);
}

.users-table tbody tr:hover {
    background: rgba(var(--accent-rgb), 0.1);
}

.uid-cell {
    font-family: monospace;
    font-size: 12px;
    color: var(--text-secondary);
    word-break: break-all;
}

.loading-text,
.no-users,
.error-text {
    text-align: center;
    padding: 40px !important;
    color: var(--text-secondary);
    font-style: italic;
}

.error-text {
    color: #fca5a5;
}

/* Course Layout Styles */
.course-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    max-width: 100%;
    margin: 0;
    margin-top: 100px;
    margin-bottom: 20px;
}

.course-layout {
    display: flex;
    gap: 20px;
    width: 100%;
    padding: 0 20px;
    align-items: flex-start;
}

/* Left sidebar — liquid glass panel */
.course-sidebar {
    width: 280px;
    min-width: 280px;
    background: rgba(12, 12, 14, 0.38);
    backdrop-filter: blur(36px) saturate(200%) brightness(1.08);
    -webkit-backdrop-filter: blur(36px) saturate(200%) brightness(1.08);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 100px;
    align-self: flex-start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.11),
        inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}

.sidebar-title {
    font-family: "Inter", sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: lowercase;
    margin-bottom: 24px;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-item {
    font-family: "Inter", sans-serif;
    font-size: 16px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-transform: lowercase;
}

.sidebar-item:hover {
    background: rgba(var(--accent-rgb), 0.2);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--text-primary);
    border: 1px solid rgba(var(--accent-rgb), 0.25);
}

.sidebar-item.completed {
    opacity: 0.5;
    position: relative;
}

.sidebar-item.completed::after {
    content: "✓";
    position: absolute;
    right: 16px;
    color: rgba(34, 197, 94, 0.8);
    font-weight: bold;
}

/* Main lesson content panel */
.course-content {
    flex: 1;
    background: var(--surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 24px 32px;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 830px;
}

.content-inner {
    width: 100%;
    max-width: 100%;
    text-align: left;
}

.content-title {
    font-family: "Inter", sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    text-transform: none;
    text-align: left;
}

.content-body {
    color: var(--text-secondary);
    font-family: "Inter", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    text-align: left;
    width: 100%;
    max-width: 100%;
}

/* Lesson Content Styles */
.lesson-content {
    padding: 0;
}

.lesson-section {
    margin-bottom: 40px;
}

.section-title {
    font-family: "Inter", sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-transform: none;
}

.lesson-section p {
    margin-bottom: 16px;
    line-height: 1.8;
}

/* Crypto Examples */
.crypto-examples {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.crypto-item {
    background: var(--bg-dark);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 20px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.crypto-item:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
    transform: none;
}

.crypto-name {
    font-family: "Inter", sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.crypto-item p {
    margin: 0;
    color: var(--text-secondary);
}

/* Info Box */
.info-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-default);
    border-left: 3px solid rgba(var(--accent-rgb), 0.55);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.info-title {
    font-family: "Inter", sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: var(--text-secondary);
}

.feature-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: rgba(var(--accent-secondary-rgb), 0.8);
    font-weight: bold;
}

/* Feature Cards */
.feature-card {
    background: var(--bg-dark);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
}

.feature-title {
    font-family: "Inter", sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.feature-card p {
    margin-bottom: 12px;
}

/* Example Box */
.example-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    border-left: 3px solid rgba(var(--accent-rgb), 0.45);
}

.example-box strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 8px;
}

.example-box p {
    margin-bottom: 8px;
    font-size: 14px;
}

.example-box p:last-child {
    margin-bottom: 0;
}

/* Next Lesson Button */
.next-lesson-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent);
    border: 1px solid var(--accent-dark);
    border-radius: 8px;
    color: #ffffff;
    font-family: "Inter", sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    margin-top: 40px;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.next-lesson-btn:hover {
    background: var(--accent-light);
    box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.3);
    transform: none;
}

.next-lesson-btn:active {
    transform: translateY(0);
}

/* Platform Links */
.platform-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 20px;
    background: var(--bg-dark);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.platform-link:hover {
    background: var(--bg-dark);
    border-color: rgba(var(--accent-rgb), 0.35);
    transform: none;
    box-shadow: var(--shadow-md);
}

.platform-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    transition: all 0.3s ease;
}

.platform-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.platform-link:hover .platform-icon {
    color: var(--accent-light);
    transform: none;
}

.platform-name {
    font-size: 16px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.platform-link:hover .platform-name {
    color: var(--accent-light);
}

/* Hamburger Menu Button */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
    position: relative;
    opacity: 0.75;
}

.hamburger-btn span {
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Sidebar Overlay for Mobile - Removed to prevent blocking */

/* Responsive */
@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }

    .course-main {
        margin-top: 72px;
        margin-bottom: 20px;
    }

    .course-layout {
        flex-direction: column;
        gap: 20px;
        padding: 0 20px;
    }

    .course-sidebar {
        position: fixed;
        top: 100px;
        right: -100%;
        left: auto;
        width: 280px;
        min-width: 280px;
        max-height: calc(100vh - 120px);
        border-radius: 12px;
        z-index: 100;
        transition: right 0.3s ease;
        overflow-y: auto;
        box-shadow:
            -8px 0 40px rgba(0, 0, 0, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.11),
            inset 0 -1px 0 rgba(0, 0, 0, 0.18);
    }

    .course-sidebar.sidebar-open {
        right: 20px;
    }
    
    /* Make content always interactive */
    .course-content {
        position: relative;
        z-index: 1;
        pointer-events: auto;
    }

    /* Strip card chrome — plain reading surface on mobile */
    .course-content {
        width: 100%;
        min-height: auto;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
        backdrop-filter: none;
        padding: 4px 0;
    }

    .content-title {
        font-size: 19px;
        margin-bottom: 18px;
        line-height: 1.4;
    }

    .content-body {
        font-size: 15px;
        line-height: 1.75;
    }

    .section-title {
        font-size: 17px;
        margin-bottom: 10px;
    }

    .lesson-section {
        margin-bottom: 28px;
    }

    .lesson-section p {
        margin-bottom: 12px;
        line-height: 1.75;
    }

    .feature-card {
        padding: 16px;
        margin-bottom: 14px;
    }

    .feature-title {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .info-box {
        padding: 14px 16px;
        margin: 14px 0;
    }

    .info-title {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .crypto-item {
        padding: 14px 16px;
    }

    .crypto-name {
        font-size: 15px;
        margin-bottom: 6px;
    }

    .example-box {
        padding: 12px 14px;
        margin-top: 12px;
    }

    .example-box p {
        font-size: 13px;
    }

    /* Dim the background grid so text is the only focus */
    .page-course .background-pattern {
        opacity: 0.15;
    }
}

/* AI Assistant Styles */
.page-ai {
    padding: 0 20px 20px;
}

.page-ai .ai-container {
    margin-top: 102px;
}

.cpotato-signature {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 85;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    color: rgba(250, 250, 250, 0.5);
    font-family: "Inter", sans-serif;
    pointer-events: none;
    user-select: none;
}

.ai-main-wrapper {
    position: relative;
    z-index: 2;
    padding: 24px 20px 12px;
    margin-top: 72px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ai-main-wrapper h1 {
    font-family: "Inter", sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin: 0;
}

.ai-container {
    height: 85vh;
    margin: auto;
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.025) 55%, rgba(255, 255, 255, 0.015) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 24px 24px 18px;
    max-height: calc(100vh - 240px);
    overflow: hidden;
    backdrop-filter: blur(20px) saturate(130%);
    -webkit-backdrop-filter: blur(20px) saturate(130%);
    box-shadow:
        0 16px 44px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.22);
}

.ai-header {
    text-align: left;
    margin-bottom: 12px;
}

.ai-subtitle {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.45;
}

.ai-title {
    font-family: "Inter", sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.03em;
}




@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-message-content {
    border: 1px solid rgba(255, 255, 255, 0.09);
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.025);
    border-radius: 9px;
    line-height: 1.5;
    word-wrap: break-word;
    margin-bottom: 8px;
}

.ai-message-content ul {
    margin: 0;
    padding-left: 18px;
}

.ai-message-content li {
    margin: 0 0 3px 0;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.92);
}

.ai-message-content li:last-child {
    margin-bottom: 0;
}



#chat-form {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 0;
    margin-bottom: 6px;
    flex-shrink: 0;
}

#chat-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 8px;
    border-radius: 16px;
    transition: all 0.3s ease;

    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

#chat-container::-webkit-scrollbar {
    width: 8px;
}

#chat-container::-webkit-scrollbar-track {
    background: rgba(var(--accent-rgb), 0.08);
    border-radius: 999px;
}

#chat-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
}

#chat-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}

.ai-chat-input {
    flex: 1;
    padding: 12px 14px;
    background: rgba(5, 5, 6, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    min-height: 46px;
    font-family: "Inter", sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ai-chat-input:focus {
    outline: none;
    border-color: rgba(var(--accent-rgb), 0.5);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.ai-chat-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ai-send-btn {
    padding: 12px 16px;
    background: var(--accent);
    border: 1px solid var(--accent-dark);
    border-radius: 10px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    font-family: "Inter", sans-serif;
    min-height: 46px;
}

.ai-send-btn:hover:not(:disabled) {
    transform: none;
    background: var(--accent-light);
    box-shadow: 0 2px 12px rgba(var(--accent-rgb), 0.35);
}

.ai-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ai-confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.ai-confirm-content {
    background: var(--surface-elevated);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: 28px;
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow-md);
}

.ai-confirm-content h3 {
    font-family: "Inter", sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: -0.02em;
}

.ai-confirm-details {
    background: var(--bg-dark);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    color: var(--text-primary);
    line-height: 1.8;
}

.ai-confirm-details p {
    margin: 8px 0;
}

.ai-confirm-details strong {
    color: var(--primary-purple-light);
}

.ai-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.ai-confirm-btn,
.ai-cancel-btn {
    padding: 12px 32px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    border: 1px solid;
}

.ai-confirm-btn {
    background: var(--accent);
    border-color: var(--accent-dark);
    color: #ffffff;
}

.ai-confirm-btn:hover:not(:disabled) {
    transform: none;
    background: var(--accent-light);
    box-shadow: 0 2px 12px rgba(var(--accent-rgb), 0.35);
}

.ai-confirm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ai-cancel-btn {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text-secondary);
}

.ai-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .page-course::after {
        content: "";
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: 88px;
        pointer-events: none;
        z-index: 80;
        background: linear-gradient(180deg, rgba(9, 9, 11, 0) 0%, rgba(9, 9, 11, 0.92) 62%, rgba(9, 9, 11, 1) 100%);
    }

    .page-ai {
        padding: 0 10px 10px;
    }

    .page-ai .navbar {
        left: 10px;
        right: 10px;
        top: 10px;
    }

    .ai-container {
        width: 100%;
        max-width: none;
        margin: 0;
        margin-top: 52px;
        height: calc(100vh - 146px);
        max-height: calc(100vh - 154px);
        padding: 9px 9px 8px;
        border-radius: 10px;
    }

    .ai-title {
        font-size: 2rem;
    }

    .ai-examples {
        grid-template-columns: 1fr;
    }

    #chat-container {
        max-height: none;
        padding-bottom: 16px;
        margin-bottom: 6px;
    }

    .ai-message-content {
        max-width: 100%;
        width: 100%;
        padding: 8px 9px;
        border-radius: 8px;
        font-size: 12.5px;
        line-height: 1.4;
    }

    .message {
        max-width: 96%;
        padding: 7px 9px;
        border-radius: 12px;
        line-height: 1.3;
    }

    #chat-form {
        gap: 7px;
        margin-top: 8px;
        margin-bottom: 48px;
        position: relative;
        z-index: 120;
    }

    .ai-chat-input {
        margin-bottom: -50px;
        min-width: 0;
        font-size: 13px;
        min-height: 44px;
    }

    .ai-send-btn {
        margin-bottom: -50px;
        min-width: 66px;
        font-size: 13px;
        min-height: 44px;
    }

    .page-ai .floating-back-btn {
        bottom: max(36px, calc(14px + env(safe-area-inset-bottom, 0px)));
        right: max(14px, env(safe-area-inset-right, 0px));
        width: 46px;
        height: 46px;
        font-size: 18px;
        z-index: 110;
    }
}
/* --- Chat bubble UI --- */
.message {
    display: flex;
    padding: 8px 12px;
    border-radius: 14px;
    max-width: 85%;
    white-space: pre-wrap; /* keeps line breaks from the bot */
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.25;
}

.message.user {
    width: fit-content;
    align-self: flex-end;
    justify-content: flex-end;
    background: rgba(var(--accent-rgb), 0.18);
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.message.bot {
    width: fit-content;
    align-self: flex-start;
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
}

.message.typing {
    opacity: 0.95;
}

.typing-dots {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    min-height: 1em;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: inline-block;
    animation: aiDotBounce 1s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

.message.bot:not(.typewriter-done)::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 4px;
    vertical-align: -0.15em;
    background: rgba(255, 255, 255, 0.8);
    animation: aiCaretBlink 0.8s steps(1, end) infinite;
}

.message.typewriter-done::after {
    content: none;
}

.message.bot.price-quote-widget {
    display: flex;
    flex-direction: column;
    width: fit-content;
    padding: 16px 16px 14px;
    color: var(--text-primary);
    box-shadow: none;
    white-space: normal;
}

.price-widget-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.price-widget-image {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-default);
}

.price-widget-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.price-asset {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.price-symbol {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
}

.price-main-row {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-start;
    gap: 10px;
}

.price-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.price-change {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.9);
}

.price-up {
    color: #4ade80;
}

.price-down {
    color: #f87171;
}

.price-flat {
    color: var(--text-accent-muted);
}

.message.bot.token-info-widget {
    display: flex;
    flex-direction: column;
    width: min(440px, 100%);
    max-width: 100%;
    padding: 14px;
    white-space: normal;
    gap: 10px;
}

.message.bot.launchpad-volume-widget {
    display: flex;
    flex-direction: column;
    width: min(560px, 100%);
    max-width: 100%;
    padding: 12px;
    gap: 10px;
    white-space: normal;
}

.message.bot.hot-tokens-widget {
    display: flex;
    flex-direction: column;
    width: min(620px, 100%);
    max-width: 100%;
    padding: 12px;
    gap: 10px;
    white-space: normal;
}

.message.bot.wallet-analysis-widget {
    display: flex;
    flex-direction: column;
    width: min(560px, 100%);
    max-width: 100%;
    padding: 12px;
    gap: 10px;
    white-space: normal;
}

.wallet-analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.wallet-analysis-grid > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.wallet-analysis-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.wallet-stack-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.wallet-subvalue {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.wallet-balance-block {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 4px 2px 0;
}

.wallet-balance-usd {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.05;
}

.wallet-balance-sol {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.wallet-net-block {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 2px 2px 0;
}

.wallet-net-usd {
    font-size: 1.06rem;
    font-weight: 700;
    line-height: 1.05;
}

.wallet-net-sol {
    font-size: 0.8rem;
    font-weight: 600;
}

.wallet-net-up .wallet-net-usd,
.wallet-net-up .wallet-net-sol {
    color: #4ade80;
}

.wallet-net-down .wallet-net-usd,
.wallet-net-down .wallet-net-sol {
    color: #f87171;
}

.wallet-trades-title {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.wallet-analysis-error {
    font-size: 0.8rem;
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.35);
    background: rgba(127, 29, 29, 0.22);
    border-radius: 8px;
    padding: 7px 8px;
}

.wallet-trades-table {
    border: 1px solid var(--border-default);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.wallet-trades-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(82px, 0.9fr) minmax(82px, 0.9fr) minmax(92px, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    font-size: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.wallet-trades-row:first-child {
    border-top: 0;
}

.wallet-trades-head {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wallet-trade-token {
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wallet-trade-value,
.wallet-trade-pnl {
    justify-self: end;
    font-variant-numeric: tabular-nums;
}

.wallet-trade-value {
    color: var(--text-primary);
}

.wallet-trade-pnl {
    font-weight: 700;
}

.wallet-pnl-up {
    color: #34d399;
}

.wallet-pnl-down {
    color: #f87171;
}

.wallet-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    margin-top: 4px;
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--text-primary);
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.wallet-more-btn:hover:not(:disabled) {
    background: rgba(var(--accent-rgb), 0.22);
    border-color: rgba(var(--accent-rgb), 0.55);
}

.wallet-more-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.wallet-more-arrow {
    transition: transform 160ms ease;
}

.wallet-more-btn:hover:not(:disabled) .wallet-more-arrow {
    transform: translateX(2px);
}

.wallet-more-slot {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wallet-more-slot:empty {
    display: none;
}

.wallet-deep-card {
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wallet-deep-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.wallet-deep-sub {
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.wallet-deep-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}

.wallet-deep-empty {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.wallet-deep-big {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--text-primary);
}

.wallet-deep-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-primary);
}

.wallet-deep-key {
    color: var(--text-secondary);
}

.wallet-deep-val {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.freq-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 4px;
}

.hour-bar-chart {
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    gap: 3px;
    align-items: end;
    height: 72px;
    padding: 4px 2px 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hour-bar-col {
    position: relative;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.hour-bar-fill {
    width: 100%;
    min-height: 2px;
    background: rgba(var(--accent-rgb), 0.55);
    border-radius: 2px 2px 0 0;
    transition: background 120ms ease, transform 120ms ease;
}

.hour-bar-col:hover .hour-bar-fill {
    background: rgba(var(--accent-rgb), 0.85);
}

.hour-bar-peak {
    background: rgba(var(--accent-rgb), 0.95) !important;
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.35);
}

.hour-bar-axis {
    display: flex;
    justify-content: space-between;
    padding: 2px 2px 0;
    font-size: 0.64rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.day-row-chart {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.day-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 28px;
    gap: 8px;
    align-items: center;
    font-size: 0.74rem;
}

.day-row-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.day-row-track {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    overflow: hidden;
}

.day-row-fill {
    height: 100%;
    background: rgba(var(--accent-rgb), 0.55);
    border-radius: 999px;
    transition: width 240ms ease;
}

.day-row-peak {
    background: rgba(var(--accent-rgb), 0.95);
}

.day-row-count {
    text-align: right;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.side-wallet-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.side-wallet-row:first-of-type {
    border-top: 0;
    padding-top: 2px;
}

.side-wallet-addr {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8rem;
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 600;
}

.side-wallet-addr:hover {
    text-decoration: underline;
}

.side-wallet-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.side-wallet-tag {
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(var(--accent-rgb), 0.14);
    color: var(--text-primary);
    border: 1px solid rgba(var(--accent-rgb), 0.25);
}

.launchpad-widget-title {
    font-size: 0.98rem;
    font-weight: 700;
}

.launchpad-widget-subtitle {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.launchpad-daily {
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 8px 9px;
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.79rem;
    line-height: 1.45;
}

.launchpad-daily-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.launchpad-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.launchpad-item {
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 9px;
    background: rgba(255, 255, 255, 0.02);
}

.launchpad-item-head {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.launchpad-rank {
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.launchpad-name {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: capitalize;
}

.launchpad-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 8px;
    font-size: 0.78rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.launchpad-load-btn {
    border: 1px solid rgba(var(--accent-rgb), 0.45);
    background: rgba(var(--accent-rgb), 0.12);
    color: #ffffff;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
}

.launchpad-load-btn:disabled {
    opacity: 0.75;
    cursor: default;
}

.launchpad-tokens {
    margin-top: 8px;
}

.launchpad-token-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.launchpad-token-list li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.78rem;
}

.launchpad-token-cards {
    gap: 8px;
    padding-left: 0;
    list-style: none;
}

.launchpad-token-card {
    border: 1px solid var(--border-default);
    border-radius: 9px;
    padding: 7px 8px;
    background: rgba(255, 255, 255, 0.02);
}

.launchpad-token-card-head {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.launchpad-token-rank {
    min-width: 20px;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.launchpad-token-main {
    display: flex;
    gap: 8px;
    align-items: center;
}

.launchpad-token-icon,
.launchpad-token-icon-fallback {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border-default);
    flex-shrink: 0;
}

.launchpad-token-icon {
    object-fit: cover;
}

.launchpad-token-icon-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    background: rgba(var(--accent-rgb), 0.24);
}

.launchpad-token-name-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.launchpad-token-name {
    font-weight: 600;
}

.launchpad-token-meta {
    color: var(--text-secondary);
}

.launchpad-token-list a {
    width: fit-content;
    color: var(--accent-light);
    text-decoration: none;
    font-size: 0.73rem;
    margin-top: 4px;
}

.launchpad-no-tokens {
    font-size: 0.77rem;
    color: var(--text-secondary);
}

.token-widget-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.token-widget-image {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-default);
}

.token-widget-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.token-widget-name {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.1;
}

.token-widget-symbol {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.token-widget-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.token-widget-grid > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.token-key {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}

.token-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
}

.token-widget-address {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-accent-muted);
    overflow-wrap: anywhere;
}

.token-widget-lore {
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--text-primary);
}

.token-widget-lore.is-empty {
    display: none;
}

.token-generate-lore-btn {
    align-self: flex-start;
    border: 1px solid rgba(var(--accent-rgb), 0.45);
    background: rgba(var(--accent-rgb), 0.12);
    color: #ffffff;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.76rem;
    font-weight: 600;
    font-family: "Inter", sans-serif;
    cursor: pointer;
}

.token-generate-lore-btn:hover:not(:disabled) {
    background: rgba(var(--accent-rgb), 0.2);
}

.token-generate-lore-btn:disabled {
    opacity: 0.75;
    cursor: default;
}

.token-widget-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.token-widget-links a {
    font-size: 0.78rem;
    text-decoration: none;
    color: var(--accent-light);
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    padding: 4px 8px;
    border-radius: 999px;
}

.token-widget-links a:hover {
    color: #ffffff;
    border-color: rgba(var(--accent-rgb), 0.55);
    background: rgba(var(--accent-rgb), 0.15);
}

/* ── Trade link (green accent) ───────────────────────────── */
.token-trade-link {
    color: #4ade80 !important;
    border-color: rgba(74, 222, 128, 0.35) !important;
    font-weight: 600;
}
.token-trade-link:hover {
    color: #ffffff !important;
    border-color: rgba(74, 222, 128, 0.6) !important;
    background: rgba(74, 222, 128, 0.15) !important;
}

/* ── Token widget action row ─────────────────────────────── */
.token-widget-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.token-bubble-map-btn {
    align-self: flex-start;
    border: 1px solid rgba(168, 85, 247, 0.5);
    background: rgba(168, 85, 247, 0.12);
    color: #c084fc;
    font-size: 0.78rem;
    padding: 5px 11px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.token-bubble-map-btn:hover {
    background: rgba(168, 85, 247, 0.24);
    color: #e9d5ff;
    border-color: rgba(168, 85, 247, 0.75);
}

/* ── Bubble map modal ────────────────────────────────────── */
.bubble-map-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(4px);
}
.bubble-map-modal-overlay.is-open {
    opacity: 1;
}

.bubble-map-modal-box {
    background: #0f0f17;
    border: 1px solid rgba(var(--accent-rgb), 0.25);
    border-radius: 14px;
    width: min(860px, 100%);
    height: min(620px, 90vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    transform: scale(0.97);
    transition: transform 0.2s ease;
}
.bubble-map-modal-overlay.is-open .bubble-map-modal-box {
    transform: scale(1);
}

.bubble-map-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.15);
    flex-shrink: 0;
}

.bubble-map-modal-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent-light);
}

.bubble-map-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}
.bubble-map-modal-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.bubble-map-modal-body {
    flex: 1;
    overflow: hidden;
}

.bubble-map-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

@media (max-width: 768px) {
    .bubble-map-modal-box {
        height: 90vh;
        border-radius: 10px;
    }
}

@media (max-width: 768px) {
    .message.bot.price-quote-widget {
        min-width: 0;
        max-width: 100%;
        width: fit-content;
        padding: 14px;
        border-radius: 12px;
    }

    .price-asset {
        font-size: 1.05rem;
    }

    .price-symbol {
        font-size: 0.74rem;
    }

    .price-value {
        font-size: 1.7rem;
    }

    .price-change {
        font-size: 0.82rem;
    }

    .message.bot.token-info-widget {
        width: 100%;
        max-width: 100%;
        padding: 10px;
        gap: 8px;
        border-radius: 10px;
    }

    .token-widget-header {
        gap: 8px;
    }

    .token-widget-image {
        width: 34px;
        height: 34px;
    }

    .token-widget-name {
        font-size: 0.95rem;
    }

    .token-widget-symbol {
        font-size: 0.74rem;
    }

    .token-widget-grid > div {
        padding: 7px;
        border-radius: 7px;
    }

    .token-key {
        font-size: 0.66rem;
    }

    .token-value {
        font-size: 0.84rem;
    }

    .token-widget-address {
        font-size: 0.68rem;
    }

    .token-generate-lore-btn {
        padding: 5px 9px;
        font-size: 0.72rem;
    }

    .token-widget-links {
        gap: 6px;
    }

    .token-widget-links a {
        font-size: 0.72rem;
        padding: 3px 7px;
    }

    .token-widget-grid {
        grid-template-columns: 1fr;
    }

    .message.bot.launchpad-volume-widget {
        width: 100%;
        padding: 10px;
        border-radius: 10px;
    }

    .message.bot.hot-tokens-widget {
        width: 100%;
        padding: 10px;
        border-radius: 10px;
    }

    .message.bot.wallet-analysis-widget {
        width: 100%;
        padding: 10px;
        border-radius: 10px;
    }

    .wallet-trades-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wallet-trades-row {
        min-width: 440px;
    }

    .wallet-trades-head span {
        white-space: nowrap;
    }

    .hour-bar-chart {
        height: 60px;
        gap: 2px;
    }

    .hour-bar-axis {
        font-size: 0.6rem;
    }

    .day-row {
        grid-template-columns: 32px minmax(0, 1fr) 24px;
        font-size: 0.7rem;
    }

    .wallet-deep-big {
        font-size: 1.32rem;
    }

    .wallet-more-btn {
        font-size: 0.82rem;
    }

    .wallet-analysis-grid {
        grid-template-columns: 1fr;
    }

    .wallet-analysis-stack {
        grid-template-columns: 1fr;
    }

    .launchpad-stats {
        grid-template-columns: 1fr;
    }
}


@keyframes aiDotBounce {
    0%, 80%, 100% {
        transform: scale(0.7);
        opacity: 0.45;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes aiCaretBlink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

#chat-form input:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Demo trading board */
.page-demo-trading {
    padding: 0 10px 10px;
    min-height: 100vh;
    overflow: hidden;
}

.page-demo-trading .navbar {
    left: 12px;
    right: 12px;
    top: 10px;
    min-height: 44px;
    padding: 10px 14px;
}

.demo-board-main {
    margin-top: 86px;
    position: relative;
    z-index: 2;
    height: calc(100vh - 104px);
}

.demo-mobile-tabs {
    display: none;
}

.demo-board-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    height: 100%;
}

.demo-board-column {
    border: 1px solid var(--border-default);
    border-radius: 10px;
    background: rgba(8, 8, 10, 0.55);
    padding: 10px;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.demo-board-title {
    font-size: 1.05rem;
    line-height: 1.2;
    font-weight: 700;
    margin: 2px 2px 8px;
    text-transform: lowercase;
}

.demo-token-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    min-height: 0;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--accent-rgb), 0.55) rgba(255, 255, 255, 0.06);
}

.demo-token-list::-webkit-scrollbar {
    width: 8px;
}

.demo-token-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
}

.demo-token-list::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-rgb), 0.55);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-token-list::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--accent-rgb), 0.75);
}

.demo-token-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 9px 8px;
    background: rgba(255, 255, 255, 0.02);
}

.demo-token-icon {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    background: #ccb3ff;
    border: 1px solid rgba(255, 255, 255, 0.16);
    display: inline-block;
}

.demo-token-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.demo-token-meta strong {
    font-size: 1.06rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.demo-token-ticker {
    color: #ffffff;
    font-weight: 800;
}

.demo-token-name {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}

.demo-token-copy {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.28);
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.76rem;
    border-radius: 6px;
    width: fit-content;
    padding: 1px 6px;
    cursor: pointer;
}

.demo-token-copy:hover {
    color: #fff;
    border-color: rgba(var(--accent-rgb), 0.65);
}

.demo-token-meta span {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.demo-token-age {
    color: rgba(255, 255, 255, 0.72);
}

.demo-token-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.demo-token-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #fff;
    background: rgba(var(--accent-rgb), 0.22);
    border: 1px solid rgba(var(--accent-rgb), 0.52);
    text-decoration: none;
}

.demo-token-tag:hover {
    background: rgba(var(--accent-rgb), 0.32);
}

.demo-token-cap {
    font-size: 0.94rem;
    color: var(--text-primary);
    font-weight: 700;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.demo-cap-mc,
.demo-cap-vol {
    display: block;
    line-height: 1;
}

.demo-token-buy {
    border: 1px solid rgba(var(--accent-rgb), 0.45);
    background: rgba(var(--accent-rgb), 0.16);
    color: #fff;
    border-radius: 7px;
    padding: 10px 16px;
    font-size: 1.02rem;
    font-weight: 700;
    font-family: "Inter", sans-serif;
    line-height: 1;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.page-demo-trading .floating-back-btn {
    z-index: 120;
}

@media (max-width: 900px) {
    .page-demo-trading {
        overflow: auto;
    }

    .demo-board-main {
        height: auto;
        min-height: calc(100vh - 88px);
    }

    .demo-mobile-tabs {
        display: flex;
        gap: 10px;
        margin: 0 2px 10px;
    }

    .demo-tab-btn {
        background: transparent;
        border: none;
        color: var(--text-secondary);
        font-size: 1.55rem;
        line-height: 1;
        font-weight: 700;
        text-transform: lowercase;
        font-family: "Inter", sans-serif;
        cursor: pointer;
        padding: 0;
    }

    .demo-tab-btn.is-active {
        color: var(--text-primary);
    }

    .demo-board-columns {
        grid-template-columns: 1fr;
        height: auto;
    }

    .demo-board-column {
        display: none;
        height: auto;
        min-height: 0;
    }

    .demo-board-column.is-active {
        display: flex;
    }

    .demo-board-title {
        display: none;
    }

    .demo-token-list {
        overflow: visible;
    }

    .demo-token-row {
        grid-template-columns: 58px minmax(0, 1fr) auto;
        grid-template-areas:
            "icon meta cap"
            "icon meta buy";
        gap: 10px;
        padding: 10px 8px;
        align-items: start;
    }

    .demo-token-icon {
        width: 75px;
        height: 75px;
        border-radius: 8px;
        grid-area: icon;
    }

    .demo-token-meta strong {
        font-size: 1.04rem;
        line-height: 1.05;
        white-space: normal;

    }

    .demo-token-meta {
     margin-left: 12px;
        grid-area: meta;
    }

    .demo-token-meta span {
        font-size: 0.9rem;
    }

    .demo-token-cap {
        grid-area: cap;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 3px;
        font-size: 0.82rem;
    }

    .demo-token-buy {
        grid-area: buy;
        justify-self: end;
        align-self: end;
        margin-top: 0;
        margin-bottom: -2px;
        padding: 12px 22px;
        font-size: 1.08rem;
        min-width: 126px;
        border-radius: 9px;
    }
}
