/**
 * Cool Hub - TMA Design System
 * Based on Telegram Mini Apps UI Kit standards
 */

/* TON Connect UI modal must render above all app elements */
tc-root, [data-tc-wallets-modal-container="true"], [data-tc-actions-modal-container="true"] {
    z-index: 99999 !important;
    position: relative;
}
tc-root .go2072408551, tc-root [class*="modal"] {
    z-index: 99999 !important;
}

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

/* Body */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    font-size: var(--font-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Shared wallet action for every page header */
.header-wallet-btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 13px;
    background: var(--color-accent);
    border: none;
    border-radius: var(--radius-pill);
    color: var(--color-accent-text);
    font-size: var(--font-subhead, 15px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-wallet-btn__icon {
    width: 22px;
    height: 18px;
    flex: none;
    background: currentColor;
    -webkit-mask: url('/static/assets/telegram-wallet.svg') center / contain no-repeat;
    mask: url('/static/assets/telegram-wallet.svg') center / contain no-repeat;
}

.header-wallet-btn:active {
    transform: scale(0.97);
}

.header-wallet-btn.connected {
    background: var(--color-section-bg);
    color: var(--color-text);
}

.header-wallet-btn.connecting {
    opacity: 0.7;
    cursor: wait;
}

.header-wallet-btn[hidden] {
    display: none;
}

#socoolMintBtn[data-mode="mint"] .header-wallet-btn__icon {
    display: none;
}

/* Page System */
.page {
    display: none !important;
    min-height: 100vh;
    animation: pageSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.page.active {
    display: block !important;
}

@keyframes pageSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Page Header */
.page-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: var(--spacing-3) var(--spacing-4);
    border-bottom: 1px solid var(--color-section-bg);
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-3);
}

.page-title {
    font-size: var(--font-xl);
    font-weight: 600;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    color: var(--color-text);
}

.page-title svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    color: #ffffff;
}

.page-title .telegram-glyph {
    width: 20px;
    height: 20px;
    color: #ffffff;
}

.page-header .header-wallet-btn__icon { background: #ffffff; }

/* Page Content */
.page-content {
    padding: var(--spacing-3);
    padding-bottom: 100px;
}

.cool-pools-page,
.socool-page,
.kito-trade-page {
    padding: 0;
    padding-bottom: 108px;
}

#coolPoolsHost,
#socoolHost,
#kitoTradeRoot {
    display: block;
    min-height: 0;
}
#kitoTradeRoot {
    min-height: 70vh;
}

html.is-chart-resizing,
html.is-chart-resizing body {
    cursor: ns-resize !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* Leaderboard */
.lb-switch {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 2px;
    margin: 0 0 16px;
    padding: 3px;
    border-radius: 999px;
    background: var(--color-section-bg);
}
.lb-switch button {
    min-height: 32px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--color-hint);
    font-size: var(--font-footnote, 13px);
    font-weight: 590;
    line-height: 18px;
    letter-spacing: -0.08px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.lb-switch button.on {
    background: color-mix(in srgb, var(--color-text) 10%, var(--color-section-bg));
    color: var(--color-text);
    font-weight: 600;
}
.lb-switch--chart {
    margin: 8px 12px 10px;
}
.lb-switch--chart button {
    min-height: 28px;
    padding: 0 2px;
    font-variant-numeric: tabular-nums;
}
.lb-pane[hidden] {
    display: none;
}

#leaderboardBoardPane {
    width: 100vw;
    margin-inline: calc(50% - 50vw);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    border-radius: 0;
    background: var(--color-section-bg);
    margin-bottom: 8px;
}

