/* ═══════════════════════════════════════════
   FadeLink Dashboard — Dark Cyberlux Theme
   ═══════════════════════════════════════════ */

:root {
    --bg-deep: #0a0a0f;
    --bg-base: #0f1018;
    --bg-surface: #161824;
    --bg-elevated: #1c1f30;
    --bg-hover: #232640;

    --border: #242840;
    --border-subtle: #1a1d30;

    --text-primary: #e8eaf0;
    --text-secondary: #8b8fa8;
    --text-muted: #555978;

    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --accent-glow: rgba(108, 92, 231, 0.25);

    --green: #00d2a0;
    --green-glow: rgba(0, 210, 160, 0.15);
    --red: #ff6b6b;
    --yellow: #ffd93d;

    --font-body: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 240px;
    --topbar-height: 60px;
}

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

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    max-width: 100%;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════
   BUTTONS & INPUTS
   ═══════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 16px var(--accent-glow);
}
.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 24px var(--accent-glow);
}
.btn-primary:active { transform: translateY(0); }

.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, #845ef7 100%);
    color: #fff;
    box-shadow: 0 2px 20px var(--accent-glow);
}
.btn-accent:hover {
    box-shadow: 0 4px 30px rgba(108, 92, 231, 0.4);
    transform: translateY(-1px);
}

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

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 11px 14px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    background: var(--bg-base);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: all var(--transition);
}
input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
input::placeholder { color: var(--text-muted); }

.input-mono {
    font-family: var(--font-mono) !important;
    letter-spacing: 0.05em;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.input-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ─── Password Toggle ─── */
.password-wrapper {
    position: relative;
    width: 100%;
}
.password-wrapper input {
    padding-right: 48px;
}
.password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition);
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.password-toggle:hover { color: var(--text-secondary); }
.password-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}
.password-wrapper input:focus ~ .password-toggle {
    color: var(--accent-light);
}
.eye-icon { pointer-events: none; flex-shrink: 0; }

/* ═══════════════════════
   AUTH SCREEN
   ═══════════════════════ */

.screen { min-height: 100vh; }

.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 16px;
    position: relative;
    overflow: hidden;
}

.auth-back {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
    z-index: 10;
}
.auth-back:hover { color: var(--text-primary); }
.auth-back svg { flex-shrink: 0; }

.auth-brand {
    text-align: center;
    margin-bottom: 24px;
    animation: fadeSlideUp 0.6s ease-out;
}

.brand-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    animation: pulseGlow 3s ease-in-out infinite;
}
.brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-name {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px 20px;
    position: relative;
    animation: fadeSlideUp 0.6s ease-out 0.1s both;
}

.auth-tabs {
    display: flex;
    position: relative;
    margin-bottom: 28px;
    background: var(--bg-base);
    border-radius: var(--radius);
    padding: 3px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    z-index: 1;
}
.auth-tab.active { color: var(--text-primary); }

.auth-tab-indicator {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    transition: transform var(--transition);
}
.auth-tab[data-tab="register"].active ~ .auth-tab-indicator {
    transform: translateX(100%);
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 16px;
}
.auth-form.active { display: flex; }

/* ─── Consent Checkbox ─── */
.consent-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
    -webkit-tap-highlight-color: transparent;
}
.consent-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin-top: 1px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background: var(--bg-base);
    cursor: pointer;
    transition: all var(--transition);
}
.consent-check input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}
.consent-check input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.consent-check a {
    color: var(--accent-light);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.consent-check a:hover {
    color: var(--text-primary);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.auth-tg-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.btn-tg {
    background: #2AABEE;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    transition: background 0.2s;
}
.btn-tg:hover { background: #229ED9; }
.tg-deeplink-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 14px;
}
.tg-deeplink-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: tg-spin 0.8s linear infinite;
}
@keyframes tg-spin {
    to { transform: rotate(360deg); }
}
.tg-deeplink-expired {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 14px;
}
.tg-help-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.visible { display: flex; }
.modal-card {
    background: var(--bg-elevated);
    border: none;
    border-radius: 16px;
    padding: 28px;
    max-width: 400px;
    width: 100%;
    position: relative;
    animation: modalIn 0.2s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}
.modal-body p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.modal-body p:last-child { margin-bottom: 0; }

.auth-error {
    display: none;
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: var(--radius);
    color: var(--red);
    font-size: 0.85rem;
}
.auth-error.visible { display: block; }

/* ─── Forgot Password ─── */
.forgot-password-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -4px;
}
.forgot-link {
    font-size: 0.82rem;
    color: var(--accent-light);
    text-decoration: none;
    transition: color var(--transition);
    padding: 2px 0;
}
.forgot-link:hover { color: var(--text-primary); }

.forgot-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.forgot-back-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}
.forgot-back-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
    background: var(--bg-elevated);
}
.forgot-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}
.forgot-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.forgot-sent {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    padding: 12px 0 4px;
    animation: fadeSlideUp 0.4s ease-out;
}
.forgot-sent-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(0, 210, 160, 0.1);
    border: 1px solid rgba(0, 210, 160, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.forgot-sent-icon svg {
    width: 26px;
    height: 26px;
    stroke: var(--green);
    stroke-width: 2;
    fill: none;
}
.forgot-sent-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}
.forgot-sent-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.55;
    max-width: 300px;
}

/* ─── Reset Page Results ─── */
.reset-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    padding: 12px 0 4px;
    animation: fadeSlideUp 0.4s ease-out;
}
.reset-result-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.reset-result-icon--success {
    background: rgba(0, 210, 160, 0.1);
    border: 1px solid rgba(0, 210, 160, 0.2);
}
.reset-result-icon--success svg { stroke: var(--green); }
.reset-result-icon--error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
}
.reset-result-icon--error svg { stroke: var(--red); }
.reset-result-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 2;
    fill: none;
}
.reset-result-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}
.reset-result-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.55;
    max-width: 300px;
}

