/* Global Smoothness */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Optimized Scrollbar (Monochrome) */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 99px;
    transition: background 0.2s ease;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* App Layout Fixes */
html, body {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    background-color: #121212;
    color: #ffffff;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}

/* Glass/Dark Panel */
.dark-panel {
    background: linear-gradient(135deg, #1E1E1E 0%, #181818 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Interactive Elements Transition */
button, a, .group, label {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Range Slider (Monochrome) */
input[type=range] {
    -webkit-appearance: none;
    background: transparent;
    height: 24px;
    cursor: pointer;
}
input[type=range]:focus {
    outline: none;
}
/* Track */
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #333;
    border-radius: 99px;
    transition: background 0.2s;
}
/* Thumb */
input[type=range]::-webkit-slider-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #ffffff; /* White thumb */
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -7px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
input[type=range]:active::-webkit-slider-thumb {
    transform: scale(1.3);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
}
input[type=range]:hover::-webkit-slider-runnable-track {
    background: #555;
}

/* Animations */
@keyframes slideInUp {
    from { opacity: 0; transform: translateY(15px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.item-enter {
    animation: slideInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.pb-safe { padding-bottom: env(safe-area-inset-bottom, 20px); }

/* ==========================================================================
   Spac2 Brand Header Components
   ========================================================================== */
.btn-back {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    flex-shrink: 0;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transform: translateX(-2px);
    border-color: rgba(255, 255, 255, 0.45);
}

.btn-back:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.55);
    opacity: 0.85;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.15s ease;
}

.brand-link:hover {
    opacity: 0.92;
}

.brand-logo-card {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    padding: 3.5px;
    box-sizing: border-box;
    transition: transform 0.2s ease;
}

.brand-link:hover .brand-logo-card {
    transform: scale(1.04);
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}

.brand-text {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    line-height: 1;
    white-space: nowrap;
}

.brand-name {
    font-weight: 800;
    font-size: 19px;
    color: #ffffff;
    letter-spacing: -0.025em;
    line-height: 1;
}

.brand-divider {
    font-size: 14px;
    font-weight: 300;
    color: #9ca3af;
    opacity: 0.7;
    user-select: none;
}

.brand-app {
    font-size: 14px;
    font-weight: 600;
    color: #e5e7eb;
    letter-spacing: -0.01em;
    line-height: 1;
}

@media (max-width: 640px) {
    .btn-back {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }
    .brand-logo-card {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        padding: 3px;
    }
    .brand-name {
        font-size: 17px;
    }
    .brand-app {
        font-size: 13px;
    }
}