.leaderboard-rest {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.leaderboard-podium {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: transparent;
}

.leader-medal {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    line-height: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.leader-rank-column {
    flex: 0 0 22px;
    width: 22px;
    color: var(--color-hint);
    font-size: var(--font-base);
    font-weight: 750;
    line-height: 1;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.leader-medal lottie-player {
    display: block;
    width: 100%;
    height: 100%;
}

.leader-podium-avatar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--color-secondary-bg);
}

.leader-podium-avatar .leader-avatar,
.leader-podium-avatar .leader-avatar-fallback {
    width: 100%;
    height: 100%;
}

.leader-item--podium {
    min-height: 66px;
    padding: 11px 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.leader-item--podium + .leader-item--podium::before,
.leaderboard-podium + .leaderboard-rest .leader-item:first-child::before,
.leaderboard-rest .leader-item + .leader-item::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 96px;
    height: 1px;
    background: color-mix(in srgb, var(--color-text) 9%, transparent);
    pointer-events: none;
}

.leaderboard-rest .leader-item {
    border: 0;
    border-radius: 0;
    background: transparent;
}

.leader-item--podium-1 {
    background:
        radial-gradient(circle at 5% 0%, rgba(245, 184, 46, 0.14), transparent 42%),
        var(--color-section-bg);
}

.leader-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    background: var(--color-section-bg);
    border-radius: var(--radius-md);
    padding: var(--spacing-2) var(--spacing-3);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.leader-item:active {
    transform: scale(0.98);
    background: var(--color-section-bg);
}

.leaderboard-list .leader-item:active {
    transform: none;
    background: color-mix(in srgb, var(--color-text) 6%, var(--color-section-bg));
}

.leader-info {
    flex: 1;
    min-width: 0;
}

.leader-name {
    font-weight: 590;
    font-size: var(--font-base);
    margin-bottom: var(--spacing-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leader-streak {
    font-size: var(--font-xs);
    color: var(--color-subtitle);
    font-weight: 500;
}

.leader-points {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--color-link);
    letter-spacing: -0.01em;
}

/* ========================================
   BOTTOM NAVIGATION
   ======================================== */

.bottomnav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(var(--safe-area-bottom), 12px);
    display: flex;
    gap: 8px;
    z-index: 100;
    pointer-events: none;
}

.bottomnav__pill,
.bottomnav__profile {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(30px) saturate(200%) brightness(1.05);
    -webkit-backdrop-filter: blur(30px) saturate(200%) brightness(1.05);
    border: 0.5px solid rgba(255, 255, 255, 0.4);
    box-shadow:
        0 12px 36px rgba(0, 0, 0, 0.15),
        0 2px 6px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -0.5px 0 rgba(0, 0, 0, 0.05);
}

html[data-theme="dark"] .bottomnav__pill,
html[data-theme="dark"] .bottomnav__profile {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow:
        0 12px 36px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.bottomnav__pill {
    flex: 1;
    display: flex;
    border-radius: var(--radius-pill);
    padding: 4px;
    gap: 2px;
}

.bottomnav__tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 2px;
    border: 0;
    cursor: pointer;
    color: var(--color-text);
    background: transparent;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: var(--radius-pill);
    transition: background var(--motion-medium), color var(--motion-medium);
    -webkit-tap-highlight-color: transparent;
}

.bottomnav__tab--active {
    color: var(--color-link);
    background: rgba(255, 255, 255, 0.45);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        0 1px 3px rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .bottomnav__tab--active {
    background: rgba(255, 255, 255, 0.12);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 1px 3px rgba(0, 0, 0, 0.25);
}

.bottomnav__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    stroke-width: 2;
}
.bottomnav__icon svg,
svg.bottomnav__icon {
    width: 18px;
    height: 18px;
    display: block;
}

.bottomnav__icon--pools,
.page-title__pools-icon {
    background: currentColor;
    -webkit-mask: url('/static/assets/telegram-pools.svg') center / contain no-repeat;
    mask: url('/static/assets/telegram-pools.svg') center / contain no-repeat;
}

.telegram-glyph {
    display: inline-block;
    flex: none;
    background: currentColor;
}

.telegram-glyph--tasks {
    -webkit-mask: url('/static/assets/telegram-tasks.svg') center / contain no-repeat;
    mask: url('/static/assets/telegram-tasks.svg') center / contain no-repeat;
}

.telegram-glyph--leaderboard {
    -webkit-mask: url('/static/assets/telegram-leaderboard.svg') center / contain no-repeat;
    mask: url('/static/assets/telegram-leaderboard.svg') center / contain no-repeat;
}

.telegram-glyph--trade {
    -webkit-mask: url('/static/assets/telegram-trade.svg') center / contain no-repeat;
    mask: url('/static/assets/telegram-trade.svg') center / contain no-repeat;
}

.telegram-glyph--socool {
    -webkit-mask: url('/static/assets/telegram-socool.svg') center / contain no-repeat;
    mask: url('/static/assets/telegram-socool.svg') center / contain no-repeat;
}

.page-title__pools-icon {
    width: 20px;
    height: 20px;
    flex: none;
    color: #ffffff;
}

.bottomnav__label {
    max-width: 100%;
    overflow: hidden;
    color: inherit;
    line-height: 1;
    text-overflow: ellipsis;
}

.bottomnav__profile {
    flex: 0 0 auto;
    width: 60px;
    border: 0;
    cursor: pointer;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    transition: background var(--motion-medium), color var(--motion-medium);
    -webkit-tap-highlight-color: transparent;
}

.bottomnav__profile--active {
    color: var(--color-link);
}

.bottomnav__profile--loading .bottomnav__profile-icon {
    display: none;
}

.bottomnav__profile--loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.16;
    animation: nav-avatar-pulse 0.9s ease-in-out infinite alternate;
}

@keyframes nav-avatar-pulse {
    to { opacity: 0.32; }
}

.bottomnav__profile:has(.bottomnav__avatar) {
    padding: 0;
    overflow: hidden;
}

.bottomnav__profile--active:has(.bottomnav__avatar) {
    box-shadow:
        0 0 0 2px var(--color-link),
        0 4px 18px rgba(0, 0, 0, 0.08);
}

.bottomnav__avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-circle);
    display: block;
}

@media (prefers-reduced-motion: reduce) {
    .bottomnav__tab,
    .bottomnav__profile {
        transition: none;
    }
    .bottomnav__profile--loading::after {
        animation: none;
    }
}

