/* ============================================================
   Venture VPN — Telegram Mini App Design System
   Premium glassmorphism UI with Telegram theme adaptation
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
    /* Primary palette */
    --primary: #6C3CE1;
    --primary-light: #8B5CF6;
    --primary-dark: #5521C5;
    --primary-gradient: linear-gradient(135deg, #6C3CE1 0%, #8B5CF6 100%);

    /* Accent */
    --accent: #00D1B2;
    --accent-light: #33EDCF;
    --accent-dark: #00A68E;
    --accent-gradient: linear-gradient(135deg, #00D1B2 0%, #00E5C4 100%);

    /* Status colors */
    --success: #22C55E;
    --success-bg: rgba(34, 197, 94, 0.12);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --error: #EF4444;
    --error-bg: rgba(239, 68, 68, 0.12);
    --info: #3B82F6;
    --info-bg: rgba(59, 130, 246, 0.12);

    /* Dark theme (default) */
    --bg-primary: #0F0F1A;
    --bg-secondary: #1A1A2E;
    --bg-tertiary: #252540;
    --bg-card: rgba(30, 30, 55, 0.7);
    --bg-card-hover: rgba(40, 40, 70, 0.8);
    --bg-glass: rgba(30, 30, 55, 0.5);
    --bg-input: rgba(40, 40, 70, 0.6);
    --bg-overlay: rgba(0, 0, 0, 0.6);

    --text-primary: #F8F8FF;
    --text-secondary: #A0A0C0;
    --text-tertiary: #6B6B8D;
    --text-inverse: #0F0F1A;

    --border-color: rgba(108, 60, 225, 0.15);
    --border-light: rgba(255, 255, 255, 0.06);
    --divider: rgba(255, 255, 255, 0.05);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(108, 60, 225, 0.2);
    --shadow-glow-accent: 0 0 20px rgba(0, 209, 178, 0.15);

    /* Glass */
    --glass-blur: 16px;
    --glass-border: rgba(255, 255, 255, 0.08);

    /* Spacing — fluid scaling (320px → 430px+) */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: clamp(10px, 3.9vw, 16px);
    --space-xl: clamp(12px, 4.8vw, 20px);
    --space-2xl: clamp(16px, 5.8vw, 24px);
    --space-3xl: clamp(20px, 7.7vw, 32px);
    --space-4xl: clamp(24px, 9.7vw, 40px);

    /* Radius — fluid */
    --radius-sm: 8px;
    --radius-md: clamp(10px, 2.9vw, 12px);
    --radius-lg: clamp(12px, 3.9vw, 16px);
    --radius-xl: clamp(14px, 4.8vw, 20px);
    --radius-2xl: clamp(18px, 5.8vw, 24px);
    --radius-full: 9999px;

    /* Typography — fluid scaling (320px → 430px+) */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-xs: clamp(10px, 2.7vw, 11px);
    --font-sm: clamp(11.5px, 3.2vw, 13px);
    --font-base: clamp(12.5px, 3.7vw, 15px);
    --font-lg: clamp(14px, 4.1vw, 17px);
    --font-xl: clamp(16px, 4.8vw, 20px);
    --font-2xl: clamp(18px, 5.8vw, 24px);
    --font-3xl: clamp(20px, 6.8vw, 28px);
    --font-4xl: clamp(22px, 8.2vw, 34px);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Layout */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --tab-bar-height: clamp(56px, 15.5vw, 64px);
    --header-height: clamp(48px, 13.5vw, 56px);
}

/* --- Light theme overrides --- */
.theme-light {
    --bg-primary: #F5F3FF;
    --bg-secondary: #EDE9FE;
    --bg-tertiary: #DDD6FE;
    --bg-card: rgba(255, 255, 255, 0.75);
    --bg-card-hover: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.5);
    --bg-input: rgba(237, 233, 254, 0.6);
    --bg-overlay: rgba(0, 0, 0, 0.4);

    --text-primary: #1A1A2E;
    --text-secondary: #5B5B7B;
    --text-tertiary: #8B8BA8;
    --text-inverse: #F8F8FF;

    --border-color: rgba(108, 60, 225, 0.12);
    --border-light: rgba(0, 0, 0, 0.05);
    --divider: rgba(0, 0, 0, 0.06);

    --shadow-sm: 0 2px 8px rgba(108, 60, 225, 0.06);
    --shadow-md: 0 4px 16px rgba(108, 60, 225, 0.08);
    --shadow-lg: 0 8px 32px rgba(108, 60, 225, 0.1);

    --glass-border: rgba(255, 255, 255, 0.5);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-base);
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior-y: contain;
}