/* Auth decorative grid lines */
.auth-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.grid-line {
    position: absolute;
    background: linear-gradient(180deg, transparent, var(--accent-glow), transparent);
    opacity: 0.3;
}
.gl-1 { left: 15%; width: 1px; height: 100%; animation: gridPulse 4s ease-in-out infinite; }
.gl-2 { left: 50%; width: 1px; height: 100%; animation: gridPulse 4s ease-in-out 1.5s infinite; }
.gl-3 { left: 85%; width: 1px; height: 100%; animation: gridPulse 4s ease-in-out 3s infinite; }

/* ═══════════════════════
   DASHBOARD LAYOUT
   ═══════════════════════ */

#dashboard-screen {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--topbar-height) 1fr;
    grid-template-areas:
        "topbar topbar"
        "sidebar content";
    min-height: 100vh;
}

.topbar {
    grid-area: topbar;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 10;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-light);
    font-weight: 600;
    font-size: 1.05rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar-user span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 20px 12px;
    background: var(--bg-base);
    border-right: 1px solid var(--border-subtle);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
}
.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent-light);
    font-weight: 500;
}
.nav-item.active svg { color: var(--accent); }

.content {
    grid-area: content;
    padding: 32px;
    overflow-y: auto;
    max-height: calc(100vh - var(--topbar-height));
}
.content.no-scroll {
    overflow: hidden;
}

/* ═══════════════════════
   TAB PANELS
   ═══════════════════════ */

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease-out;
}
.tab-panel.active { display: block; }

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}
.panel-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.status-badge.active {
    background: var(--green-glow);
    color: var(--green);
    box-shadow: 0 0 12px var(--green-glow);
}
.status-badge.active::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--green);
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}
.status-badge.offline {
    background: rgba(85, 89, 120, 0.15);
    color: var(--text-muted);
}

/* Stat grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.stat-value {
    font-size: 1.3rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

/* Section blocks */
.section-block {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}
.section-block h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Referral link cards */
.ref-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 12px;
}
.ref-card-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 18px 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}
.ref-card-url {
    padding: 6px 18px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
    word-break: break-all;
}
.ref-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--border-subtle);
}
.ref-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
    min-height: 44px;
    background: none;
    border: none;
    color: var(--accent-light);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.ref-card-btn:first-child {
    border-right: 1px solid var(--border-subtle);
}
.ref-card-btn:hover {
    background: var(--accent-glow);
}
.ref-card-btn:active {
    background: rgba(108, 92, 231, 0.15);
}

.copy-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.copy-value {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.happ-btn {
    margin-top: 12px;
    text-decoration: none;
}

/* ─── App download hint (inline) ─── */
.app-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin-top: 12px;
    border-radius: var(--radius);
    border: 1px dashed var(--border-subtle);
    background: transparent;
}
.app-hint-icon {
    flex-shrink: 0;
    color: var(--text-muted);
}
.app-hint-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.app-hint-text a {
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 500;
}
.app-hint-text a:hover {
    text-decoration: underline;
}

/* ─── Subscribe CTA (VPN tab) ─── */
.subscribe-cta-dash {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    margin: 16px 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--accent);
    background: var(--bg-surface);
    cursor: pointer;
    transition: border-color 0.25s, background 0.25s, transform 0.15s;
    position: relative;
    overflow: hidden;
}
.subscribe-cta-dash:hover {
    border-color: var(--accent);
    background: var(--bg-elevated);
}
.subscribe-cta-dash:active {
    transform: scale(0.98);
}
.subscribe-cta-dash-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.subscribe-cta-dash-icon svg {
    width: 18px;
    height: 18px;
    color: #fff;
}
.subscribe-cta-dash-body {
    flex: 1;
    min-width: 0;
}
.subscribe-cta-dash-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}
.subscribe-cta-dash-hint {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}
.subscribe-cta-dash-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.2s, color 0.2s;
}
.subscribe-cta-dash:hover .subscribe-cta-dash-arrow {
    color: var(--accent-light);
    transform: translateX(2px);
}

/* Shimmer for trial */
.subscribe-cta-dash.cta-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(105deg, transparent 30%, rgba(108,92,231,0.08) 50%, transparent 70%);
    animation: cta-dash-shimmer 3s ease-in-out infinite;
    pointer-events: none;
}
@keyframes cta-dash-shimmer {
    0%, 100% { left: -100%; }
    50% { left: 140%; }
}

/* Warning state */
.subscribe-cta-dash.cta-warning {
    border-left-color: var(--yellow);
}
.subscribe-cta-dash.cta-warning .subscribe-cta-dash-icon {
    background: linear-gradient(135deg, var(--yellow), #F97316);
}

.inline-form {
    display: flex;
    gap: 10px;
}
.inline-form input { flex: 1; }

/* ─── Devices ─── */
.devices-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.device-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.device-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.device-name {
    font-size: 0.9rem;
    font-weight: 500;
}
.device-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ─── Device Selector Card ─── */
.device-slider {
    margin-bottom: 24px;
}

.ds-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.ds-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ds-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ds-num {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-base);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}

.ds-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ds-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ds-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.ds-badge {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 5px 12px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--green);
    white-space: nowrap;
}