@media (max-width: 390px) {
    .bottomnav__tab {
        font-size: 10px;
        padding: 8px 1px;
    }
}
@media (max-width: 350px) {
    .bottomnav__tab {
        font-size: 9px;
    }
}

/* ==================== */
/* WELCOME CARD         */
/* ==================== */

/* Welcome Cards Carousel Container */
.welcome-cards-container {
    display: flex;
    gap: var(--spacing-3);
    overflow-x: auto;
    overflow-y: hidden;
    margin-top: var(--spacing-4);
    margin-bottom: var(--spacing-2);
    padding-bottom: var(--spacing-2);
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.welcome-cards-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

.welcome-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #E0EFFF 50%, #3390EC 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-4);
    min-height: 144px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    width: 70%;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
}

.welcome-animation {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    transform: translateX(-20px);
}

.welcome-animation lottie-player {
    width: 100%;
    height: 100%;
}

.welcome-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
    flex: 1;
}

.welcome-greeting {
    font-size: var(--font-lg);
    font-weight: 700;
    color: #1E1E1E;
    line-height: 1.2;
}

.welcome-sub {
    font-size: var(--font-footnote, 13px);
    font-weight: 510;
    color: rgba(30, 30, 30, 0.62);
    line-height: 1.3;
}

.welcome-card-invite {
    background: linear-gradient(135deg, #1a1f3a 0%, #0d1117 100%);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
}
.welcome-card-invite .welcome-greeting {
    color: #fff;
}
.welcome-card-invite .welcome-sub {
    color: rgba(255, 255, 255, 0.7);
}
.welcome-card-invite:active {
    transform: scale(0.98);
}

/* DeDust Welcome Card Variant */
.welcome-card.welcome-card-dedust {
    background: linear-gradient(135deg, #FF3F12 0%, #FFA800 100%) !important;
    border: none;
    cursor: pointer;
    padding: var(--spacing-4);
    transition: transform 0.2s ease;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
}

.welcome-card.welcome-card-dedust:active {
    transform: scale(0.98);
}

.welcome-dedust-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 2px;
    z-index: 1;
    flex: 1;
    margin-left: auto;
    padding-right: var(--spacing-2);
}

.welcome-dedust-title {
    font-size: var(--font-xl);
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.1;
}

.welcome-dedust-subtitle {
    font-size: var(--font-sm);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.welcome-dedust-badge {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    background: rgba(0, 0, 0, 0.25);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    margin-top: var(--spacing-2);
}

.welcome-dedust-logo {
    width: 20px;
    height: 20px;
}

.welcome-dedust-badge span {
    font-size: var(--font-sm);
    font-weight: 600;
    color: #FFFFFF;
}

.welcome-dedust-animation {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
    opacity: 0.9;
}

.welcome-dedust-animation lottie-player {
    width: 100%;
    height: 100%;
}

/* ==================== */
/* HOME TASK SECTIONS   */
/* ==================== */

.home-task-stack {
    display: block;
}

.bagwork-task-group + .bagwork-task-group {
    margin-top: 20px;
}

.bagwork-task-group__title {
    margin: 0 16px 8px;
    color: var(--color-hint);
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    letter-spacing: -0.08px;
}

.bagwork-task-row {
    min-height: 64px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.bagwork-task-row .home-checkin-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.bagwork-task-row .home-checkin-title {
    display: block;
    overflow: hidden;
    color: var(--color-text);
    font-size: 17px;
    font-weight: 510;
    line-height: 22px;
    letter-spacing: -0.43px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bagwork-task-row .home-checkin-subtitle {
    display: block;
    overflow: hidden;
    color: var(--color-hint);
    font-size: 13px;
    font-weight: 400;
    line-height: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bagwork-task-row .home-checkin-cost {
    flex: none;
    max-width: 112px;
    overflow: hidden;
    padding: 0;
    color: var(--color-hint);
    background: none;
    border-radius: 0;
    font-size: 15px;
    font-weight: 400;
    line-height: 20px;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bagwork-task-row:disabled {
    cursor: default;
    opacity: 1;
}

.bagwork-task-row.is-completed {
    cursor: default;
    pointer-events: none;
}

.bagwork-task-row.is-completed .home-checkin-title,
.bagwork-task-row.is-completed .home-checkin-subtitle,
.bagwork-task-row.is-completed .home-checkin-cost {
    color: var(--color-hint);
    opacity: 0.62;
}

.bagwork-task-row.is-completed .nav-row__chevron {
    min-width: 16px;
    justify-content: center;
    color: var(--color-hint);
    opacity: 0.62;
}

.bagwork-task-row.is-completed .nav-row__chevron svg {
    display: none;
}

.bagwork-task-row.is-completed .nav-row__chevron::before {
    content: "\2713";
    font-size: 17px;
    font-weight: 600;
    line-height: 1;
}

.home-checkin-message { display: none; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-3);
}

.section-title {
    font-size: var(--font-base);
    font-weight: 600;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.section-title svg {
    width: 18px;
    height: 18px;
}

/* =====================
   SKELETON LOADERS
   ===================== */

@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

.skeleton {
    animation: shimmer 1.5s infinite linear;
    background: linear-gradient(
        to right,
        var(--color-secondary-bg) 8%,
        var(--alpha-white-08) 18%,
        var(--color-secondary-bg) 33%
    );
    background-size: 800px 100px;
    border-radius: var(--radius-md);
}

.skeleton-leader-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    background: var(--color-secondary-bg);
    border-radius: var(--radius-md);
    padding: var(--spacing-2) var(--spacing-3);
    margin-bottom: var(--spacing-1);
}

.skeleton-rank {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
}

.skeleton-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
}

.skeleton-name {
    height: 16px;
    width: 120px;
    border-radius: var(--radius-sm);
}

.skeleton-subtitle {
    height: 12px;
    width: 80px;
    border-radius: var(--radius-sm);
}

.skeleton-points {
    height: 16px;
    width: 60px;
    border-radius: var(--radius-sm);
}

/* Skeleton button state for home page CTAs */
.skeleton-btn {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.skeleton-badge {
    animation: shimmer 1.5s infinite linear;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.05) 100%
    ) !important;
    background-size: 468px 100% !important;
    color: transparent !important;
    user-select: none;
}

/* Leader Avatar Styles */
.leader-rank-badge {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.leader-avatar,
.leader-avatar-fallback {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.leader-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-secondary-bg);
    color: var(--color-text);
    font-weight: 600;
    font-size: var(--font-lg);
}

.leader-rank-badge .rank-number {
    position: absolute;
    bottom: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--color-secondary-bg);
    color: var(--color-hint);
    font-size: var(--font-xs);
    font-weight: 600;
    border: 2px solid var(--color-bg);
}

.leader-rank-badge.top1 .rank-number {
    background: #C9A227;
    color: #fff;
}

.leader-rank-badge.top2 .rank-number {
    background: #8E8E93;
    color: #fff;
}

.leader-rank-badge.top3 .rank-number {
    background: #A0522D;
    color: #fff;
}

/* ==========================================
   LOADING STATES
   ========================================== */

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(23, 33, 43, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Spinner */
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-secondary-bg);
    border-top-color: var(--color-accent);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

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

/* Loading Message */
.loading-message {
    margin-top: var(--spacing-4);
    color: var(--color-text);
    font-size: var(--font-base);
    font-weight: 500;
    text-align: center;
}

.loading-submessage {
    margin-top: var(--spacing-2);
    color: var(--color-hint);
    font-size: var(--font-sm);
    text-align: center;
}

/* ==========================================
   BOTTOM SHEET MODAL
   ========================================== */

.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.bottom-sheet-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.bottom-sheet {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: max(var(--safe-area-bottom), 8px);
    width: calc(100% - 16px);
    max-width: 460px;
    margin: 0 auto;
    background: var(--color-secondary-bg);
    border-radius: 30px;
    box-shadow: 0 15px 75px rgba(0, 0, 0, 0.24);
    z-index: 10001;
    transform: translateY(calc(100% + max(var(--safe-area-bottom), 8px) + 8px));
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 90vh;
    overflow: hidden;
}

.bottom-sheet.active {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--color-hint);
    opacity: 0.4;
    border-radius: 2px;
    margin: 12px auto 0;
}

.bottom-sheet-content {
    padding: var(--spacing-5) var(--spacing-5) var(--spacing-8);
    text-align: center;
}

.bottom-sheet-icon {
    width: 100px;
    height: 100px;
    margin: var(--spacing-4) auto var(--spacing-5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-sheet-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bottom-sheet-title {
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--spacing-3);
    letter-spacing: -0.02em;
}

.bottom-sheet-description {
    font-size: var(--font-base);
    color: var(--color-hint);
    margin-bottom: var(--spacing-5);
    line-height: 1.5;
}

.bottom-sheet-reward {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-2) var(--spacing-4);
    background: #34c759;
    border-radius: var(--radius-full);
    color: #ffffff;
    font-weight: 600;
    font-size: var(--font-sm);
    margin-bottom: var(--spacing-6);
}

.bottom-sheet-reward svg {
    width: 18px;
    height: 18px;
}

.bottom-sheet-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
}