a {
    color: var(--primary-light);
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    font-size: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
    outline: none;
}

img {
    max-width: 100%;
    display: block;
}

ul, ol {
    list-style: none;
}

/* --- App Shell --- */
#app {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

/* Background ambient glow */
#app::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -40%;
    width: 120%;
    height: 120%;
    background: radial-gradient(ellipse, rgba(108, 60, 225, 0.06) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

#app::after {
    content: '';
    position: fixed;
    bottom: -50%;
    right: -40%;
    width: 120%;
    height: 120%;
    background: radial-gradient(ellipse, rgba(0, 209, 178, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* --- Loading Screen --- */
.loading-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    z-index: 9999;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-screen__logo {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-xl);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-2xl);
    animation: pulse-glow 2s ease-in-out infinite;
    box-shadow: var(--shadow-glow);
}

.loading-screen__logo svg {
    width: 36px;
    height: 36px;
    color: white;
}

.loading-screen__spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-screen__text {
    margin-top: var(--space-lg);
    color: var(--text-tertiary);
    font-size: var(--font-sm);
}

/* --- Page Container --- */
.page-container {
    position: relative;
    flex: 1;
    padding-bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + var(--space-lg));
    z-index: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.page-view {
    position: absolute;
    inset: 0;
    padding: 32px var(--space-lg) calc(var(--tab-bar-height) + var(--safe-bottom) + var(--space-3xl));
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    will-change: transform, opacity;
    transition: transform var(--transition-base), opacity var(--transition-base);
}

.page-view.page-enter {
    transform: translateX(100%);
    opacity: 0;
}

.page-view.page-enter-active {
    transform: translateX(0);
    opacity: 1;
}

.page-view.page-exit {
    transform: translateX(0);
    opacity: 1;
}

.page-view.page-exit-active {
    transform: translateX(-30%);
    opacity: 0;
}

.page-view.page-enter-back {
    transform: translateX(-30%);
    opacity: 0;
}

.page-view.page-enter-back-active {
    transform: translateX(0);
    opacity: 1;
}

.page-view.page-exit-back {
    transform: translateX(0);
    opacity: 1;
}

.page-view.page-exit-back-active {
    transform: translateX(100%);
    opacity: 0;
}

/* --- Page Header --- */
.page-header {
    margin-bottom: var(--space-2xl);
}

.page-header__title {
    font-size: var(--font-2xl);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.page-header__subtitle {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

/* --- Glass Card --- */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    pointer-events: none;
}

.card--interactive {
    cursor: pointer;
}

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

.card--primary {
    background: var(--primary-gradient);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.card--primary .card__subtitle,
.card--primary .text-secondary {
    color: rgba(255, 255, 255, 0.7);
}

.card--accent {
    border-color: rgba(0, 209, 178, 0.2);
    box-shadow: var(--shadow-glow-accent);
}

.card + .card {
    margin-top: var(--space-md);
}

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.card__title {
    font-size: var(--font-lg);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.card__subtitle {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-top: 2px;
}

.card__body {
    /* default */
}

.card__footer {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--divider);
}

.card__icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card__icon--primary {
    background: rgba(108, 60, 225, 0.12);
    color: var(--primary-light);
}

.card__icon--accent {
    background: rgba(0, 209, 178, 0.12);
    color: var(--accent);
}

.card__icon--success {
    background: var(--success-bg);
    color: var(--success);
}

.card__icon--warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.card__icon--error {
    background: var(--error-bg);
    color: var(--error);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-base);
    line-height: 1;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}

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

.btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.btn--primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 12px rgba(108, 60, 225, 0.3);
}

.btn--primary:active {
    box-shadow: 0 2px 6px rgba(108, 60, 225, 0.2);
}

.btn--accent {
    background: var(--accent-gradient);
    color: #0F0F1A;
    box-shadow: 0 4px 12px rgba(0, 209, 178, 0.3);
}

.btn--secondary {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn--ghost {
    background: transparent;
    color: var(--primary-light);
}

.btn--ghost:active {
    background: rgba(108, 60, 225, 0.08);
}

.btn--danger {
    background: var(--error);
    color: #fff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn--outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary-light);
}

.btn--sm {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-sm);
    border-radius: var(--radius-sm);
}

.btn--lg {
    padding: var(--space-lg) var(--space-2xl);
    font-size: var(--font-lg);
    border-radius: var(--radius-lg);
}

.btn--block {
    width: 100%;
}

.btn--icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Ripple effect */
.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.4;
}