/* Slider track */
.ds-track {
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    touch-action: none;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.ds-rail {
    position: absolute;
    left: 8px;
    right: 8px;
    height: 4px;
    background: var(--bg-base);
    border-radius: 2px;
}

.ds-fill {
    position: absolute;
    left: 8px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ds-dots {
    position: relative;
    display: flex;
    justify-content: space-between;
    width: 100%;
    z-index: 1;
}

.ds-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--bg-base);
    background: var(--bg-base);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.ds-dot::before {
    content: '';
    position: absolute;
    inset: -8px;
}

.ds-dot:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.ds-dot.passed {
    background: var(--accent);
    border-color: transparent;
}

.ds-dot.active {
    width: 20px;
    height: 20px;
    margin: -2px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border: 3px solid var(--bg-deep);
    box-shadow: 0 0 12px var(--accent-glow), 0 0 24px rgba(108, 92, 231, 0.15);
}

/* Nudge hint — tuk-tuk pattern to attract attention before first interaction */
@keyframes ds-dot-nudge {
    0%              { transform: translateX(0); }
    1.7%            { transform: translateX(6px); }
    3.3%            { transform: translateX(-1px); }
    5%, 5.8%        { transform: translateX(0); }
    7.5%            { transform: translateX(5px); }
    9.2%            { transform: translateX(-1px); }
    10.8%, 19.2%    { transform: translateX(0); }
    20.8%           { transform: translateX(6px); }
    22.5%           { transform: translateX(-1px); }
    24.2%, 25%      { transform: translateX(0); }
    26.7%           { transform: translateX(5px); }
    28.3%           { transform: translateX(-1px); }
    30%, 100%       { transform: translateX(0); }
}
.ds-dot.active.nudge-hint {
    animation: ds-dot-nudge 6s linear infinite;
}

/* ─── Plans Matrix Grid ─── */
.plans-grid-matrix {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.period-card {
    position: relative;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 18px 16px;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.period-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-2px);
}

.period-card.selected {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(132, 94, 247, 0.04));
    box-shadow: 0 0 0 1px rgba(108, 92, 231, 0.25), 0 4px 24px var(--accent-glow);
}

.period-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.period-card-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.period-card.selected .period-card-label {
    color: var(--text-primary);
}

.period-card-star {
    font-size: 16px;
    line-height: 1;
}

.period-card-price {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.period-card-price .rub {
    font-size: 1.1rem;
    font-weight: 600;
}

.period-card-monthly {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: auto;
}

.period-card-old {
    text-decoration: line-through;
    color: var(--red, #ff6b6b);
    opacity: 0.7;
    margin-right: 3px;
}

.period-card-per-month {
    color: var(--green, #00d2a0);
    font-weight: 700;
}

.period-card-head-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.period-card-discount {
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(0, 210, 160, 0.12);
    color: var(--green, #00d2a0);
    letter-spacing: 0.3px;
    line-height: 1.4;
}

.period-card.best-deal {
    border-color: rgba(0, 210, 160, 0.3);
}
.period-card.best-deal:not(.selected) {
    box-shadow: 0 0 0 1px rgba(0, 210, 160, 0.1), 0 4px 16px rgba(0, 210, 160, 0.06);
}
.period-card.best-deal.selected {
    border-color: var(--green, #00d2a0);
    background: linear-gradient(135deg, rgba(0, 210, 160, 0.08), rgba(59, 130, 246, 0.05));
    box-shadow: 0 0 0 1px rgba(0, 210, 160, 0.3), 0 4px 20px rgba(0, 210, 160, 0.12);
}

/* ─── Tariff CTA Button ─── */
.tariff-cta-dash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 24px;
    margin-top: 20px;
    border: none;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent) 0%, #845ef7 100%);
    color: #fff;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 24px var(--accent-glow);
}

.tariff-cta-dash:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 32px rgba(108, 92, 231, 0.4);
}

.tariff-cta-dash:active {
    transform: translateY(0);
}

.tariff-cta-dash:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.tariff-cta-dash-label {
    font-size: 0.95rem;
    font-weight: 600;
}

.tariff-cta-dash-prices {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tariff-cta-dash-price {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
}

.tariff-cta-dash-old {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: line-through;
    opacity: 0.5;
}

.tariff-cta-dash.loading {
    opacity: 0.7;
    pointer-events: none;
}

.tariff-cta-dash.loading .tariff-cta-dash-label::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cta-spin 0.6s linear infinite;
    vertical-align: middle;
}

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

/* ─── Telegram Prompt ─── */
.tg-prompt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.08) 0%, rgba(42, 171, 238, 0.06) 100%);
    border: 1px solid rgba(108, 92, 231, 0.18);
    border-radius: var(--radius-lg);
    animation: fadeSlideUp 0.4s ease-out;
}
.tg-prompt-content {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.tg-prompt-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(42, 171, 238, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #2AABEE;
}
.tg-prompt-text strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
}
.tg-prompt-text p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}
#tg-prompt-default,
#tg-prompt-waiting,
#tg-prompt-expired {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}
.tg-prompt-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .tg-prompt {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .tg-prompt-actions {
        justify-content: stretch;
    }
    .tg-prompt-actions .btn {
        flex: 1;
        justify-content: center;
    }
}

/* ─── Trial ─── */
.trial-section { margin-top: 20px; }
.trial-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.08) 0%, rgba(132, 94, 247, 0.05) 100%);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: var(--radius-lg);
    gap: 20px;
}
.trial-text h3 {
    font-size: 1.05rem;
    margin-bottom: 4px;
}
.trial-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ─── Referrals ─── */
.referral-hero {
    padding: 20px 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}
.referral-hero p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ─── Balance ─── */
.balance-amount {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent-light);
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tx-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
}
.tx-info { display: flex; flex-direction: column; gap: 2px; }
.tx-desc { font-size: 0.88rem; }
.tx-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.tx-amount {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
}
.tx-amount.positive { color: var(--green); }
.tx-amount.negative { color: var(--red); }

/* ─── Settings ─── */
.settings-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}
.settings-section h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.settings-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.tg-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
}
.tg-status-badge.linked {
    background: var(--green-glow);
    color: var(--green);
}

.tg-status {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tg-status span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ─── Telegram Link States ─── */
.tg-link-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 12px;
}
.tg-link-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: tg-spin 0.8s linear infinite;
    flex-shrink: 0;
}
.tg-link-expired {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
}
.info-row:last-child { border-bottom: none; }
.info-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.info-value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ─── PWA Install Steps ─── */
.pwa-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pwa-step {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pwa-step-num {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    color: var(--accent-light);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50%;
    flex-shrink: 0;
}
.pwa-step-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.pwa-step-text strong {
    color: var(--text-primary);
}
.pwa-guide-note {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
}
.settings-form-actions {
    display: flex;
    gap: 8px;
}

/* ─── Empty state ─── */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}
.empty-state.small { padding: 32px 20px; }
.empty-icon {
    color: var(--text-muted);
    opacity: 0.4;
    margin-bottom: 16px;
}
.empty-state p { margin-bottom: 20px; }