.bottom-sheet-btn {
    width: 100%;
    padding: var(--spacing-4);
    border: none;
    border-radius: var(--radius-full);
    font-size: var(--font-base);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    transition: all 0.2s ease;
}

.bottom-sheet-btn svg {
    width: 20px;
    height: 20px;
}

.bottom-sheet-btn-primary {
    background: var(--color-accent);
    color: var(--color-accent-text);
}

.bottom-sheet-btn-primary:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.bottom-sheet-btn-secondary {
    background: var(--alpha-white-08);
    color: var(--color-text);
}

.bottom-sheet-btn-secondary:active {
    background: rgba(255, 255, 255, 0.12);
}

.bottom-sheet-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bottom-sheet-btn.loading {
    pointer-events: none;
}

.bottom-sheet-btn.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: var(--spacing-2);
}

/* ==========================================
   EMPTY STATES
   ========================================== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-8);
    text-align: center;
    min-height: 200px;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: var(--spacing-4);
    opacity: 0.8;
}

.empty-state-title {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-2);
}

.empty-state-message {
    font-size: var(--font-sm);
    color: var(--color-hint);
    margin-bottom: var(--spacing-5);
    max-width: 280px;
}

.empty-state-cta {
    padding: var(--spacing-3) var(--spacing-5);
    background: var(--color-accent);
    color: var(--color-accent-text);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.empty-state-cta:active {
    transform: scale(0.96);
    opacity: 0.8;
}

/* ============================================================
   CLUB PAGE — "Join the club" landing (ported from redoapp)
   Blue hero (phone mockup) → title/desc → CTA → rules row.
   ============================================================ */