.badge--active {
    background: var(--success-bg);
    color: var(--success);
}

.badge--expired {
    background: var(--error-bg);
    color: var(--error);
}

.badge--none {
    background: var(--bg-input);
    color: var(--text-tertiary);
}

.badge--popular {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge--accent {
    background: rgba(0, 209, 178, 0.12);
    color: var(--accent);
}

.badge__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse-dot 2s ease-in-out infinite;
}

/* --- Inputs --- */
.input-group {
    position: relative;
    margin-bottom: var(--space-lg);
}

.input-group__label {
    display: block;
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.input {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-base);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 60, 225, 0.15);
}

.input::placeholder {
    color: var(--text-tertiary);
}

.input--error {
    border-color: var(--error);
}

.input--success {
    border-color: var(--success);
}

.input-group__hint {
    font-size: var(--font-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
}

.input-group__error {
    font-size: var(--font-xs);
    color: var(--error);
    margin-top: var(--space-xs);
}

.input-group__icon {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.input-group--inline {
    display: flex;
    gap: var(--space-sm);
}

.input-group--inline .input {
    flex: 1;
}

/* --- Bottom Tab Bar --- */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--tab-bar-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: stretch;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.tab-bar__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.tab-bar__item.active {
    color: var(--primary-light);
}

.tab-bar__item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--primary);
    border-radius: 0 0 2px 2px;
}

.tab-bar__icon {
    width: 24px;
    height: 24px;
    transition: transform var(--transition-spring);
}

.tab-bar__item.active .tab-bar__icon {
    transform: scale(1.1);
}

.tab-bar__label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--space-2xl);
    padding-bottom: calc(var(--space-2xl) + var(--safe-bottom));
    transform: translateY(100%);
    transition: transform var(--transition-base);
    overflow-y: auto;
    position: relative;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal__handle {
    width: 36px;
    height: 4px;
    background: var(--text-tertiary);
    border-radius: var(--radius-full);
    margin: 0 auto var(--space-xl);
    opacity: 0.5;
}

.modal__title {
    font-size: var(--font-xl);
    font-weight: 700;
    margin-bottom: var(--space-lg);
}

.modal__close {
    position: absolute;
    top: var(--space-xl);
    right: var(--space-xl);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--bg-input);
    color: var(--text-secondary);
    transition: background var(--transition-fast);
}

.modal__close:active {
    background: var(--bg-tertiary);
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    left: var(--space-lg);
    right: var(--space-lg);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform var(--transition-spring), opacity var(--transition-base);
    pointer-events: auto;
}