/* Skeleton */
.skeleton-card {
    height: 240px;
    background: linear-gradient(110deg, var(--bg-surface) 0%, var(--bg-elevated) 50%, var(--bg-surface) 100%);
    background-size: 200% 100%;
    border-radius: var(--radius-lg);
    animation: shimmer 1.5s ease-in-out infinite;
}

/* ─── Toast ─── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.88rem;
    z-index: 9999;
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.3s ease-out;
    pointer-events: none;
}
.toast.visible {
    transform: translateY(0);
    opacity: 1;
}
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }

/* ─── Device Popup QR ─── */
.dash-device-overlay .modal-card {
    max-width: 420px;
}
.dash-device-card {
    text-align: center;
}
.dash-device-qr {
    display: inline-block;
    padding: 12px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 16px;
}
.dash-device-qr svg {
    display: block;
    width: 100%;
    height: auto;
    max-width: 200px;
    max-height: 200px;
}
.dash-device-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Copy field with inline icon */
.copy-field {
    position: relative;
    width: 100%;
}
.copy-field code {
    display: block;
    width: 100%;
    padding: 11px 44px 11px 14px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: border-color var(--transition);
}
.copy-field code:hover {
    border-color: var(--accent);
}
.copy-field-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition);
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.copy-field-btn:hover { color: var(--accent-light); }
.copy-field-btn.copied { color: var(--green); }

/* ─── TV Help button & popup ─── */
.device-btn-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.device-btn-row .btn { flex: 1; }

.tv-help-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px 6px 8px;
    border-radius: 100px;
    border: 1px solid rgba(108, 92, 231, 0.2);
    background: rgba(108, 92, 231, 0.08);
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}
.tv-help-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.tv-help-btn:hover {
    background: rgba(108, 92, 231, 0.15);
    border-color: rgba(108, 92, 231, 0.35);
    color: var(--text-secondary);
    box-shadow: 0 0 12px rgba(108, 92, 231, 0.15);
}
.tv-help-btn:active {
    background: rgba(108, 92, 231, 0.22);
    border-color: rgba(108, 92, 231, 0.5);
    color: var(--text-primary);
    transform: scale(0.96);
}

.tv-help-card { text-align: left; max-width: 380px; }
.tv-help-back {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-family: var(--font-body);
    cursor: pointer;
    padding: 0;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.tv-help-back:hover { color: var(--text-primary); }
.tv-help-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 12px; }
.tv-help-steps { list-style: none; padding: 0; margin: 0 0 16px; }
.tv-help-steps li {
    padding: 8px 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-primary);
    display: flex;
    gap: 10px;
}
.tv-help-steps .step-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tv-help-note {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    border-top: 1px solid var(--border-subtle);
    padding-top: 12px;
}

/* ═══════════════════════
   WIZARD MODAL (Timeline)
   ═══════════════════════ */

.dwiz-overlay {
    align-items: center;
    justify-content: center;
}

.dwiz-overlay .modal-card {
    max-width: 460px;
    width: 100%;
    padding: 0;
    overflow: hidden;
    max-height: 90vh;
}

.dwiz-overlay .dwiz-card {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 36px 32px 32px;
    padding-top: 52px;
}

.dwiz-close {
    z-index: 2;
}

/* Header */
.dwiz-header {
    text-align: center;
    margin-bottom: 24px;
}

.dwiz-header-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
}

.dwiz-header-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Timeline */
.dwiz-timeline {
    display: flex;
    flex-direction: column;
}

.dwiz-timeline-step {
    display: flex;
    gap: 12px;
    opacity: 0;
    transform: translateY(12px);
    animation: dwizAppear 0.4s ease forwards;
}

.dwiz-timeline-step:nth-child(1) { animation-delay: 0.05s; }
.dwiz-timeline-step:nth-child(2) { animation-delay: 0.12s; }
.dwiz-timeline-step:nth-child(3) { animation-delay: 0.19s; }
.dwiz-timeline-step:nth-child(4) { animation-delay: 0.28s; }

@keyframes dwizAppear {
    to { opacity: 1; transform: translateY(0); }
}

.dwiz-timeline-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 36px;
}

.dwiz-timeline-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1.5px solid rgba(108, 92, 231, 0.3);
    background: rgba(108, 92, 231, 0.08);
}

.dwiz-timeline-icon--success {
    border-color: rgba(0, 210, 160, 0.3);
    background: rgba(0, 210, 160, 0.08);
}

.dwiz-timeline-icon--warning {
    border-color: rgba(255, 217, 61, 0.3);
    background: rgba(255, 217, 61, 0.08);
}

.dwiz-timeline-line {
    width: 2px;
    flex: 1;
    min-height: 12px;
    background: var(--border);
    border-radius: 1px;
}

.dwiz-timeline-line--accent {
    background: rgba(108, 92, 231, 0.3);
}

.dwiz-timeline-content {
    flex: 1;
    padding-bottom: 16px;
    min-width: 0;
}

.dwiz-timeline-step:last-child .dwiz-timeline-content {
    padding-bottom: 0;
}

.dwiz-timeline-step:last-child .dwiz-timeline-line {
    display: none;
}

.dwiz-timeline-step-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 1px;
}

.dwiz-timeline-step-title {
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 3px;
}

.dwiz-timeline-step-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 10px;
}

.dwiz-timeline-content .btn {
    width: 100%;
    padding: 10px 18px;
    font-size: 0.85rem;
}

.dwiz-timeline-content .btn-ghost {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

/* Telegram linked badge */
.dwiz-tg-success {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    width: 100%;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--green);
    background: rgba(0, 210, 160, 0.08);
    border: 1px solid rgba(0, 210, 160, 0.25);
    border-radius: var(--radius);
    justify-content: center;
}

/* Finish button — no animation by default */
.dwiz-btn-finish {
    animation: none !important;
}
.dwiz-btn-finish--ready {
    background: var(--green) !important;
    animation: dwizFinishPulse 2s ease-in-out 3 !important;
}
@keyframes dwizFinishPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 210, 160, 0); }
    50% { box-shadow: 0 0 0 8px rgba(0, 210, 160, 0.25); }
}