.verif {
    display: flex;
    flex-direction: column;
    padding: 0 16px 110px;
}

/* Full-bleed blue hero. Breaks out of the 16px page padding via 100vw + center
   translate; rounded only at the bottom. */
.verif__hero {
    position: relative;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    margin-top: 0;
    padding-top: calc(var(--tg-safe-area-inset-top, env(safe-area-inset-top, 0px)) + 16px);
    padding-bottom: 0;
    background:
        radial-gradient(125% 85% at 50% -12%, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 58%),
        radial-gradient(80% 60% at 82% 6%, rgba(150, 210, 255, 0.5), rgba(150, 210, 255, 0) 60%),
        linear-gradient(180deg, #4cb1ff 0%, #38a4fd 54%, #2f93ec 100%);
    border-radius: 0 0 28px 28px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.verif__phone {
    width: min(82vw, 340px);
    aspect-ratio: 450 / 386;
    object-fit: cover;
    object-position: center top;
    display: block;
}

/* Segmented control on the blue */
.verif__title {
    margin: 20px 0 6px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-align: center;
    color: var(--color-text);
}

.verif__desc {
    margin: 0 0 18px;
    color: var(--color-hint);
    font-size: 0.98rem;
    line-height: 1.4;
    text-align: center;
}
.verif__req {
    margin: -10px 0 18px;
    color: var(--color-hint);
    font-size: 0.86rem;
    line-height: 1.4;
    text-align: center;
}
.verif__req[hidden] {
    display: none;
}

.verif__action {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
}
.verif__action[hidden] {
    display: none;
}

.verif--member .verif__title {
    margin: 12px 0 2px;
    font-size: 1.28rem;
}
.verif--member .verif__desc {
    margin: 0;
    font-size: 0.9rem;
}
.verif--member .verif__req {
    margin: 2px 0 10px;
    font-size: 0.82rem;
}
.verif--member .verif__action {
    margin-bottom: 0;
}
.verif--member .verif__btn {
    padding: 11px 18px;
}
.verif--member .incl {
    margin-top: 12px;
}

/* iOS 26 prominent filled capsule CTA */
.verif__btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 14px 20px;
    border: none;
    border-radius: 1000px;
    background: var(--color-accent);
    color: var(--color-accent-text);
    font-size: 17px;
    font-weight: 590;
    letter-spacing: -0.43px;
    line-height: 22px;
    cursor: pointer;
    transition: transform 0.08s ease, filter 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.verif__btn:active {
    transform: scale(0.98);
    filter: brightness(0.94);
}
.verif__btn-icon {
    display: inline-flex;
}
.verif__btn-icon svg {
    display: block;
    width: 20px;
    height: 20px;
}
.verif__btn:disabled {
    cursor: default;
}
.verif__btn--secondary {
    background: var(--color-section-bg);
    color: var(--color-text);
}
.verif__btn[hidden] {
    display: none;
}
.verif__btn.loading .verif__btn-icon {
    width: 18px;
    height: 18px;
    border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: verif-spin 0.75s linear infinite;
}
.verif__btn.loading .verif__btn-icon svg {
    display: none;
}
@keyframes verif-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .verif__btn.loading .verif__btn-icon {
        animation-duration: 1.5s;
    }
}

/* iOS grouped "section card" wrapping the rules row */
.section-card {
    background: var(--color-section-bg);
    border-radius: 16px;
    overflow: hidden;
}

.incl {
    margin: 16px 4px 8px;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-hint);
}
.incl-list {
    background: var(--color-section-bg);
    border-radius: 16px;
    overflow: hidden;
}
.incl-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
}
.incl-row + .incl-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 58px;
    right: 0;
    border-top: 0.5px solid var(--color-separator);
}
.incl-row__icon {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background-color: var(--ic, #0088ff);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(0, 0, 0, 0.18));
}
.incl-row__icon svg,
.incl-row__glyph {
    width: 17px;
    height: 17px;
}
.incl-row__glyph {
    display: block;
    flex: none;
    background: currentColor;
    -webkit-mask: center / contain no-repeat;
    mask: center / contain no-repeat;
}
.incl-row__glyph--leaderboard {
    -webkit-mask-image: url('/static/assets/telegram-leaderboard.svg');
    mask-image: url('/static/assets/telegram-leaderboard.svg');
}
.incl-row__glyph--lock {
    -webkit-mask-image: url('/static/assets/telegram-lock.svg');
    mask-image: url('/static/assets/telegram-lock.svg');
}
.incl-row__glyph--channel {
    -webkit-mask-image: url('/static/assets/telegram-channel.svg');
    mask-image: url('/static/assets/telegram-channel.svg');
}
.incl-row__glyph--stars {
    -webkit-mask-image: url('/static/assets/telegram-stars.svg');
    mask-image: url('/static/assets/telegram-stars.svg');
}
.incl-row__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.incl-row__title {
    font-size: 16px;
    font-weight: 600;
    line-height: 21px;
    color: var(--color-text);
}
.incl-row__desc {
    font-size: 13px;
    line-height: 17px;
    color: var(--color-hint);
}

/* iOS-style navigable settings row */
.nav-row {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    gap: 14px;
    background: none;
    border: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.12s;
}
.nav-row:active {
    background: color-mix(in srgb, var(--color-text), transparent 92%);
}
.nav-row + .nav-row::before {
    content: "";
    position: absolute;
    top: 0;
    left: 60px;
    right: 16px;
    height: 0.5px;
    background: var(--color-separator);
    pointer-events: none;
}
.nav-row--link + .nav-row--link::before {
    left: 16px;
}

.nav-row__icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}
.nav-row__icon--blue {
    background: #008bff;
}
.nav-row__icon--purple {
    background: #af52de;
}
.nav-row__icon--green {
    background: #34c759;
}
.nav-row__icon--black {
    background: #000;
}
.nav-row__icon--task {
    background: transparent;
    border-radius: 0;
}
.nav-row__icon--task::before,
.nav-row__icon--task::after {
    display: none;
}
.nav-row__icon--task img {
    display: block;
    width: 28px;
    height: 28px;
}
.nav-row__icon::before,
.nav-row__icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    pointer-events: none;
}
.nav-row__icon::before {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.2) 100%);
}
.nav-row__icon::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    mix-blend-mode: plus-lighter;
}
.nav-row__icon svg {
    position: relative;
    z-index: 1;
    width: 17px;
    height: 17px;
}
.nav-row__wallet-icon,
.nav-row__channel-icon,
.nav-row__group-icon {
    position: relative;
    z-index: 1;
    background: currentColor;
    flex: none;
}
.nav-row__wallet-icon {
    width: 18px;
    height: 15px;
    -webkit-mask: url('/static/assets/telegram-wallet.svg') center / contain no-repeat;
    mask: url('/static/assets/telegram-wallet.svg') center / contain no-repeat;
}
.nav-row__channel-icon {
    width: 16px;
    height: 18px;
    -webkit-mask: url('/static/assets/telegram-channel.svg') center / contain no-repeat;
    mask: url('/static/assets/telegram-channel.svg') center / contain no-repeat;
}
.nav-row__group-icon {
    width: 18px;
    height: 18px;
    -webkit-mask: url('/static/assets/telegram-group.svg') center / contain no-repeat;
    mask: url('/static/assets/telegram-group.svg') center / contain no-repeat;
}