.toast.visible {
    transform: translateY(0);
    opacity: 1;
}

.toast__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast--success { border-left: 3px solid var(--success); }
.toast--success .toast__icon { color: var(--success); }

.toast--error { border-left: 3px solid var(--error); }
.toast--error .toast__icon { color: var(--error); }

.toast--warning { border-left: 3px solid var(--warning); }
.toast--warning .toast__icon { color: var(--warning); }

.toast--info { border-left: 3px solid var(--info); }
.toast--info .toast__icon { color: var(--info); }

.toast__message {
    font-size: var(--font-sm);
    font-weight: 500;
    flex: 1;
}

/* --- Skeleton Loaders --- */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--bg-card-hover) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton--text {
    height: 14px;
    margin-bottom: var(--space-sm);
}

.skeleton--text-lg {
    height: 20px;
    margin-bottom: var(--space-sm);
}

.skeleton--title {
    height: 28px;
    width: 60%;
    margin-bottom: var(--space-md);
}

.skeleton--circle {
    border-radius: 50%;
}

.skeleton--card {
    height: 140px;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
}

.skeleton--avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton--btn {
    height: 44px;
    border-radius: var(--radius-md);
}

/* --- Circular Progress --- */
.circular-progress {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--cp-size, 110px);
    height: var(--cp-size, 110px);
    flex-shrink: 0;
}

.circular-progress__svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.circular-progress__track {
    fill: none;
    stroke: var(--bg-tertiary);
}

.circular-progress__fill {
    fill: none;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.circular-progress__text {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.circular-progress__value {
    font-size: clamp(15px, 4.8vw, var(--font-xl));
    font-weight: 800;
    line-height: 1;
}

.circular-progress__label {
    font-size: clamp(9px, 2.5vw, var(--font-xs));
    color: var(--text-secondary);
    margin-top: 2px;
}

/* --- Linear Progress Bar --- */
.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar__fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--primary-gradient);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-width: 6px;
}

.progress-bar__fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2));
    border-radius: inherit;
}

.progress-bar--accent .progress-bar__fill {
    background: var(--accent-gradient);
}

.progress-bar--warning .progress-bar__fill {
    background: linear-gradient(135deg, var(--warning) 0%, #FBBF24 100%);
}

.progress-bar--danger .progress-bar__fill {
    background: linear-gradient(135deg, var(--error) 0%, #F87171 100%);
}

/* --- Avatar --- */
.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--primary-gradient);
    color: #fff;
    font-weight: 700;
    font-size: var(--font-lg);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar--sm {
    width: 36px;
    height: 36px;
    font-size: var(--font-sm);
}

.avatar--lg {
    width: clamp(52px, 15.5vw, 64px);
    height: clamp(52px, 15.5vw, 64px);
    font-size: var(--font-2xl);
}

.avatar--xl {
    width: clamp(64px, 19.3vw, 80px);
    height: clamp(64px, 19.3vw, 80px);
    font-size: var(--font-3xl);
}

/* --- Stat Row --- */
.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
}

.stat-row + .stat-row {
    border-top: 1px solid var(--divider);
}

.stat-row__label {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.stat-row__value {
    font-weight: 600;
    font-size: var(--font-base);
}

/* --- Quick Actions Grid --- */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-sm);
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    transition: transform var(--transition-fast), background var(--transition-fast);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.quick-action:active {
    transform: scale(0.95);
    background: var(--bg-card-hover);
}

.quick-action__icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    background: rgba(108, 60, 225, 0.1);
}