/* Blink attention on step 2 button */
.dwiz-blink {
    animation: dwizBlink 0.4s ease-in-out 3 !important;
}
@keyframes dwizBlink {
    0%, 100% { box-shadow: 0 0 0 0 rgba(108, 92, 231, 0); }
    50% { box-shadow: 0 0 0 6px rgba(108, 92, 231, 0.4); }
}

/* ── Email Verification Step ──────── */
.dwiz-verify-email {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--accent-light);
    margin-bottom: 4px;
    word-break: break-all;
}
.dwiz-verify-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.4;
    transition: opacity 0.5s ease;
}
.dwiz-verify-hint--hidden {
    opacity: 0;
}
.dwiz-code-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    justify-content: flex-start;
}
.dwiz-code-digit {
    width: 48px;
    height: 56px;
    border-radius: 10px;
    border: 1.5px solid rgba(108, 92, 231, 0.25);
    background: rgba(108, 92, 231, 0.06);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    outline: none;
    caret-color: var(--accent);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}
.dwiz-code-digit::placeholder { color: rgba(108, 92, 231, 0.2); font-weight: 400; }
.dwiz-code-digit:focus {
    border-color: var(--accent);
    background: rgba(108, 92, 231, 0.1);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
}
.dwiz-code-digit--error {
    border-color: #e74c3c !important;
    background: rgba(231, 76, 60, 0.08) !important;
    animation: dwizShake 0.4s ease;
}
.dwiz-code-digit--success {
    border-color: var(--green) !important;
    background: rgba(0, 210, 160, 0.08) !important;
}
@keyframes dwizShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}
@media (max-width: 380px) {
    .dwiz-code-digit { width: 42px; height: 50px; font-size: 1.25rem; }
    .dwiz-code-input-row { gap: 6px; }
}
.dwiz-verify-btn {
    width: 100%;
    padding: 12px 18px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    background: var(--accent);
    color: #fff;
}
.dwiz-verify-btn:hover { background: #7d6ff0; box-shadow: 0 4px 16px rgba(108, 92, 231, 0.3); }
.dwiz-verify-btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.dwiz-verify-btn:disabled:hover { background: var(--accent); }
.dwiz-verify-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    gap: 8px;
    flex-wrap: wrap;
}
.dwiz-verify-link {
    font-size: 0.78rem;
    color: var(--text-primary);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    padding: 4px 0;
    transition: color 0.2s;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
}
.dwiz-verify-link:hover { color: var(--accent-light); }
.dwiz-verify-link--disabled { pointer-events: none; opacity: 0.55; }
.dwiz-verify-cooldown { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); margin-left: 4px; }
.dwiz-verify-error {
    font-size: 0.78rem;
    color: #e74c3c;
    margin-top: 8px;
}
.dwiz-change-email-input {
    width: 100%;
    padding: 12px 14px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid rgba(108, 92, 231, 0.2);
    background: rgba(108, 92, 231, 0.06);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 44px;
    margin-bottom: 12px;
}
.dwiz-change-email-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12); }
.dwiz-change-email-input::placeholder { color: var(--text-muted); }
.dwiz-change-email-back {
    font-size: 0.78rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    padding: 4px 0;
    margin-top: 8px;
    transition: color 0.2s;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.dwiz-change-email-back:hover { color: var(--accent-light); }
.dwiz-verified-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: rgba(0, 210, 160, 0.06);
    border: 1px solid rgba(0, 210, 160, 0.18);
}
.dwiz-verified-badge svg { width: 16px; height: 16px; stroke: var(--green); stroke-width: 2.5; fill: none; flex-shrink: 0; }
.dwiz-verified-badge span { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; color: var(--green); }
.dwiz-timeline-step--locked { pointer-events: none; }
.dwiz-timeline-step--locked .dwiz-timeline-content { opacity: 0.3; }
.dwiz-timeline-step--locked .dwiz-timeline-icon { opacity: 0.35; border-color: rgba(108, 92, 231, 0.12); background: rgba(108, 92, 231, 0.04); }
.dwiz-timeline-step--locked .dwiz-timeline-line { opacity: 0.25; }
.dwiz-lock-icon { width: 12px; height: 12px; stroke: var(--text-muted); stroke-width: 2; fill: none; opacity: 0.7; }

/* ═══════════════════════
   WELCOME MODAL (post-wizard)
   ═══════════════════════ */

.wlcm-overlay {
    align-items: center;
    justify-content: center;
}