.nav-row__label {
    flex: 1;
    font-size: 17px;
    font-weight: 510;
    line-height: 22px;
    letter-spacing: -0.43px;
    color: var(--color-text);
}

.nav-row__chevron {
    display: inline-flex;
    align-items: center;
    color: color-mix(in srgb, var(--color-hint), transparent 35%);
}
.nav-row__chevron svg {
    width: 16px;
    height: 16px;
}

/* ============================================================
   PROFILE + EARN/REFERRAL — ported verbatim from myduckai
   (dark-first fallbacks for Cool Hub).
   ============================================================ */

/* Pill button base (myduckai .btn) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.08s, filter 0.15s, opacity 0.15s;
}
.btn:active { transform: scale(0.98); filter: brightness(0.95); }
.btn--primary {
    background: var(--color-accent);
    color: var(--color-accent-text);
}

/* ---- Profile ---- */
#profile-page .page-content {
    padding: 8px 8px 100px;
}

.account-profile {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 24px;
}

.account-profile__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 22px 0 12px;
    text-align: center;
}

.account-profile__avatar {
    display: grid;
    width: 96px;
    height: 96px;
    place-items: center;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.account-profile__avatar--fallback {
    background: linear-gradient(145deg, #63a8ff, #3478d8);
    color: #fff;
    font-size: 38px;
    font-weight: 650;
}

.account-profile__name {
    margin: 14px 0 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.account-profile__handle {
    margin: 4px 0 0;
    color: var(--color-hint);
    font-size: 15px;
}

.account-profile__value {
    min-width: 0;
    overflow: hidden;
    color: var(--color-hint);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-profile .section-card {
    border-radius: 26px;
}

.account-profile .nav-row {
    gap: 16px;
}

.account-profile .nav-row__icon svg {
    width: 22px;
    height: 22px;
}

.account-profile .nav-row--link {
    gap: 0;
}

.account-profile .nav-row--link .nav-row__label {
    color: var(--color-link);
}

/* ---- Earn / Referral page ---- */
.referral { display: flex; flex-direction: column; gap: 14px; padding-bottom: 24px; }
.referral__hero {
    position: relative; display: flex; flex-direction: column;
    align-items: center; text-align: center; padding: 8px 8px 0;
}
.referral__hero::before {
    content: ''; position: absolute; top: -31px; left: 50%;
    width: 150px; height: 150px; margin-left: -75px; border-radius: 50%;
    background: radial-gradient(circle, rgba(150, 111, 254, 0.55), rgba(150, 111, 254, 0) 70%);
    filter: blur(20px); pointer-events: none;
    animation: referral-glow 6s ease-in-out infinite alternate;
}
.referral__hero > * { position: relative; }
@keyframes referral-glow { from { transform: scale(1); opacity: 0.7; } to { transform: scale(1.14); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .referral__hero::before { animation: none; } }
.referral__anim { width: 120px; height: 120px; }
.referral__anim lottie-player { width: 100%; height: 100%; }
.referral__title { margin: 16px 0 0; font-size: 23px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
.referral__sub {
    margin: 8px 8px 0; font-size: 15px; line-height: 1.4;
    color: var(--color-hint); text-wrap: balance;
}
.referral__sub strong { color: var(--color-text); font-weight: 600; }

.referral__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.referral__stat {
    padding: 16px 12px; border-radius: 26px;
    background: var(--color-section-bg); text-align: center;
}
.referral__stat-value { font-size: 28px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.referral__stat-label { margin-top: 6px; font-size: 13px; color: var(--color-hint); }

.referral__link-card {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 13px 16px; border: none; border-radius: 999px;
    background: var(--color-section-bg);
    cursor: pointer; text-align: left; -webkit-tap-highlight-color: transparent;
    transition: background-color 0.25s ease, color 0.25s ease;
}
.referral__link-card:active { opacity: 0.7; }
.referral__link-card--copied { background-color: rgba(52, 199, 89, 0.16); }
.referral__link-card--copied .referral__link-icon { color: #34c759; opacity: 1; }
.referral__link-icon { flex-shrink: 0; color: var(--color-hint); opacity: 0.7; }
.referral__link-text {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--color-hint);
}
.referral__share { width: 100%; gap: 8px; padding: 14px 16px; font-size: 16px; }
.referral__share-icon { width: 18px; height: 18px; }

.referral__history { display: flex; flex-direction: column; }
.referral__section-title {
    margin: 0; padding: 4px 4px 8px; font-size: 0.78rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--color-hint);
}
.referral__events { display: flex; flex-direction: column; border-radius: 26px; background: var(--color-section-bg); }
.referral__event { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-top: 0.5px solid var(--color-separator); }
.referral__event:first-child { border-top: none; }
.referral__event-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.referral__event-title { font-size: 16px; font-weight: 500; }
.referral__event-date { font-size: 13px; color: var(--color-hint); }
.referral__event-amount { flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; color: #34c759; }

.referral__steps {
    list-style: none; margin: 4px 0 0; padding: 4px 18px 18px; border-radius: 26px;
    background: var(--color-section-bg);
}
.referral__steps li { display: flex; align-items: center; gap: 12px; padding: 14px 0; font-size: 15px; line-height: 1.35; border-top: 0.5px solid var(--color-separator); }
.referral__steps li:first-child { border-top: none; }
.referral__step-n {
    flex-shrink: 0; display: grid; place-items: center; width: 26px; height: 26px;
    border-radius: 50%; background: var(--color-accent);
    color: var(--color-accent-text); font-size: 14px; font-weight: 700;
}

/* Invite-friends hero: purple sparkle field behind the Lottie + purple glow. */
.referral__stage {
    position: relative;
    width: 100%;
    height: 150px;
    display: grid;
    place-items: center;
}
.referral__sparkles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}
.referral__stage .referral__anim {
    position: relative;
    z-index: 1;
}

html.tg-sheet-open .bottomnav { display: none; }

.sheet-scrim {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    animation: sheet-fade 0.2s ease;
}
.sheet-scrim[hidden] { display: none; }
.sheet {
    position: relative;
    width: calc(100% - 16px);
    max-width: 460px;
    margin-bottom: max(calc(var(--safe-area-bottom) - 5px), 8px);
    max-height: 82dvh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    border-radius: 30px;
    box-shadow: 0 15px 75px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    animation: sheet-up 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(110%); } to { transform: translateY(0); } }

.sheet__grab {
    flex: none;
    width: 36px;
    height: 5px;
    border-radius: 3px;
    margin: 8px auto 0;
    background: color-mix(in srgb, var(--color-text) 18%, transparent);
}
.sheet__close {
    flex: none;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-text) 6%, transparent);
    color: var(--color-hint);
    cursor: pointer;
}
.sheet__close:active { transform: scale(0.92); }
.sheet__close svg { width: 14px; height: 14px; }
.sheet__header {
    flex: none;
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 12px 8px 20px;
}
.sheet__header-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--color-text);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sheet__body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 4px 20px 28px;
}
.sheet__subtitle {
    margin: 0 0 14px;
    color: var(--color-hint);
    font-size: 0.9rem;
    line-height: 1.4;
}
.sheet-select__row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px 16px;
    border: 0;
    background: none;
    font: inherit;
    text-align: left;
    color: var(--color-text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.sheet-select__row:active { background: color-mix(in srgb, var(--color-text) 5%, transparent); }
.sheet-select__row--sep::before {
    content: "";
    position: absolute;
    top: 0;
    left: 16px;
    right: 16px;
    height: 0.5px;
    background: var(--color-separator);
}
.sheet-select__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.sheet-select__name {
    font-size: 16px;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sheet-select__check {
    flex: none;
    width: 22px;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    color: var(--color-accent);
}
.flag {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}
.flag svg { width: 100%; height: 100%; display: block; }
/* First-launch welcome slide, aligned with build-tonsite completion behavior. */
.welcome-slider {
    position: fixed;
    inset: 0;
    z-index: 10000;
    box-sizing: border-box;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 20px;
    min-height: 100vh;
    min-height: 100dvh;
    padding:
        max(24px, env(safe-area-inset-top))
        max(20px, env(safe-area-inset-right))
        max(24px, env(safe-area-inset-bottom))
        max(20px, env(safe-area-inset-left));
    overflow: hidden;
    color: #ffffff;
    background: #000000;
    transition: opacity 220ms ease, transform 220ms ease;
}

.welcome-slider[hidden] {
    display: none;
}

.welcome-slider--closing {
    opacity: 0;
    transform: scale(1.015);
    pointer-events: none;
}

.welcome-slider-open,
.welcome-slider-open body {
    overflow: hidden;
}

.welcome-slider__visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 0;
}

.welcome-slider__visual img {
    display: block;
    width: min(100%, 560px);
    height: auto;
    max-height: 62dvh;
    object-fit: contain;
}

.welcome-slider__content {
    display: grid;
    gap: 24px;
    width: min(100%, 560px);
    margin: 0 auto;
}

.welcome-slider__title {
    margin: 0;
    color: #ffffff;
    font-family: 'SF Pro Display', 'Helvetica Neue', sans-serif;
    font-size: clamp(24px, 7.2vw, 36px);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.04em;
    text-align: center;
    white-space: nowrap;
}

.welcome-slider__continue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    min-height: 0;
    padding: 14px 20px;
    border: 0;
    border-radius: 1000px;
    color: var(--color-accent-text);
    background: var(--color-accent);
    font: inherit;
    font-size: 17px;
    font-weight: 590;
    line-height: 22px;
    letter-spacing: -0.43px;
    cursor: pointer;
    transition: transform 0.08s, opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.welcome-slider__continue:active {
    transform: scale(0.97);
    opacity: 0.85;
}

@media (max-height: 620px) {
    .welcome-slider {
        gap: 12px;
        padding-top: max(12px, env(safe-area-inset-top));
    }

    .welcome-slider__visual img {
        max-height: 50dvh;
    }

    .welcome-slider__content {
        gap: 16px;
    }

    .welcome-slider__title {
        font-size: clamp(23px, 6.8vw, 30px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .welcome-slider {
        transition: none;
    }
}
/* Hidden experimental profile settings, matching build-tonsite. */
.nav-row[hidden] {
    display: none;
}

.nav-row__icon--orange {
    position: relative;
    color: #fff;
    background: #ff9500;
    overflow: hidden;
}

.nav-row__icon--orange::before,
.nav-row__icon--orange::after {
    position: absolute;
    inset: 0;
    border-radius: 8px;
    content: "";
}

.nav-row__icon--orange::before {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.2) 100%);
}

.nav-row__icon--orange::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    mix-blend-mode: plus-lighter;
}

.nav-row__icon--orange svg {
    position: relative;
    z-index: 1;
    width: 28px;
    height: 28px;
}

.bottomnav [hidden] {
    display: none;
}

.toggle-row {
    gap: 12px;
}

.toggle-row__label {
    flex: 1;
    min-width: 0;
    color: var(--color-text);
    font-size: 16px;
    font-weight: 500;
}

.sbadge {
    flex: none;
    padding: 3px 7px;
    border-radius: 999px;
    color: var(--color-link);
    background: color-mix(in srgb, var(--color-link) 12%, transparent);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.sw {
    position: relative;
    flex: none;
    width: 51px;
    height: 31px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-text) 18%, transparent);
    transition: background 180ms ease;
}

.sw::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.24);
    transition: transform 180ms ease;
}

.sw--on {
    background: var(--color-link);
}

.sw--on::after {
    transform: translateX(20px);
}