.quick-action__label {
    font-size: var(--font-xs);
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

/* --- Tariff Card --- */
.tariff-card {
    position: relative;
    padding: var(--space-xl);
}

.tariff-card__badge {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
}

.tariff-card__name {
    font-size: var(--font-lg);
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.tariff-card__price {
    font-size: var(--font-3xl);
    font-weight: 800;
    color: var(--primary-light);
    margin-bottom: var(--space-lg);
    letter-spacing: -0.02em;
}

.tariff-card__price span {
    font-size: var(--font-base);
    font-weight: 500;
    color: var(--text-secondary);
}

.tariff-card__features {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.tariff-card__feature {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

.tariff-card__feature svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
    flex-shrink: 0;
}

.tariff-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary), var(--shadow-glow);
}

/* --- Device Card --- */
.device-card {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg);
}

.device-card__info {
    flex: 1;
    min-width: 0;
}

.device-card__name {
    font-weight: 600;
    font-size: var(--font-base);
    margin-bottom: 2px;
}

.device-card__hwid {
    font-size: var(--font-xs);
    color: var(--text-tertiary);
    font-family: 'SF Mono', 'Fira Code', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Transaction Item --- */
.transaction-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) 0;
}

.transaction-item + .transaction-item {
    border-top: 1px solid var(--divider);
}

.transaction-item__icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.transaction-item__info {
    flex: 1;
    min-width: 0;
}

.transaction-item__title {
    font-weight: 500;
    font-size: var(--font-sm);
}

.transaction-item__date {
    font-size: var(--font-xs);
    color: var(--text-tertiary);
    margin-top: 1px;
}

.transaction-item__amount {
    font-weight: 700;
    font-size: var(--font-base);
    white-space: nowrap;
}

.transaction-item__amount--positive {
    color: var(--success);
}

.transaction-item__amount--negative {
    color: var(--error);
}

/* --- Referral Item --- */
.referral-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) 0;
}

.referral-item + .referral-item {
    border-top: 1px solid var(--divider);
}

.referral-item__info {
    flex: 1;
    min-width: 0;
}

.referral-item__name {
    font-weight: 600;
    font-size: var(--font-base);
}

.referral-item__username {
    font-size: var(--font-xs);
    color: var(--text-tertiary);
}

.referral-item__income {
    font-weight: 700;
    color: var(--success);
    font-size: var(--font-sm);
}

/* --- Pill Tabs / Filter --- */
.pill-tabs {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.pill-tabs::-webkit-scrollbar {
    display: none;
}

.pill-tab {
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-full);
    font-size: var(--font-sm);
    font-weight: 500;
    white-space: nowrap;
    color: var(--text-secondary);
    background: var(--bg-input);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.pill-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pill-tab:active {
    transform: scale(0.96);
}

/* --- Radio / Checkbox cards --- */
.option-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.option-card + .option-card {
    margin-top: var(--space-sm);
}

.option-card.selected {
    border-color: var(--primary);
    background: rgba(108, 60, 225, 0.06);
}

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

.option-card__radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.option-card.selected .option-card__radio {
    border-color: var(--primary);
}

.option-card.selected .option-card__radio::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
}

.option-card__content {
    flex: 1;
    min-width: 0;
}

.option-card__title {
    font-weight: 600;
    font-size: var(--font-sm);
}

.option-card__desc {
    font-size: var(--font-xs);
    color: var(--text-tertiary);
    margin-top: 1px;
}

.option-card__price {
    font-weight: 700;
    font-size: var(--font-sm);
    color: var(--primary-light);
    white-space: nowrap;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: var(--space-4xl) var(--space-xl);
}

.empty-state__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-xl);
    color: var(--text-tertiary);
    opacity: 0.5;
}

.empty-state__title {
    font-size: var(--font-lg);
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.empty-state__text {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

/* --- Offline Banner --- */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: var(--space-sm) var(--space-lg);
    background: var(--error);
    color: #fff;
    font-size: var(--font-sm);
    font-weight: 600;
    text-align: center;
    z-index: 400;
    transform: translateY(-100%);
    transition: transform var(--transition-base);
}

.offline-banner.visible {
    transform: translateY(0);
}

/* --- Section Divider --- */
.section-title {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-md);
    margin-top: var(--space-2xl);
}