.wlcm-card {
    max-width: 500px !important;
    width: 100%;
    padding: 0 !important;
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* Hero */
.wlcm-hero {
    padding: 28px 28px 20px;
    text-align: center;
    background: linear-gradient(165deg, rgba(108, 92, 231, 0.15) 0%, rgba(0, 210, 160, 0.06) 100%);
    border-bottom: 1px solid var(--border-subtle);
}

.wlcm-hero-emoji {
    display: block;
    font-size: 2.2rem;
    margin-bottom: 8px;
    line-height: 1;
}

.wlcm-hero-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.wlcm-hero-sub {
    font-size: 0.82rem;
    color: var(--accent-light);
    font-weight: 500;
}

/* Scrollable body */
.wlcm-body {
    padding: 20px 28px 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.wlcm-intro {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Copyable link pill */
.wlcm-link-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(108, 92, 231, 0.12);
    border: 1px solid rgba(108, 92, 231, 0.3);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--accent-light);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 20px;
}

.wlcm-link-pill:hover {
    background: rgba(108, 92, 231, 0.2);
    border-color: var(--accent);
}

.wlcm-link-pill--copied {
    background: rgba(0, 210, 160, 0.12) !important;
    border-color: rgba(0, 210, 160, 0.3) !important;
    color: var(--green) !important;
}

/* Sections */
.wlcm-section {
    margin-bottom: 18px;
}

.wlcm-section-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wlcm-section-icon {
    font-size: 1rem;
}

.wlcm-badge-time {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
    background: rgba(255, 217, 61, 0.12);
    color: var(--yellow);
    margin-left: 6px;
}

/* Feature list */
.wlcm-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wlcm-list li {
    font-size: 0.84rem;
    color: var(--text-secondary);
    padding: 5px 0 5px 18px;
    position: relative;
    line-height: 1.45;
}

.wlcm-list li::before {
    content: '•';
    position: absolute;
    left: 2px;
    color: var(--accent-light);
    font-weight: 700;
}

/* Checklist */
.wlcm-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wlcm-checklist li {
    font-size: 0.84rem;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: rgba(0, 210, 160, 0.04);
    border: 1px solid rgba(0, 210, 160, 0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.wlcm-check {
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Action section highlight */
.wlcm-section--action {
    padding: 14px 16px;
    background: rgba(255, 217, 61, 0.03);
    border: 1px solid rgba(255, 217, 61, 0.1);
    border-radius: var(--radius);
}

.wlcm-section--action .wlcm-section-title {
    margin-bottom: 12px;
}

.wlcm-thanks {
    font-size: 0.84rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 14px;
    margin-bottom: 4px;
}

/* Sticky footer */
.wlcm-footer {
    padding: 16px 28px 24px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}

/* Mobile */
@media (max-width: 600px) {
    .wlcm-card {
        max-height: 94vh;
        border-radius: 20px 20px 0 0 !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100% !important;
        animation: wlcmSlideUp 0.3s ease forwards;
    }

    .wlcm-hero { padding: 20px 20px 16px; }
    .wlcm-body { padding: 16px 20px 8px; }
    .wlcm-footer { padding: 12px 20px 20px; }
}

@keyframes wlcmSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ═══════════════════════
   ANIMATIONS
   ═══════════════════════ */

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes pulseGlow {
    0%, 100% { filter: drop-shadow(0 0 4px var(--accent-glow)); }
    50% { filter: drop-shadow(0 0 16px var(--accent-glow)); }
}
@keyframes gridPulse {
    0%, 100% { opacity: 0.05; }
    50% { opacity: 0.25; }
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ═══════════════════════
   RESPONSIVE
   ═══════════════════════ */

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    /* Prevent iOS auto-zoom on input focus */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    select, textarea {
        font-size: 16px;
    }

    /* Wizard as bottom-sheet on mobile */
    .dwiz-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .dwiz-overlay .modal-card {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 90vh;
        animation: dwizSlideUp 0.3s ease;
    }
    @keyframes dwizSlideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    .dwiz-overlay .dwiz-card {
        padding: 28px 24px 28px;
        padding-top: 44px;
    }

    #dashboard-screen {
        grid-template-columns: 1fr;
        grid-template-rows: var(--topbar-height) 1fr auto;
        grid-template-areas:
            "topbar"
            "content"
            "sidebar";
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
    }

    .sidebar {
        flex-direction: row;
        justify-content: center;
        padding: 8px;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        border-right: none;
        border-top: 1px solid var(--border-subtle);
        overflow-x: hidden;
        gap: 4px;
    }
    .nav-item {
        flex-direction: column;
        gap: 4px;
        padding: 8px 12px;
        font-size: 0.7rem;
        min-width: 0;
    }
    .nav-item svg { width: 18px; height: 18px; }

    .topbar {
        padding: 0 12px;
    }
    .topbar-brand span {
        font-size: 0.9rem;
    }
    .topbar-user span {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .content {
        padding: 20px 16px;
        min-height: 0;
        max-height: none;
        overscroll-behavior: contain;
    }

    .stat-grid.cols-3 {
        grid-template-columns: 1fr 1fr;
    }


    .trial-card {
        flex-direction: column;
        text-align: center;
    }

    .plans-grid-matrix {
        grid-template-columns: 1fr 1fr;
    }

    .copy-row {
        flex-direction: column;
        gap: 8px;
    }
    .copy-value {
        white-space: normal;
        word-break: break-all;
        font-size: 0.78rem;
    }
    .copy-row .btn {
        width: 100%;
        justify-content: center;
    }

    .modal-overlay {
        padding: 12px;
    }
    .modal-card {
        padding: 20px 16px;
        max-width: 100%;
    }

    .toast {
        bottom: 80px;
        right: 16px;
        left: 16px;
        text-align: center;
    }

    #tab-help.tab-panel.active {
        height: calc(100dvh - var(--topbar-height) - 70px - 40px);
    }
}

/* ─── Small screens (320-480px) ─── */
@media (max-width: 480px) {
    .auth-container {
        padding: 16px 12px;
    }
    .auth-brand {
        margin-bottom: 20px;
    }
    .brand-name {
        font-size: 1.6rem;
    }
    .auth-card {
        padding: 24px 16px;
        border-radius: var(--radius-lg);
    }

    .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .stat-grid.cols-3 {
        grid-template-columns: 1fr 1fr;
    }
    .stat-card {
        padding: 14px;
    }
    .stat-value {
        font-size: 1.1rem;
    }

    .plans-grid-matrix {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .tariff-cta-dash {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 4px;
    }
    .tariff-cta-dash-label {
        font-size: 0.88rem;
    }

    .period-card {
        padding: 16px 14px 14px;
    }

    .panel-header h2 {
        font-size: 1.25rem;
    }

    .device-item {
        padding: 10px 12px;
    }
    .device-name {
        font-size: 0.82rem;
        word-break: break-word;
    }

    .settings-section {
        padding: 18px 14px;
    }

    .referral-hero {
        padding: 16px;
    }

    .section-block {
        padding: 16px;
    }
}

/* ═══════════════════════
   PWA Install Banner
   ═══════════════════════ */

.pwa-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.pwa-banner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    cursor: pointer;
    flex: 1;
}

.pwa-banner-icon {
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.pwa-banner-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.pwa-banner-text strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.pwa-banner-text span {
    font-size: 11px;
    color: var(--text-secondary);
}

.pwa-banner-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.25s;
}

.pwa-banner.expanded .pwa-banner-chevron {
    transform: rotate(180deg);
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.pwa-banner-install {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.pwa-banner-install:hover {
    background: var(--accent-light);
}

.pwa-banner-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    transition: color 0.2s;
}

.pwa-banner-close:hover {
    color: var(--text-primary);
}

/* Expandable details */
.pwa-banner-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 16px;
    border-top: 0 solid transparent;
}

.pwa-banner.expanded .pwa-banner-details {
    max-height: 200px;
    padding: 0 16px 14px;
    border-top: 1px solid var(--border-subtle);
}

.pwa-banner-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.pwa-banner-step + .pwa-banner-step {
    border-top: 1px solid var(--border-subtle);
}

.pwa-banner-step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-banner-step-icon {
    color: var(--text-secondary);
    flex-shrink: 0;
    display: flex;
}

.pwa-banner-step-text {
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.4;
}

/* ═══════════════════════
   TRAFFIC TAB
   ═══════════════════════ */

.traffic-period-selector {
    display: flex;
    gap: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    padding: 3px;
}
.traffic-period-btn {
    padding: 5px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 100px;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-body);
}
.traffic-period-btn:hover {
    color: var(--text-secondary);
}
.traffic-period-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.traffic-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.traffic-progress {
    height: 8px;
    background: var(--bg-base);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 8px;
}
.traffic-progress-fill {
    height: 100%;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    transition: width 0.6s ease;
    width: 0%;
}
.traffic-progress-fill.warning {
    background: linear-gradient(90deg, var(--yellow), #ffb347);
}
.traffic-progress-fill.danger {
    background: linear-gradient(90deg, var(--red), #ff8e8e);
}

.traffic-progress-label {
    font-size: 0.78rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-align: right;
}

.traffic-chart-container {
    height: 220px;
    margin-top: 12px;
}
.traffic-chart-container .uplot {
    width: 100% !important;
}

.traffic-countries-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.traffic-country-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
}
.traffic-country-row:last-child {
    border-bottom: none;
}
.traffic-country-flag {
    font-size: 1.2rem;
    line-height: 1;
}
.traffic-country-code {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 28px;
}
.traffic-country-value {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .traffic-chart-container { height: 180px; }
    .panel-header { flex-wrap: wrap; gap: 12px; }
}
@media (max-width: 480px) {
    .traffic-chart-container { height: 150px; }
}

/* ─── Confirm Modal ─── */
.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.confirm-modal-overlay.visible { opacity: 1; }

.confirm-modal {
    background: var(--bg-elevated);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    max-width: 340px;
    width: 100%;
    transform: scale(0.95);
    transition: transform 0.2s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.confirm-modal-overlay.visible .confirm-modal { transform: scale(1); }

.confirm-modal-icon { margin-bottom: 16px; }
.confirm-modal-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 6px;
}
.confirm-modal-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}
.confirm-modal-device {
    font-family: var(--font-mono);
    color: var(--text-primary);
}
.confirm-modal-actions { display: flex; flex-direction: column; gap: 8px; }
.confirm-modal-actions .btn { width: 100%; justify-content: center; }
.confirm-modal-btn-danger {
    background: var(--red);
    color: #fff;
    font-weight: 600;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all var(--transition);
}
.confirm-modal-btn-danger:hover { opacity: 0.9; transform: translateY(-1px); }
.confirm-modal-btn-danger:active { transform: translateY(0); }

/* ── Happ redirect modal ── */
.happ-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.happ-modal-overlay.visible { opacity: 1; }
.happ-modal {
    background: var(--bg-elevated);
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}
.happ-modal-overlay.visible .happ-modal { transform: scale(1); }
.happ-modal-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
}
.happ-modal-text {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 20px;
}
.happ-modal-text strong {
    color: var(--text-primary);
    font-weight: 600;
}
.happ-modal-demo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
    margin-bottom: 16px;
}
.happ-modal-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
}
.happ-modal-ring--outer {
    width: 140px;
    height: 140px;
    border-color: rgba(124, 58, 237, 0.12);
}
.happ-modal-ring--inner {
    width: 115px;
    height: 115px;
    border-color: rgba(124, 58, 237, 0.18);
}
.happ-modal-power {
    position: relative;
    z-index: 2;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(145deg, #1e1452, #150e3a);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.15), inset 0 0 20px rgba(124, 58, 237, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    animation: happPowerPulse 2.5s ease-in-out infinite;
    cursor: pointer;
}
@keyframes happPowerPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(124, 58, 237, 0.15), inset 0 0 20px rgba(124, 58, 237, 0.1); }
    50% { box-shadow: 0 0 35px rgba(124, 58, 237, 0.3), inset 0 0 25px rgba(124, 58, 237, 0.2); }
}
.happ-modal-power svg {
    width: 22px;
    height: 22px;
    color: rgba(255, 255, 255, 0.45);
}
.happ-modal-power-label {
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
}
.happ-modal-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    box-shadow: 0 4px 16px rgba(108, 92, 231, 0.4);
}
.happ-modal-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--accent);
}
.happ-modal-tooltip.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.happ-modal-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    color: var(--accent-light);
    font-size: 12.5px;
    font-weight: 500;
}
.happ-modal-arrow svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    animation: happArrowBounce 1.5s ease-in-out infinite;
}
@keyframes happArrowBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
.happ-modal-btn {
    width: 100%;
    padding: 13px 18px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background: var(--accent);
    color: #fff;
    transition: all 0.2s;
    min-height: 46px;
}
.happ-modal-btn:hover {
    background: #7d6ff0;
    box-shadow: 0 4px 16px rgba(108, 92, 231, 0.3);
}

/* ═══════════════════════════════════════════
   HELP / SUPPORT CHAT
   ═══════════════════════════════════════════ */

/* ─── Nav badge (blue unread dot) ─── */
.nav-item {
    position: relative;
}
.help-badge {
    display: none;
    position: absolute;
    top: 6px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #74b9ff;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(116, 185, 255, 0.6);
    animation: help-badge-pulse 2s ease-in-out infinite;
}
.nav-item.has-unread .help-badge {
    display: block;
}
@keyframes help-badge-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(116, 185, 255, 0.6); }
    50% { opacity: 0.7; box-shadow: 0 0 10px rgba(116, 185, 255, 0.9); }
}

/* ─── Tab panel override: flex for chat layout ─── */
#tab-help.tab-panel.active {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--topbar-height) - 64px);
    overflow: hidden;
}
#tab-help .panel-header {
    flex-shrink: 0;
}

/* ─── Chat container ─── */
.help-chat {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ─── Messages scrollable area ─── */
.help-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 90px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}
/* Push messages to the bottom when few */
#help-messages {
    margin-top: auto;
}

/* ─── Load earlier ─── */
.help-load-earlier {
    text-align: center;
    padding: 4px 0 12px;
    display: none;
}
.help-load-earlier.visible {
    display: block;
}
.help-load-earlier button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 400;
    padding: 5px 14px;
    border-radius: 100px;
    cursor: pointer;
    transition: all var(--transition);
}
.help-load-earlier button:hover {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
    background: var(--bg-surface);
}