.section-title:first-child {
    margin-top: 0;
}

/* --- Price Summary --- */
.price-summary {
    padding: var(--space-lg);
    background: var(--bg-input);
    border-radius: var(--radius-md);
    margin-top: var(--space-lg);
}

.price-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xs) 0;
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

.price-summary__row--total {
    padding-top: var(--space-md);
    margin-top: var(--space-sm);
    border-top: 1px solid var(--divider);
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.price-summary__discount {
    color: var(--success);
}

/* --- Promo Code Input --- */
.promo-input {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

.promo-input .input {
    flex: 1;
}

.promo-input__status {
    font-size: var(--font-xs);
    margin-top: var(--space-xs);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.promo-input__status--valid {
    color: var(--success);
}

.promo-input__status--invalid {
    color: var(--error);
}

/* --- Subscription Link Copy --- */
.copy-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-input);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.copy-link:active {
    background: var(--bg-tertiary);
}

.copy-link__text {
    flex: 1;
    font-size: var(--font-sm);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.copy-link__icon {
    width: 20px;
    height: 20px;
    color: var(--primary-light);
    flex-shrink: 0;
}

/* --- Expandable Section (Addons) --- */
.expandable {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.expandable__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.expandable__header:active {
    background: var(--bg-card-hover);
}

.expandable__title {
    font-weight: 600;
    font-size: var(--font-base);
}

.expandable__chevron {
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    transition: transform var(--transition-base);
}

.expandable.open .expandable__chevron {
    transform: rotate(180deg);
}

.expandable__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
}

.expandable.open .expandable__body {
    max-height: 500px;
}

.expandable__content {
    padding: 0 var(--space-lg) var(--space-lg);
}

/* --- Balance Row (Dashboard) --- */
.balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.balance-row__info {
    min-width: 0;
    flex-shrink: 1;
}

.balance-row__amount {
    font-size: var(--font-2xl);
    font-weight: 700;
    margin-top: var(--space-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Subscription Traffic Row (Dashboard) --- */
.sub-traffic-row {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.sub-traffic-stats {
    flex: 1;
    min-width: 0;
}

/* --- Trial Card --- */
.trial-card {
    background: linear-gradient(135deg, rgba(0, 209, 178, 0.1) 0%, rgba(108, 60, 225, 0.1) 100%);
    border-color: rgba(0, 209, 178, 0.2);
}

.trial-card__icon {
    font-size: 32px;
    margin-bottom: var(--space-md);
}

/* --- Utilities --- */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.text-accent { color: var(--accent); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-sm { font-size: var(--font-sm); }
.text-xs { font-size: var(--font-xs); }
.text-lg { font-size: var(--font-lg); }
.text-xl { font-size: var(--font-xl); }
.text-2xl { font-size: var(--font-2xl); }

.text-center { text-align: center; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.w-full { width: 100%; }
.flex-1 { flex: 1; }
.min-w-0 { min-width: 0; }
.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hidden { display: none !important; }

.no-scrollbar {
    scrollbar-width: none;
}
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* --- Animations --- */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(108, 60, 225, 0.2); }
    50% { box-shadow: 0 0 40px rgba(108, 60, 225, 0.4); }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scale-in {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.animate-fade-in {
    animation: fade-in var(--transition-base) ease-out both;
}

.animate-slide-up {
    animation: slide-up var(--transition-slow) ease-out both;
}

.animate-scale-in {
    animation: scale-in var(--transition-base) ease-out both;
}

/* Staggered children animation */
.stagger-children > * {
    animation: fade-in var(--transition-base) ease-out both;
}

.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 50ms; }
.stagger-children > *:nth-child(3) { animation-delay: 100ms; }
.stagger-children > *:nth-child(4) { animation-delay: 150ms; }
.stagger-children > *:nth-child(5) { animation-delay: 200ms; }
.stagger-children > *:nth-child(6) { animation-delay: 250ms; }
.stagger-children > *:nth-child(7) { animation-delay: 300ms; }
.stagger-children > *:nth-child(8) { animation-delay: 350ms; }
.stagger-children > *:nth-child(9) { animation-delay: 400ms; }
.stagger-children > *:nth-child(10) { animation-delay: 450ms; }

/* --- Scrollbar styling --- */
::-webkit-scrollbar {
    width: 3px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

/* --- Selection color --- */
::selection {
    background: rgba(108, 60, 225, 0.3);
    color: var(--text-primary);
}

/* --- Safe area padding for notched devices --- */
@supports (padding-top: env(safe-area-inset-top)) {
    .page-view {
        padding-left: max(var(--space-lg), env(safe-area-inset-left));
        padding-right: max(var(--space-lg), env(safe-area-inset-right));
    }
}

/* ============================================================
   Responsive Design — Adaptive layout for all screen sizes
   Typography and spacing scale fluidly via clamp() in :root.
   Media queries below handle layout and component-level changes.
   ============================================================ */

/* --- Medium phones (375–413px) --- */
@media (max-width: 413px) {
    .sub-traffic-row {
        gap: var(--space-md);
    }

    .card {
        padding: var(--space-lg);
    }

    .card + .card {
        margin-top: var(--space-sm);
    }

    .card__header {
        margin-bottom: var(--space-md);
    }

    .card__footer {
        margin-top: var(--space-md);
        padding-top: var(--space-md);
    }

    .page-header {
        margin-bottom: var(--space-xl);
    }

    .page-header__title {
        font-size: var(--font-2xl);
    }

    .modal {
        padding: var(--space-xl);
        padding-bottom: calc(var(--space-xl) + var(--safe-bottom));
    }

    .modal__title {
        font-size: var(--font-lg);
    }

    .quick-actions {
        gap: var(--space-sm);
    }

    .quick-action {
        padding: var(--space-md) var(--space-xs);
    }

    .quick-action__icon {
        width: 36px;
        height: 36px;
    }

    .btn--lg {
        padding: var(--space-md) var(--space-xl);
        font-size: var(--font-base);
    }

    .tariff-card {
        padding: var(--space-lg);
    }

    .tariff-card__price {
        font-size: var(--font-2xl);
        margin-bottom: var(--space-md);
    }

    .price-summary {
        padding: var(--space-md);
    }

    .option-card {
        padding: var(--space-sm) var(--space-md);
    }

    .section-title {
        margin-top: var(--space-xl);
        margin-bottom: var(--space-sm);
    }

    .stat-row {
        padding: var(--space-sm) 0;
    }

    .stat-row__label {
        font-size: var(--font-xs);
    }

    .stat-row__value {
        font-size: var(--font-sm);
    }

    .empty-state {
        padding: var(--space-3xl) var(--space-lg);
    }

    .empty-state__icon {
        width: 52px;
        height: 52px;
    }

    .circular-progress {
        width: clamp(80px, 24vw, var(--cp-size, 110px));
        height: clamp(80px, 24vw, var(--cp-size, 110px));
    }

    .copy-link {
        padding: var(--space-sm) var(--space-md);
    }

    .copy-link__text {
        font-size: var(--font-xs);
    }

    .device-card {
        gap: var(--space-md);
        padding: var(--space-md);
    }

    .transaction-item {
        gap: var(--space-sm);
    }

    .transaction-item__icon {
        width: 36px;
        height: 36px;
    }

    .expandable__header {
        padding: var(--space-sm) var(--space-md);
    }

    .expandable__content {
        padding: 0 var(--space-md) var(--space-md);
    }

    .promo-input {
        margin-top: var(--space-md);
    }

    .input {
        padding: var(--space-sm) var(--space-md);
    }

    .tab-bar__label {
        font-size: 9px;
    }

    .tab-bar__icon {
        width: 22px;
        height: 22px;
    }

    .loading-screen__logo {
        width: 60px;
        height: 60px;
    }

    .loading-screen__logo svg {
        width: 30px;
        height: 30px;
    }
}

/* --- Small phones (≤ 374px, e.g. iPhone SE) --- */
@media (max-width: 374px) {
    .page-view {
        padding: var(--space-xl) var(--space-md) calc(var(--tab-bar-height) + var(--safe-bottom) + var(--space-2xl));
    }

    .card {
        padding: var(--space-md);
    }

    .modal {
        padding: var(--space-lg);
        padding-bottom: calc(var(--space-lg) + var(--safe-bottom));
    }

    .modal__handle {
        margin-bottom: var(--space-md);
    }

    .btn {
        padding: var(--space-sm) var(--space-lg);
    }

    .btn--lg {
        padding: var(--space-md) var(--space-lg);
    }

    .btn--sm {
        padding: 6px 10px;
        font-size: var(--font-xs);
    }

    .btn--icon {
        width: 36px;
        height: 36px;
    }

    .quick-action__icon {
        width: 32px;
        height: 32px;
    }

    .card__icon {
        width: 36px;
        height: 36px;
    }

    .tab-bar__label {
        font-size: 9px;
        letter-spacing: 0;
    }

    .tab-bar__icon {
        width: 20px;
        height: 20px;
    }

    .tab-bar__item.active::before {
        width: 20px;
    }

    .badge {
        padding: 2px 8px;
        font-size: 9px;
    }

    .badge__dot {
        width: 5px;
        height: 5px;
    }

    .pill-tab {
        padding: 6px var(--space-md);
        font-size: var(--font-xs);
    }

    .referral-item {
        gap: var(--space-sm);
    }

    .avatar--sm {
        width: 32px;
        height: 32px;
    }

    .tariff-card__features {
        gap: var(--space-xs);
    }

    .price-summary__row {
        font-size: var(--font-xs);
    }
}

/* --- Very small phones (≤ 359px) --- */
@media (max-width: 359px) {
    .sub-traffic-row {
        gap: var(--space-sm);
    }

    .page-view {
        padding: var(--space-lg) var(--space-sm) calc(var(--tab-bar-height) + var(--safe-bottom) + var(--space-xl));
    }

    .card {
        padding: 10px;
        border-radius: var(--radius-md);
    }

    .modal {
        padding: var(--space-md);
        padding-bottom: calc(var(--space-md) + var(--safe-bottom));
    }

    .quick-actions {
        gap: var(--space-xs);
    }

    .quick-action {
        padding: var(--space-sm) var(--space-xs);
        border-radius: var(--radius-md);
    }

    .quick-action__label {
        font-size: 9px;
    }

    .circular-progress {
        width: clamp(72px, 22vw, var(--cp-size, 110px));
        height: clamp(72px, 22vw, var(--cp-size, 110px));
    }

    .circular-progress__value {
        font-size: var(--font-base);
    }

    .circular-progress__label {
        font-size: 8px;
    }

    .stat-row__label {
        gap: var(--space-xs);
    }

    .toast {
        padding: var(--space-sm) var(--space-md);
        gap: var(--space-sm);
    }

    .toast__message {
        font-size: var(--font-xs);
    }
}

/* --- Larger screens / tablets (≥ 480px) --- */
@media (min-width: 480px) {
    .page-view {
        max-width: 480px;
        margin-left: auto;
        margin-right: auto;
        padding-left: var(--space-xl);
        padding-right: var(--space-xl);
    }

    .tab-bar {
        max-width: 480px;
        margin: 0 auto;
        left: 50%;
        transform: translateX(-50%);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .modal {
        max-width: 420px;
        border-radius: var(--radius-xl);
        margin-bottom: var(--space-xl);
    }

    .toast-container {
        max-width: 420px;
        margin: 0 auto;
    }
}