/* ─── Date separator ─── */
.help-date-sep {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0 10px;
    user-select: none;
}
.help-date-sep::before,
.help-date-sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}
.help-date-sep span {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* ─── Message bubbles ─── */
.help-msg {
    max-width: 78%;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
    animation: help-msg-in 0.2s ease-out both;
}
@keyframes help-msg-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* User messages — right, accent purple */
.help-msg.user {
    align-self: flex-end;
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Admin messages — left, surface gray */
.help-msg.admin {
    align-self: flex-start;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

/* Admin label */
.help-msg.admin .help-msg-sender {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--accent-light);
    margin-bottom: 2px;
    letter-spacing: 0.02em;
}

/* Message text + inline timestamp */
.help-msg-body {
    display: inline;
}
.help-msg-time {
    display: inline-block;
    font-size: 0.65rem;
    margin-left: 8px;
    opacity: 0.45;
    vertical-align: bottom;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.help-msg.admin .help-msg-time {
    color: var(--text-muted);
    opacity: 0.7;
}

/* ─── Input bar ─── */
.help-input-bar {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 32px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-deep);
    z-index: 10;
}
.help-input-bar textarea {
    flex: 1;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    padding: 9px 14px;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.88rem;
    line-height: 1.5;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    overflow-y: auto;
}
.help-input-bar textarea::placeholder {
    color: var(--text-muted);
}
.help-input-bar textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.help-send-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
    color: #fff;
}
.help-send-btn:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px var(--accent-glow);
}
.help-send-btn:active {
    transform: translateY(0);
}
.help-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.help-send-btn svg {
    width: 18px;
    height: 18px;
}

/* ─── Empty state ─── */
.help-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 16px;
    padding: 40px 20px 80px;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}
.help-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}
.help-empty-icon svg {
    width: 26px;
    height: 26px;
}
.help-empty-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.help-empty-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    max-width: 260px;
    line-height: 1.5;
}

/* ─── Loading skeleton ─── */
.help-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    flex: 1;
}
.help-skeleton-msg {
    height: 48px;
    border-radius: var(--radius-lg);
    background: linear-gradient(110deg, var(--bg-surface) 0%, var(--bg-elevated) 50%, var(--bg-surface) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}
.help-skeleton-msg:nth-child(odd) {
    width: 65%;
    align-self: flex-start;
}
.help-skeleton-msg:nth-child(even) {
    width: 55%;
    align-self: flex-end;
}
.help-skeleton-msg:nth-child(3) { width: 40%; }
.help-skeleton-msg:nth-child(4) { width: 70%; }

/* ─── Sending spinner on button ─── */
.help-send-btn.sending svg {
    animation: help-send-spin 0.6s linear infinite;
}
@keyframes help-send-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ═══════════════════════
   HELP CHAT — RESPONSIVE
   ═══════════════════════ */

@media (max-width: 900px) {
    .nav-item .help-badge {
        top: 4px;
        right: 6px;
        width: 7px;
        height: 7px;
    }
}

@media (max-width: 600px) {
    .help-msg {
        max-width: 85%;
        font-size: 0.84rem;
    }

    .help-messages-area {
        padding: 12px 12px 100px;
    }

    .help-input-bar {
        left: 0;
        bottom: 70px; /* above bottom nav */
        padding: 10px 16px;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .help-input-bar textarea {
        font-size: 16px; /* prevent iOS zoom */
    }

    .help-empty-icon {
        width: 48px;
        height: 48px;
    }
    .help-empty-icon svg {
        width: 22px;
        height: 22px;
    }
}

/* ═══════════════════════════════════════════
   SUPPORT NOTIFICATION TOAST
   ═══════════════════════════════════════════ */

.support-notif {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    z-index: 5000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 100px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(108, 92, 231, 0.1);
    cursor: pointer;
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
    max-width: calc(100vw - 32px);
    overflow: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.support-notif.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.support-notif.dismissing {
    transform: translateX(-50%) translateY(-120%);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 1, 1), opacity 0.2s ease;
}

/* Icon */
.support-notif-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.support-notif-icon svg {
    width: 16px;
    height: 16px;
    color: var(--accent-light);
}

/* Text */
.support-notif-text {
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    letter-spacing: -0.01em;
}

/* Action button */
.support-notif-btn {
    padding: 5px 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition);
    letter-spacing: 0.01em;
}
.support-notif-btn:hover {
    background: var(--accent-light);
}

/* Progress bar */
.support-notif-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 0 0 100px 100px;
    animation: support-notif-countdown 6s linear forwards;
    opacity: 0.6;
}
@keyframes support-notif-countdown {
    from { width: 100%; }
    to { width: 0%; }
}

/* Mobile */
@media (max-width: 600px) {
    .support-notif {
        left: 12px;
        right: 12px;
        transform: translateX(0) translateY(-120%);
        border-radius: var(--radius-lg);
        max-width: none;
    }
    .support-notif.visible {
        transform: translateX(0) translateY(0);
    }
    .support-notif.dismissing {
        transform: translateX(0) translateY(-120%);
    }
    .support-notif-text {
        font-size: 0.78rem;
    }
}
