/* ============================================================================
   Vehicly Profile Page Styles -- v2 (polished)
   ---------------------------------------------------------------------------- */

/* ====== MAIN CONTENT ====== */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.profile-container {
    width: 100%;
    scroll-behavior: smooth;
}

.page-header {
    margin-bottom: 3rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--vh-text-muted);
    line-height: 1.5;
}

/* ====== TABS ====== */
.tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--vh-border);
    padding-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    scrollbar-width: none;
}

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

/* Sliding active indicator */
.tabs-indicator {
    position: absolute;
    bottom: -2px;
    height: 3px;
    background: var(--vh-primary);
    border-radius: 2px 2px 0 0;
    transition: left 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 2;
    pointer-events: none;
    will-change: left, width;
}

.tab {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    color: var(--vh-text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.25s ease, background 0.25s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    position: relative;
    border-radius: 8px 8px 0 0;
}

.tab:hover {
    color: var(--vh-text);
    background: rgba(var(--vh-primary-rgb), 0.04);
}

.tab:focus-visible {
    outline: 3px solid var(--vh-primary);
    outline-offset: 3px;
    border-radius: 8px 8px 0 0;
}

.tab.active {
    color: var(--vh-primary);
    border-bottom-color: transparent;
    position: relative;
}

/* Remove old ::after indicator since we use JS sliding indicator */
.tab.active::after {
    display: none;
}

/* ====== TAB CONTENT CROSSFADE ====== */
.tab-content {
    display: none;
    opacity: 0;
}

.tab-content.active {
    display: block;
    animation: vh-tabFadeIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.tab-content.fade-out {
    display: block;
    animation: vh-tabFadeOut 0.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes vh-tabFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

/* ====== CARDS ====== */
.card {
    background: var(--vh-surface);
    border: 1.5px solid var(--vh-border);
    border-radius: var(--radius-xl, 22px);
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(15, 23, 42, .06));
    /* Card entrance -- driven by JS class for tab switches */
    opacity: 0;
    animation: vh-cardFadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }
.card:nth-child(7) { animation-delay: 0.35s; }
.card:nth-child(8) { animation-delay: 0.4s; }

/* Re-trigger card entrance on tab switch */
.tab-content.active .card {
    animation: vh-cardEntrance 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tab-content.active .card:nth-child(1) { animation-delay: 0.04s; }
.tab-content.active .card:nth-child(2) { animation-delay: 0.09s; }
.tab-content.active .card:nth-child(3) { animation-delay: 0.14s; }
.tab-content.active .card:nth-child(4) { animation-delay: 0.19s; }
.tab-content.active .card:nth-child(5) { animation-delay: 0.24s; }

@keyframes vh-cardFadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes vh-cardEntrance {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* BUG FIX: card hover should NOT move with transform on touch/mobile -- causes layout jumps */
@media (hover: hover) and (pointer: fine) {
    .card:hover {
        box-shadow: var(--shadow-lg, 0 10px 30px rgba(15, 23, 42, .08));
        border-color: var(--vh-primary);
    }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title .section-icon {
    width: 22px;
    height: 22px;
    color: var(--vh-primary);
    flex-shrink: 0;
}

.card-action {
    padding: 0.5rem 1rem;
    background: var(--vh-surface);
    color: var(--vh-text);
    border: 2px solid var(--vh-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.card-action:hover {
    border-color: var(--vh-text);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-action:focus-visible {
    outline: 3px solid var(--vh-primary);
    outline-offset: 3px;
}

.card-action:active {
    transform: translateY(0);
}

.card-action.primary {
    background: var(--vh-primary);
    color: var(--vh-text);
    border-color: var(--vh-primary);
}

.card-action.primary:hover {
    background: var(--vh-primary-hover);
    border-color: var(--vh-primary-hover);
}

.card-action.danger {
    color: var(--vh-error);
    border-color: var(--vh-error);
}

.card-action.danger:hover {
    background: var(--vh-error);
    color: var(--vh-surface);
}

/* ====== SAVE BUTTON SUCCESS ANIMATION ====== */
.card-action.save-success,
.modal-btn-confirm.save-success {
    background: var(--vh-success);
    border-color: var(--vh-success);
    color: var(--vh-surface);
    pointer-events: none;
    animation: vh-btnSuccessPulse 0.5s ease;
}

.card-action.save-success::after,
.modal-btn-confirm.save-success::after {
    content: '';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes vh-btnSuccessPulse {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.08); }
    60%  { transform: scale(0.96); }
    100% { transform: scale(1); }
}

/* Checkmark SVG animation inside button */
.btn-checkmark {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    vertical-align: middle;
}

.btn-checkmark path {
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    animation: vh-checkDraw 0.4s 0.15s ease forwards;
}

@keyframes vh-checkDraw {
    to { stroke-dashoffset: 0; }
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--vh-text-muted);
    margin-bottom: 0.5rem;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--vh-text);
}

.info-value.accent {
    color: var(--vh-primary);
}

/* ====== STAT NUMBER SCALE-IN ====== */
.info-value.stat-animate {
    animation: vh-statScaleIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    display: inline-block;
}

@keyframes vh-statScaleIn {
    from { opacity: 0; transform: scale(0.5) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ====== SUBSCRIPTION STATUS ====== */
.subscription-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
}

.subscription-badge.active {
    background: rgba(var(--vh-success-rgb), 0.12);
    color: var(--vh-success);
    animation: vh-badgePulse 3s ease-in-out infinite;
}

.subscription-badge.inactive {
    background: rgba(var(--vh-error-rgb), 0.12);
    color: var(--vh-error);
}

/* Subtle pulse glow for badges */
@keyframes vh-badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--vh-success-rgb), 0); }
    50%      { box-shadow: 0 0 12px 2px rgba(var(--vh-success-rgb), 0.15); }
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: vh-statusPulse 2s ease-in-out infinite;
}

@keyframes vh-statusPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

/* ====== CREDITS BADGE GLOW ====== */
.info-value.credits-glow {
    animation: vh-creditsGlow 3s ease-in-out infinite;
    color: var(--vh-primary);
}

@keyframes vh-creditsGlow {
    0%, 100% { text-shadow: none; }
    50%      { text-shadow: 0 0 8px rgba(var(--vh-primary-rgb), 0.4); }
}

/* ============================================================================
   SUBSCRIPTION TAB -- Enhanced Styles
   ---------------------------------------------------------------------------- */

/* ---- Current Plan Card: large & prominent ---- */
.sub-current-plan-card {
    background: linear-gradient(135deg, var(--vh-surface) 0%, rgba(var(--vh-primary-rgb), 0.04) 100%);
    border: 1px solid rgba(var(--vh-primary-rgb), 0.18);
    position: relative;
    overflow: hidden;
}

.sub-current-plan-card::before {
    content: "";
    position: absolute;
    top: -60%;
    right: -20%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(var(--vh-primary-rgb), 0.07) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Plan icon next to the card title */
#subscriptionTab .card-header .section-icon {
    color: var(--vh-primary);
    filter: drop-shadow(0 0 4px rgba(var(--vh-primary-rgb), 0.35));
}

/* Status badge improvements */
.subscription-badge {
    border-radius: var(--radius-pill, 9999px);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.4rem 1rem;
}

.subscription-badge.active {
    background: rgba(var(--vh-success-rgb), 0.14);
    color: var(--vh-success);
    border: 1px solid rgba(var(--vh-success-rgb), 0.25);
}

.subscription-badge.expired,
.subscription-badge.inactive {
    background: rgba(var(--vh-error-rgb), 0.12);
    color: var(--vh-error);
    border: 1px solid rgba(var(--vh-error-rgb), 0.22);
}

/* Plan name display */
#subscriptionPlan {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--vh-primary);
    letter-spacing: -0.01em;
}

/* ---- Credits Meter (bar progress) ---- */
.sub-credits-meter {
    margin-top: 1.25rem;
    padding: 1.25rem;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-sm);
}

.sub-credits-meter-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
}

.sub-credits-meter-label {
    font-size: 0.85rem;
    color: var(--vh-text-muted);
    font-weight: 500;
}

.sub-credits-meter-count {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--vh-text);
}

.sub-credits-meter-count .used {
    color: var(--vh-primary);
}

.sub-credits-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-pill, 9999px);
    overflow: hidden;
    position: relative;
}

.sub-credits-bar-fill {
    height: 100%;
    border-radius: var(--radius-pill, 9999px);
    background: linear-gradient(90deg, var(--vh-primary), var(--vh-primary-hover, #e0b640));
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.sub-credits-bar-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    animation: sub-barShimmer 2.5s ease-in-out infinite;
}

@keyframes sub-barShimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Danger state when credits are low */
.sub-credits-bar-fill.low {
    background: linear-gradient(90deg, var(--vh-error), #f87171);
}

.sub-credits-bar-fill.medium {
    background: linear-gradient(90deg, var(--vh-warning), var(--vh-warning));
}

/* ---- Renewal Date with Countdown Badge ---- */
.sub-renewal-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sub-countdown-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-pill, 9999px);
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(var(--vh-primary-rgb), 0.12);
    color: var(--vh-primary);
    border: 1px solid rgba(var(--vh-primary-rgb), 0.2);
    white-space: nowrap;
}

.sub-countdown-badge svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.sub-countdown-badge.urgent {
    background: rgba(var(--vh-error-rgb), 0.12);
    color: var(--vh-error);
    border-color: rgba(var(--vh-error-rgb), 0.22);
}

/* ---- Auto-Renew Toggle Switch ---- */
.sub-autorenew-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-sm);
    margin-top: 1rem;
}

.sub-autorenew-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sub-autorenew-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--vh-text);
}

.sub-autorenew-desc {
    font-size: 0.8rem;
    color: var(--vh-text-muted);
}

/* ---- Plan Comparison Mini-Cards ---- */
.sub-plan-features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.sub-feature-card {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-sm);
    border: 1px solid var(--vh-border);
    transition: border-color 0.25s ease, background 0.25s ease;
}

.sub-feature-card:hover {
    border-color: rgba(var(--vh-primary-rgb), 0.3);
    background: rgba(var(--vh-primary-rgb), 0.04);
}

.sub-feature-card.included {
    border-color: rgba(var(--vh-success-rgb), 0.2);
}

.sub-feature-card.locked {
    opacity: 0.5;
}

.sub-feature-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
}

.sub-feature-card.included .sub-feature-icon {
    background: rgba(var(--vh-success-rgb), 0.15);
    color: var(--vh-success);
}

.sub-feature-card.locked .sub-feature-icon {
    background: rgba(255, 255, 255, 0.06);
    color: var(--vh-text-muted);
}

.sub-feature-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--vh-text);
    line-height: 1.4;
}

/* ---- Upgrade / Downgrade CTA Button with Shimmer ---- */
.sub-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    letter-spacing: 0.01em;
}

.sub-cta-btn.upgrade {
    background: linear-gradient(135deg, var(--vh-primary) 0%, var(--vh-primary-hover, #e0b640) 100%);
    color: #1a1a2e;
    box-shadow: 0 4px 16px rgba(var(--vh-primary-rgb), 0.25);
}

.sub-cta-btn.upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(var(--vh-primary-rgb), 0.35);
}

.sub-cta-btn.downgrade {
    background: var(--vh-surface-alt);
    color: var(--vh-text-muted);
    border: 1px solid var(--vh-border);
}

.sub-cta-btn.downgrade:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--vh-text);
}

/* Shimmer sweep effect */
.sub-cta-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.25) 50%,
        transparent 100%
    );
    transform: skewX(-20deg);
    animation: sub-ctaShimmer 3.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes sub-ctaShimmer {
    0%        { left: -100%; }
    30%, 100% { left: 120%; }
}

/* ---- Billing History Table ---- */
.sub-billing-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
}

.sub-billing-table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--vh-text-muted);
    border-bottom: 1px solid var(--vh-border);
    white-space: nowrap;
}

.sub-billing-table tbody tr {
    transition: background 0.2s ease;
}

.sub-billing-table tbody tr:nth-child(odd) {
    background: var(--vh-surface-alt);
}

.sub-billing-table tbody tr:nth-child(even) {
    background: transparent;
}

.sub-billing-table tbody tr:hover {
    background: rgba(var(--vh-primary-rgb), 0.04);
}

.sub-billing-table tbody td {
    padding: 0.85rem 1rem;
    color: var(--vh-text);
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    white-space: nowrap;
}

.sub-billing-table tbody td:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.sub-billing-table tbody td:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Billing amount column */
.sub-billing-amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Status badges for billing */
.sub-billing-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-pill, 9999px);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.sub-billing-status.paid {
    background: rgba(var(--vh-success-rgb), 0.12);
    color: var(--vh-success);
    border: 1px solid rgba(var(--vh-success-rgb), 0.2);
}

.sub-billing-status.pending {
    background: rgba(var(--vh-warning-rgb), 0.12);
    color: var(--vh-warning);
    border: 1px solid rgba(var(--vh-warning-rgb), 0.2);
}

.sub-billing-status.failed {
    background: rgba(var(--vh-error-rgb), 0.12);
    color: var(--vh-error);
    border: 1px solid rgba(var(--vh-error-rgb), 0.2);
}

/* Refund status badges */
.sub-billing-status.refunded {
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.sub-billing-status.refund-pending {
    background: rgba(6, 182, 212, 0.12);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

/* Receipt link */
.sub-receipt-link {
    color: var(--vh-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.82rem;
    transition: color 0.2s ease, text-decoration 0.2s ease;
    cursor: pointer;
}

.sub-receipt-link:hover {
    color: var(--vh-primary-hover, #e0b640);
    text-decoration: underline;
}

/* ---- Empty Billing State ---- */
.sub-billing-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    gap: 0.75rem;
}

.sub-billing-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(var(--vh-primary-rgb), 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
}

.sub-billing-empty-icon svg {
    width: 26px;
    height: 26px;
    color: var(--vh-primary);
    opacity: 0.7;
}

.sub-billing-empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--vh-text);
}

.sub-billing-empty-desc {
    font-size: 0.88rem;
    color: var(--vh-text-muted);
    max-width: 320px;
    line-height: 1.5;
}

/* ---- Subscription info grid overrides for Subscription tab ---- */
#subscriptionTab .info-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

#subscriptionTab .info-item {
    padding: 1rem;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

#subscriptionTab .info-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
    display: block;
}

#subscriptionTab .info-value {
    font-size: 1.05rem;
    font-weight: 600;
}

/* Scrollable billing table wrapper */
.sub-billing-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.25rem;
    padding: 0 0.25rem;
}

.sub-billing-scroll::-webkit-scrollbar {
    height: 4px;
}

.sub-billing-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sub-billing-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-pill, 9999px);
}

/* ---- Plan Hero Row (name + price | renewal + countdown) ---- */
.sub-plan-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.sub-plan-hero-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sub-plan-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--vh-primary);
    letter-spacing: -0.02em;
}

.sub-plan-price {
    font-size: 0.9rem;
    color: var(--vh-text-muted);
    font-weight: 500;
}

.sub-plan-hero-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.sub-renewal-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--vh-text-muted);
}

/* ---- Credits Meter Footer ---- */
.sub-credits-meter-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.6rem;
}

.sub-credits-pct {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--vh-primary);
    transition: color 0.4s ease;
}

.sub-credits-pct.warning { color: var(--vh-warning); }
.sub-credits-pct.danger { color: var(--vh-error); }

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

/* ---- Subscription Actions Row ---- */
.sub-actions-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.sub-actions-row .sub-cta-btn { flex: 1; }

.sub-cta-btn.cancel {
    background: transparent;
    color: var(--vh-error);
    border: 1.5px solid rgba(var(--vh-error-rgb), 0.3);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s ease;
}

.sub-cta-btn.cancel:hover {
    background: rgba(var(--vh-error-rgb), 0.08);
    border-color: rgba(var(--vh-error-rgb), 0.5);
    transform: translateY(-1px);
}

/* ---- Plan Comparison Grid ---- */
.sub-comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.sub-comparison-col {
    background: var(--vh-surface-alt);
    border: 1.5px solid var(--vh-border);
    border-radius: var(--radius-md, 14px);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
}

.sub-comparison-col:hover {
    border-color: rgba(var(--vh-primary-rgb), 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.sub-comparison-col.current {
    border-color: var(--vh-primary);
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb), 0.1);
}

.sub-comparison-col.current::after {
    content: 'Current';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--vh-primary);
    color: #1a1a2e;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.75rem;
    border-radius: var(--radius-pill, 9999px);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sub-comparison-col.recommended {
    border-color: rgba(var(--vh-success-rgb), 0.4);
}

.sub-comparison-col.recommended::after {
    content: 'Recommended';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--vh-success);
    color: var(--vh-surface);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.75rem;
    border-radius: var(--radius-pill, 9999px);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sub-comparison-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--vh-text);
    margin-bottom: 0.25rem;
}

.sub-comparison-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--vh-primary);
    margin-bottom: 0.15rem;
}

.sub-comparison-price .period {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--vh-text-muted);
}

.sub-comparison-credits {
    font-size: 0.85rem;
    color: var(--vh-text-muted);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sub-comparison-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.sub-comparison-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--vh-text);
}

.sub-comparison-features li svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.sub-comparison-features li.included svg { color: var(--vh-success); }

.sub-comparison-features li.locked {
    color: var(--vh-text-muted);
    opacity: 0.6;
}

.sub-comparison-features li.locked svg { color: var(--vh-text-muted); }

.sub-comparison-btn {
    width: 100%;
    padding: 0.7rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    text-align: center;
}

.sub-comparison-btn.active-plan {
    background: rgba(var(--vh-primary-rgb), 0.1);
    color: var(--vh-primary);
    border: 1px solid rgba(var(--vh-primary-rgb), 0.25);
    cursor: default;
}

.sub-comparison-btn.select-plan {
    background: linear-gradient(135deg, var(--vh-primary), var(--vh-primary-hover, #e0b640));
    color: #1a1a2e;
    box-shadow: 0 2px 10px rgba(var(--vh-primary-rgb), 0.2);
}

.sub-comparison-btn.select-plan:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(var(--vh-primary-rgb), 0.3);
}

/* ---- Payment Method Display ---- */
.sub-payment-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--vh-surface-alt);
    border: 1px solid var(--vh-border);
    border-radius: var(--radius-sm);
    transition: border-color 0.25s ease;
}

.sub-payment-card:hover {
    border-color: rgba(var(--vh-primary-rgb), 0.3);
}

.sub-payment-card-icon {
    width: 52px;
    height: 36px;
    border-radius: var(--radius-xs, 8px);
    background: linear-gradient(135deg, rgba(var(--vh-primary-rgb), 0.12), rgba(var(--vh-primary-rgb), 0.04));
    border: 1px solid rgba(var(--vh-primary-rgb), 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sub-payment-card-icon svg {
    width: 28px;
    height: 28px;
    color: var(--vh-primary);
}

.sub-payment-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.sub-payment-card-brand {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--vh-text);
}

.sub-payment-card-number {
    font-size: 0.85rem;
    color: var(--vh-text-muted);
    font-family: var(--vh-font-body);
    letter-spacing: 0.1em;
}

.sub-payment-card-expiry {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    flex-shrink: 0;
}

.sub-payment-expiry-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--vh-text-muted);
    font-weight: 600;
}

.sub-payment-expiry-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--vh-text);
    font-variant-numeric: tabular-nums;
}

/* ---- Cancel Subscription Modal Warning ---- */
.sub-cancel-warning {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(var(--vh-error-rgb), 0.06);
    border: 1px solid rgba(var(--vh-error-rgb), 0.15);
    border-radius: var(--radius-sm);
}

.sub-cancel-warning > svg {
    flex-shrink: 0;
    color: var(--vh-error);
    margin-top: 0.1rem;
}

.sub-cancel-warning-title {
    font-weight: 600;
    color: var(--vh-text);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.sub-cancel-warning-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem 0;
}

.sub-cancel-warning-list li {
    position: relative;
    padding-left: 1.25rem;
    font-size: 0.88rem;
    color: var(--vh-text-muted);
    line-height: 1.8;
}

.sub-cancel-warning-list li::before {
    content: '\00d7';
    position: absolute;
    left: 0;
    color: var(--vh-error);
    font-weight: 700;
    font-size: 1rem;
}

.sub-cancel-warning-note {
    font-size: 0.85rem;
    color: var(--vh-text-muted);
}

/* ---- Upgrade Comparison (inside modal) ---- */
.sub-upgrade-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
}

.sub-upgrade-side {
    text-align: center;
    padding: 1.25rem;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-sm);
    border: 1px solid var(--vh-border);
}

.sub-upgrade-side.new-plan {
    border-color: rgba(var(--vh-success-rgb), 0.3);
    background: rgba(var(--vh-success-rgb), 0.04);
}

.sub-upgrade-side-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--vh-text-muted);
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.sub-upgrade-side-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--vh-text);
    display: block;
    margin-bottom: 0.25rem;
}

.sub-upgrade-side-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--vh-primary);
    display: block;
}

.sub-upgrade-arrow {
    color: var(--vh-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sub-upgrade-arrow svg {
    width: 28px;
    height: 28px;
}

/* ---- Billing Invoice Link with icon ---- */
.sub-invoice-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--vh-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.82rem;
    transition: color 0.2s ease;
    cursor: pointer;
}

.sub-invoice-link:hover {
    color: var(--vh-primary-hover, #e0b640);
    text-decoration: underline;
}

.sub-invoice-link svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ---- Subscription Tab Responsive ---- */
@media (max-width: 768px) {
    .sub-plan-hero {
        flex-direction: column;
        gap: 1rem;
    }

    .sub-plan-hero-right {
        align-items: flex-start;
    }

    .sub-actions-row {
        flex-direction: column;
    }

    .sub-comparison-grid {
        grid-template-columns: 1fr;
    }

    .sub-upgrade-comparison {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .sub-upgrade-arrow {
        transform: rotate(90deg);
    }

    .sub-payment-card {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .sub-payment-card-expiry {
        align-items: flex-start;
        width: 100%;
        flex-direction: row;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .sub-plan-name {
        font-size: 1.25rem;
    }

    .sub-comparison-col {
        padding: 1.15rem;
    }
}

/* ============================================================================
   END SUBSCRIPTION TAB
   ---------------------------------------------------------------------------- */

/* ====== ACTIVITY LIST ====== */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item {
    padding: 1rem 1.25rem;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.25s ease, transform 0.25s ease;
    cursor: default;
    border-left: 3px solid transparent;
    gap: 1rem;
}

.activity-item:hover {
    background: var(--vh-bg-highlight);
    transform: translateX(3px);
}

/* ====== ACTIVITY EVENT TYPE COLORS ====== */
.activity-item[data-type="search"],
.activity-item.event-search {
    border-left-color: var(--vh-primary);
}

.activity-item[data-type="login"],
.activity-item.event-login {
    border-left-color: var(--vh-success);
}

.activity-item[data-type="security"],
.activity-item.event-security {
    border-left-color: var(--vh-error);
}

.activity-item[data-type="settings"],
.activity-item.event-settings {
    border-left-color: #8B5CF6;
}

.activity-item[data-type="billing"],
.activity-item.event-billing {
    border-left-color: #06B6D4;
}

/* Activity event type icon dot */
.activity-type-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-type-dot.search  { background: var(--vh-primary); }
.activity-type-dot.login   { background: var(--vh-success); }
.activity-type-dot.security { background: var(--vh-error); }
.activity-type-dot.settings { background: #8B5CF6; }
.activity-type-dot.billing  { background: #06B6D4; }
.activity-type-dot.default  { background: var(--vh-text-muted); }

/* Staggered fade-in for history items */
.activity-item.stagger-in {
    opacity: 0;
    animation: vh-staggerFadeIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-meta {
    font-size: 0.85rem;
    color: var(--vh-text-muted);
}

.activity-time {
    font-size: 0.8rem;
    color: var(--vh-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ====== PREFERENCES TAB ====== */

/* --- Section grouping with headers & dividers --- */
#preferencesTab .card {
    overflow: visible;
}

#preferencesTab .card + .card {
    margin-top: 0.5rem;
}

.pref-section-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(var(--vh-primary-rgb), 0.1);
}

.pref-section-header .section-icon {
    width: 20px;
    height: 20px;
    color: var(--vh-primary);
    flex-shrink: 0;
    opacity: 0.8;
}

.pref-section-header h3 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--vh-text-muted);
}

/* --- 1. Decision Context Toggle (Buyer / Dealer) --- */
.context-toggle-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.context-toggle-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: var(--vh-surface-alt);
    border: 2px solid var(--vh-border);
    border-radius: var(--radius-md, 14px);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    text-align: center;
}

.context-toggle-option:hover {
    border-color: rgba(var(--vh-primary-rgb), 0.4);
    background: rgba(var(--vh-primary-rgb), 0.03);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.context-toggle-option.active {
    border-color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.06);
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb), 0.12), 0 8px 24px rgba(0, 0, 0, 0.06);
}

.context-toggle-option.active::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    background: var(--vh-primary);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23181A20' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
    animation: vh-checkPop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.context-toggle-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.context-toggle-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg, 18px);
    background: var(--vh-surface);
    border: 1.5px solid var(--vh-border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--vh-text-muted);
}

.context-toggle-option.active .context-toggle-icon {
    background: rgba(var(--vh-primary-rgb), 0.1);
    border-color: var(--vh-primary);
    color: var(--vh-primary);
}

.context-toggle-icon svg {
    width: 24px;
    height: 24px;
}

.context-toggle-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--vh-text);
    transition: color 0.25s ease;
}

.context-toggle-desc {
    font-size: 0.82rem;
    color: var(--vh-text-muted);
    line-height: 1.4;
}

.context-toggle-option.active .context-toggle-label {
    color: var(--vh-primary);
}

/* --- 2. Location Selector with flag --- */
.pref-location-selector {
    position: relative;
}

.pref-location-selector .form-select {
    padding-left: 2.75rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px;
    padding-right: 2.5rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.2s ease;
}

.pref-location-selector .form-select:hover {
    border-color: rgba(var(--vh-primary-rgb), 0.5);
}

.pref-location-flag {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    pointer-events: none;
    transition: transform 0.25s ease;
    line-height: 1;
}

.pref-location-selector:focus-within .pref-location-flag {
    transform: translateY(-50%) scale(1.1);
}

/* --- 3. Budget Range Selector --- */
.pref-budget-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pref-budget-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem;
    align-items: center;
}

.pref-budget-inputs .form-input {
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.85rem 0.5rem;
    border-radius: var(--radius-md, 14px);
}

.pref-budget-inputs .form-input:focus {
    border-color: var(--vh-primary);
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb), 0.12);
}

.pref-budget-separator {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--vh-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pref-budget-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pref-budget-label-row .form-label {
    margin-bottom: 0;
}

.pref-budget-display {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.08);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-pill, 9999px);
}

/* Range slider styling */
.pref-budget-slider {
    position: relative;
    height: 6px;
    background: var(--vh-border);
    border-radius: var(--radius-xs, 8px);
    margin: 0.25rem 0;
}

.pref-budget-slider input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: transparent;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    margin: 0;
}

.pref-budget-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background: var(--vh-primary);
    border: 3px solid var(--vh-surface);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(var(--vh-primary-rgb), 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pref-budget-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 12px rgba(var(--vh-primary-rgb), 0.5);
}

.pref-budget-slider input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.3);
}

.pref-budget-slider input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: var(--vh-primary);
    border: 3px solid var(--vh-surface);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(var(--vh-primary-rgb), 0.3);
    transition: transform 0.2s ease;
}

.pref-budget-slider-track {
    position: absolute;
    height: 6px;
    background: var(--vh-primary);
    border-radius: var(--radius-xs, 8px);
    top: 0;
    transition: left 0.15s ease, right 0.15s ease;
}

/* --- 4. Usage Frequency - Visual Pills / Cards --- */
.pref-usage-pills {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
}

.pref-usage-pill {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    background: var(--vh-surface-alt);
    border: 2px solid var(--vh-border);
    border-radius: var(--radius-md, 14px);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    text-align: center;
}

.pref-usage-pill:hover {
    border-color: rgba(var(--vh-primary-rgb), 0.4);
    background: rgba(var(--vh-primary-rgb), 0.03);
    transform: translateY(-2px);
}

.pref-usage-pill.active {
    border-color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.06);
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb), 0.1);
}

.pref-usage-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pref-usage-pill-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--vh-text-muted);
    transition: color 0.25s ease;
}

.pref-usage-pill.active .pref-usage-pill-icon {
    color: var(--vh-primary);
}

.pref-usage-pill-icon svg {
    width: 22px;
    height: 22px;
}

.pref-usage-pill-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--vh-text);
    line-height: 1.3;
}

.pref-usage-pill.active .pref-usage-pill-label {
    color: var(--vh-primary);
}

/* --- 5. Body Type Selector with silhouette icons, multi-select pills --- */
.pref-body-types {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.6rem;
}

.pref-body-type {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem 0.75rem;
    background: var(--vh-surface-alt);
    border: 2px solid var(--vh-border);
    border-radius: var(--radius-md, 14px);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    text-align: center;
    user-select: none;
}

.pref-body-type:hover {
    border-color: rgba(var(--vh-primary-rgb), 0.4);
    background: rgba(var(--vh-primary-rgb), 0.03);
    transform: translateY(-2px);
}

.pref-body-type.active {
    border-color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.06);
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb), 0.1);
}

.pref-body-type.active::before {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 16px;
    height: 16px;
    background: var(--vh-primary);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23181A20' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: 9px;
    background-position: center;
    background-repeat: no-repeat;
    animation: vh-checkPop 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.pref-body-type input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pref-body-type-icon {
    width: 48px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--vh-text-muted);
    transition: color 0.25s ease;
    opacity: 0.6;
}

.pref-body-type.active .pref-body-type-icon {
    color: var(--vh-primary);
    opacity: 1;
}

.pref-body-type-icon svg {
    width: 100%;
    height: 100%;
}

.pref-body-type-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--vh-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pref-body-type.active .pref-body-type-label {
    color: var(--vh-primary);
}

/* --- Multi-select feature pills --- */
.pref-multi-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pref-multi-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--vh-surface-alt);
    border: 1.5px solid var(--vh-border);
    border-radius: var(--radius-pill, 9999px);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--vh-text);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    user-select: none;
}

.pref-multi-pill:hover {
    border-color: rgba(var(--vh-primary-rgb), 0.5);
    background: rgba(var(--vh-primary-rgb), 0.04);
}

.pref-multi-pill.active {
    background: rgba(var(--vh-primary-rgb), 0.1);
    border-color: var(--vh-primary);
    color: var(--vh-primary);
    font-weight: 600;
}

.pref-multi-pill.active::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background: var(--vh-primary);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23181A20' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: 8px;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.pref-multi-pill input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* --- 6. Priorities / Sortable items --- */
.pref-priorities-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    counter-reset: priority-counter;
}

.pref-priority-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--vh-surface-alt);
    border: 1.5px solid var(--vh-border);
    border-radius: var(--radius-sm, 10px);
    cursor: grab;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    user-select: none;
    counter-increment: priority-counter;
}

.pref-priority-item:hover {
    background: rgba(var(--vh-primary-rgb), 0.04);
    border-color: rgba(var(--vh-primary-rgb), 0.3);
    transform: translateX(3px);
}

.pref-priority-item:active {
    cursor: grabbing;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: scale(1.02);
    z-index: 10;
    border-color: var(--vh-primary);
    background: var(--vh-surface);
}

.pref-priority-item.dragging {
    opacity: 0.5;
    border-style: dashed;
}

.pref-priority-item.drag-over {
    border-color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.06);
}

.pref-priority-handle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--vh-text-muted);
    flex-shrink: 0;
    opacity: 0.4;
    transition: opacity 0.25s ease;
}

.pref-priority-item:hover .pref-priority-handle {
    opacity: 0.8;
}

.pref-priority-handle svg {
    width: 16px;
    height: 16px;
}

.pref-priority-rank {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--vh-surface);
    border: 1.5px solid var(--vh-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--vh-text-muted);
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.pref-priority-item:nth-child(1) .pref-priority-rank {
    background: rgba(var(--vh-primary-rgb), 0.12);
    border-color: var(--vh-primary);
    color: var(--vh-primary);
}

.pref-priority-item:nth-child(2) .pref-priority-rank {
    background: rgba(var(--vh-primary-rgb), 0.08);
    border-color: rgba(var(--vh-primary-rgb), 0.5);
    color: var(--vh-primary);
}

.pref-priority-item:nth-child(3) .pref-priority-rank {
    background: rgba(var(--vh-primary-rgb), 0.05);
    border-color: rgba(var(--vh-primary-rgb), 0.3);
    color: rgba(var(--vh-primary-rgb), 0.7);
}

.pref-priority-label {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--vh-text);
}

.pref-priority-icon {
    width: 18px;
    height: 18px;
    color: var(--vh-text-muted);
    flex-shrink: 0;
    opacity: 0.5;
}

/* --- 7. Import Interest Toggle with country flags --- */
.pref-import-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-md, 14px);
    border: 1.5px solid var(--vh-border);
    transition: all 0.25s ease;
    gap: 1rem;
}

.pref-import-toggle:hover {
    background: rgba(var(--vh-primary-rgb), 0.03);
    border-color: rgba(var(--vh-primary-rgb), 0.2);
}

.pref-import-toggle.active {
    border-color: rgba(var(--vh-primary-rgb), 0.3);
    background: rgba(var(--vh-primary-rgb), 0.04);
}

.pref-import-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.pref-import-flags {
    display: flex;
    gap: 0.25rem;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.pref-import-text h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.pref-import-text p {
    font-size: 0.8rem;
    color: var(--vh-text-muted);
    line-height: 1.4;
}

/* Country tag pills when import is enabled */
.pref-import-countries {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(var(--vh-primary-rgb), 0.08);
}

.pref-import-country {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    background: var(--vh-surface);
    border: 1px solid var(--vh-border);
    border-radius: var(--radius-pill, 9999px);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--vh-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pref-import-country:hover {
    border-color: rgba(var(--vh-primary-rgb), 0.4);
}

.pref-import-country.active {
    border-color: var(--vh-primary);
    color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.06);
}

.pref-import-country-flag {
    font-size: 0.9rem;
}

/* --- 8. Save Preferences Button with success animation --- */
.pref-save-bar {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    align-items: center;
    padding-top: 0.5rem;
}

.pref-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    background: var(--vh-primary);
    color: #181A20;
    border: 2px solid var(--vh-primary);
    border-radius: var(--radius-md, 14px);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}

.pref-save-btn:hover {
    background: var(--vh-primary-hover);
    border-color: var(--vh-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--vh-primary-rgb), 0.3);
}

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

.pref-save-btn:focus-visible {
    outline: 2px solid var(--vh-primary);
    outline-offset: 3px;
}

.pref-save-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.pref-save-btn:hover svg {
    transform: translateY(-1px);
}

/* Save success state */
.pref-save-btn.success {
    background: var(--vh-success);
    border-color: var(--vh-success);
    pointer-events: none;
    animation: vh-prefSaveSuccess 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.pref-save-btn.success svg {
    animation: vh-prefSaveCheck 0.4s 0.1s ease forwards;
}

@keyframes vh-prefSaveSuccess {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.06); }
    60%  { transform: scale(0.97); }
    100% { transform: scale(1); }
}

@keyframes vh-prefSaveCheck {
    0%   { transform: scale(0) rotate(-45deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Ripple effect on save */
.pref-save-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: inherit;
    transform: scale(0);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.pref-save-btn.success::after {
    transform: scale(2.5);
    opacity: 0;
}

.pref-save-status {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--vh-success);
    opacity: 0;
    transform: translateX(8px);
    transition: all 0.3s ease;
}

.pref-save-status.visible {
    opacity: 1;
    transform: translateX(0);
}

/* --- Pref Section Layout --- */
.pref-section {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--vh-border);
}

.pref-section:last-child {
    border-bottom: none;
}

.pref-section-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--vh-text-muted);
    margin-bottom: 0.75rem;
}

/* --- Location Select --- */
.pref-location-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pref-location-flag {
    font-size: 1.6rem;
    line-height: 1;
}

.pref-select {
    flex: 1;
    padding: 0.6rem 1rem;
    background: var(--vh-surface-alt);
    border: 1.5px solid var(--vh-border);
    border-radius: var(--radius-sm, 8px);
    color: var(--vh-text);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.pref-select:focus {
    outline: none;
    border-color: var(--vh-primary);
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb), 0.12);
}

/* --- Budget Field Inputs --- */
.pref-budget-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pref-budget-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pref-budget-field {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--vh-surface-alt);
    border: 1.5px solid var(--vh-border);
    border-radius: var(--radius-sm, 8px);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pref-budget-field:focus-within {
    border-color: var(--vh-primary);
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb), 0.12);
}

.pref-budget-currency {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--vh-text-muted);
}

.pref-budget-field input[type="number"] {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--vh-text);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    padding: 0;
    min-width: 0;
    -moz-appearance: textfield;
}

.pref-budget-field input[type="number"]::-webkit-outer-spin-button,
.pref-budget-field input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pref-budget-sep {
    font-size: 0.9rem;
    color: var(--vh-text-muted);
    font-weight: 600;
}

.pref-budget-track {
    position: absolute;
    height: 6px;
    background: var(--vh-primary);
    border-radius: var(--radius-xs, 8px);
    top: 0;
    transition: left 0.15s ease, right 0.15s ease;
}

/* --- Drag Hint --- */
.pref-drag-hint {
    font-size: 0.8rem;
    color: var(--vh-text-muted);
    padding: 0 1.5rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pref-drag-hint::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
    opacity: 0.6;
}

/* --- Selection Count Badge --- */
.pref-selection-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--vh-text-muted);
    background: var(--vh-surface-alt);
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-pill, 9999px);
    transition: color 0.2s ease, background 0.2s ease;
}

.pref-selection-count.has-selection {
    color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.1);
}

/* --- Notification Toggle Row --- */
.pref-notif-list {
    display: flex;
    flex-direction: column;
}

.pref-notif-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--vh-border);
    cursor: pointer;
    transition: background 0.2s ease;
}

.pref-notif-row:last-child {
    border-bottom: none;
}

.pref-notif-row:hover {
    background: rgba(var(--vh-primary-rgb), 0.03);
}

.pref-notif-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.pref-notif-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--vh-text);
}

.pref-notif-desc {
    font-size: 0.8rem;
    color: var(--vh-text-muted);
}

/* Toggle switch styling */
.pref-notif-toggle {
    -webkit-appearance: none;
    appearance: none;
    width: 44px;
    height: 24px;
    background: var(--vh-border);
    border-radius: var(--radius-md, 12px);
    position: relative;
    cursor: pointer;
    transition: background 0.25s ease;
    flex-shrink: 0;
}

.pref-notif-toggle::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--vh-surface);
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.pref-notif-toggle:checked {
    background: var(--vh-primary);
}

.pref-notif-toggle:checked::after {
    transform: translateX(20px);
    box-shadow: 0 1px 6px rgba(var(--vh-primary-rgb), 0.4);
}

.pref-notif-toggle:focus-visible {
    outline: 2px solid var(--vh-primary);
    outline-offset: 2px;
}

/* Auto-save badge */
.pref-auto-save-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--vh-success);
    background: rgba(var(--vh-success-rgb), 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill, 9999px);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.pref-auto-save-badge.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Save icon in button */
.pref-save-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* --- Activity Filter Bar --- */
.activity-filter-card {
    overflow: visible;
}

.activity-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
}

.activity-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    flex: 1;
}

.activity-filter-pill {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--vh-text-muted);
    background: var(--vh-surface-alt);
    border: 1.5px solid var(--vh-border);
    border-radius: var(--radius-pill, 9999px);
    cursor: pointer;
    transition: all 0.2s ease;
}

.activity-filter-pill:hover {
    border-color: rgba(var(--vh-primary-rgb), 0.3);
    color: var(--vh-text);
}

.activity-filter-pill.active {
    background: rgba(var(--vh-primary-rgb), 0.12);
    border-color: var(--vh-primary);
    color: var(--vh-primary);
}

/* --- Activity Date Range --- */
.activity-date-range {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.activity-date-input {
    padding: 0.4rem 0.65rem;
    font-size: 0.8rem;
    font-family: inherit;
    color: var(--vh-text);
    background: var(--vh-surface-alt);
    border: 1.5px solid var(--vh-border);
    border-radius: var(--radius-sm, 8px);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.activity-date-input:focus {
    outline: none;
    border-color: var(--vh-primary);
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb), 0.12);
}

/* color-scheme for dark date pickers */
.activity-date-input {
    color-scheme: dark;
}

/* --- Activity Count Badge --- */
.activity-count-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.1);
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-pill, 9999px);
    min-width: 1.5rem;
    text-align: center;
}

.activity-count-badge:empty {
    display: none;
}

/* --- Activity Load More --- */
.activity-load-more {
    display: block;
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.06);
    border: 1.5px dashed rgba(var(--vh-primary-rgb), 0.25);
    border-radius: var(--radius-sm, 8px);
    cursor: pointer;
    transition: all 0.25s ease;
}

.activity-load-more:hover {
    background: rgba(var(--vh-primary-rgb), 0.12);
    border-color: var(--vh-primary);
}

.activity-load-more:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Legacy preference-card (kept for backward compat with existing IDs) --- */
.preferences-grid {
    display: grid;
    gap: 1rem;
}

.preference-card {
    padding: 1.25rem 1.5rem;
    background: var(--vh-surface-alt);
    border: 1.5px solid var(--vh-border);
    border-radius: var(--radius-md, 14px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    gap: 1rem;
    position: relative;
}

.preference-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--vh-primary);
    border-radius: 0 2px 2px 0;
    transition: height 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.preference-card:hover {
    background: rgba(var(--vh-primary-rgb), 0.03);
    border-color: rgba(var(--vh-primary-rgb), 0.25);
    transform: translateX(4px);
}

.preference-card:hover::before {
    height: 60%;
}

.preference-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.preference-info p {
    font-size: 0.85rem;
    color: var(--vh-text-muted);
    line-height: 1.4;
}

.preference-value-display {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--vh-primary);
    white-space: nowrap;
    transition: color 0.3s ease;
    background: rgba(var(--vh-primary-rgb), 0.06);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-pill, 9999px);
    border: 1px solid rgba(var(--vh-primary-rgb), 0.15);
}

/* --- Condition selector (New / Used / Both) pills --- */
.pref-condition-pills {
    display: flex;
    gap: 0.5rem;
}

.pref-condition-pill {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1rem;
    background: var(--vh-surface-alt);
    border: 2px solid var(--vh-border);
    border-radius: var(--radius-sm, 10px);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--vh-text);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.pref-condition-pill:hover {
    border-color: rgba(var(--vh-primary-rgb), 0.4);
}

.pref-condition-pill.active {
    border-color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.06);
    color: var(--vh-primary);
}

.pref-condition-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}


/* ====== SKELETON LOADING STATES ====== */
.skeleton {
    background: linear-gradient(90deg,
        var(--vh-surface-alt) 0%,
        rgba(var(--vh-primary-rgb), 0.06) 50%,
        var(--vh-surface-alt) 100%);
    background-size: 200% 100%;
    animation: vh-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-line {
    height: 14px;
    margin-bottom: 8px;
    border-radius: var(--radius-xs, 8px);
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.long { width: 90%; }

.skeleton-block {
    height: 60px;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
}

/* Session-shaped skeleton */
.skeleton-session {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

.skeleton-session-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm, 10px);
    flex-shrink: 0;
}

.skeleton-session-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skeleton-session-line {
    height: 12px;
    border-radius: var(--radius-xs, 8px);
}

.skeleton-session-line:first-child { width: 60%; }
.skeleton-session-line:last-child { width: 35%; }

/* Activity-shaped skeleton */
.skeleton-activity {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--vh-border);
}

.skeleton-activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-activity-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skeleton-activity-line {
    height: 12px;
    border-radius: var(--radius-xs, 8px);
}

.skeleton-activity-line:first-child { width: 70%; }
.skeleton-activity-line:last-child { width: 45%; }

.skeleton-activity-time {
    width: 60px;
    height: 12px;
    border-radius: var(--radius-xs, 8px);
    flex-shrink: 0;
}

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

/* ---- 1. Skeleton: Account Info ---- */
.skeleton-account {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.skeleton-account-identity {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.skeleton-account-name {
    height: 20px;
    width: 160px;
    border-radius: var(--radius-xs, 8px);
    margin-bottom: 6px;
}

.skeleton-account-email {
    height: 14px;
    width: 200px;
    border-radius: var(--radius-xs, 8px);
}

.skeleton-account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.skeleton-account-detail {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-sm);
}

.skeleton-account-detail-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-xs, 8px);
    flex-shrink: 0;
}

.skeleton-account-detail-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skeleton-account-detail-label {
    height: 10px;
    width: 60%;
    border-radius: var(--radius-xs, 8px);
}

.skeleton-account-detail-value {
    height: 16px;
    width: 80%;
    border-radius: var(--radius-xs, 8px);
}

/* ---- 2. Skeleton: Subscription Plan Card ---- */
.skeleton-subscription {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.skeleton-sub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skeleton-sub-title {
    height: 20px;
    width: 140px;
    border-radius: var(--radius-xs, 8px);
}

.skeleton-sub-badge {
    height: 28px;
    width: 80px;
    border-radius: var(--radius-pill, 9999px);
}

.skeleton-sub-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.skeleton-sub-item {
    padding: 1rem;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skeleton-sub-item-label {
    height: 10px;
    width: 50%;
    border-radius: var(--radius-xs, 8px);
}

.skeleton-sub-item-value {
    height: 18px;
    width: 70%;
    border-radius: var(--radius-xs, 8px);
}

/* Skeleton: Billing Table Rows */
.skeleton-billing-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.skeleton-billing-row:nth-child(even) {
    background: transparent;
}

.skeleton-billing-cell {
    height: 14px;
    border-radius: var(--radius-xs, 8px);
}

.skeleton-billing-cell:nth-child(1) { width: 22%; }
.skeleton-billing-cell:nth-child(2) { width: 30%; flex: 1; }
.skeleton-billing-cell:nth-child(3) { width: 18%; }
.skeleton-billing-cell:nth-child(4) { width: 15%; }

/* ---- 3. Skeleton: Activity Timeline ---- */
.skeleton-timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--vh-border);
    position: relative;
}

.skeleton-timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.skeleton-timeline-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skeleton-timeline-title {
    height: 14px;
    width: 75%;
    border-radius: var(--radius-xs, 8px);
}

.skeleton-timeline-meta {
    height: 11px;
    width: 50%;
    border-radius: var(--radius-xs, 8px);
}

.skeleton-timeline-time {
    width: 70px;
    height: 12px;
    border-radius: var(--radius-xs, 8px);
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
}

.skeleton-timeline-item:nth-child(2) .skeleton-timeline-title { width: 60%; }
.skeleton-timeline-item:nth-child(3) .skeleton-timeline-title { width: 85%; }
.skeleton-timeline-item:nth-child(4) .skeleton-timeline-title { width: 55%; }
.skeleton-timeline-item:nth-child(2) .skeleton-timeline-meta { width: 40%; }
.skeleton-timeline-item:nth-child(3) .skeleton-timeline-meta { width: 55%; }

/* ---- 4. Skeleton: Saved Card Grid ---- */
.skeleton-saved-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.skeleton-saved-card {
    border: 1px solid var(--vh-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    background: var(--vh-surface);
}

.skeleton-saved-card-top {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.skeleton-saved-score {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-saved-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skeleton-saved-title {
    height: 16px;
    width: 70%;
    border-radius: var(--radius-xs, 8px);
}

.skeleton-saved-subtitle {
    height: 12px;
    width: 50%;
    border-radius: var(--radius-xs, 8px);
}

.skeleton-saved-verdict {
    height: 12px;
    width: 90%;
    border-radius: var(--radius-xs, 8px);
    margin-top: 0.5rem;
}

.skeleton-saved-verdict-2 {
    height: 12px;
    width: 65%;
    border-radius: var(--radius-xs, 8px);
    margin-top: 4px;
}

.skeleton-saved-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.skeleton-saved-btn {
    height: 32px;
    width: 80px;
    border-radius: var(--radius-xs);
}

.skeleton-saved-btn:nth-child(2) { width: 64px; }

.skeleton-saved-card:nth-child(2) .skeleton-saved-title { width: 55%; }
.skeleton-saved-card:nth-child(3) .skeleton-saved-title { width: 80%; }
.skeleton-saved-card:nth-child(2) .skeleton-saved-subtitle { width: 40%; }

/* ---- 5. Skeleton: Messages Inbox ---- */
.skeleton-message-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--vh-border);
}

.skeleton-message-row:last-child {
    border-bottom: none;
}

.skeleton-message-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-message-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.skeleton-message-subject {
    height: 14px;
    width: 60%;
    border-radius: var(--radius-xs, 8px);
}

.skeleton-message-meta {
    height: 10px;
    width: 35%;
    border-radius: var(--radius-xs, 8px);
}

.skeleton-message-arrow {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-xs, 8px);
    flex-shrink: 0;
}

.skeleton-message-row:nth-child(2) .skeleton-message-subject { width: 75%; }
.skeleton-message-row:nth-child(3) .skeleton-message-subject { width: 50%; }
.skeleton-message-row:nth-child(4) .skeleton-message-subject { width: 68%; }
.skeleton-message-row:nth-child(2) .skeleton-message-meta { width: 28%; }
.skeleton-message-row:nth-child(3) .skeleton-message-meta { width: 42%; }

/* ---- Skeleton stagger delay ---- */
.skeleton-account-detail:nth-child(2),
.skeleton-timeline-item:nth-child(2),
.skeleton-saved-card:nth-child(2),
.skeleton-message-row:nth-child(2),
.skeleton-billing-row:nth-child(2),
.skeleton-sub-item:nth-child(2) { animation-delay: 0.1s; }

.skeleton-account-detail:nth-child(3),
.skeleton-timeline-item:nth-child(3),
.skeleton-saved-card:nth-child(3),
.skeleton-message-row:nth-child(3),
.skeleton-billing-row:nth-child(3),
.skeleton-sub-item:nth-child(3) { animation-delay: 0.2s; }

.skeleton-account-detail:nth-child(4),
.skeleton-message-row:nth-child(4),
.skeleton-billing-row:nth-child(4),
.skeleton-sub-item:nth-child(4) { animation-delay: 0.3s; }

.skeleton-account-detail:nth-child(5),
.skeleton-message-row:nth-child(5),
.skeleton-billing-row:nth-child(5) { animation-delay: 0.4s; }

@media (max-width: 768px) {
    .skeleton-sub-grid {
        grid-template-columns: 1fr;
    }
    .skeleton-account-grid {
        grid-template-columns: 1fr;
    }
}

/* ====== LOADING STATE ====== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--vh-text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--vh-border);
    border-top-color: var(--vh-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 1rem;
}

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

/* ---- Inline Action Spinner (non-overlay) ---- */
.inline-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(var(--vh-primary-rgb), 0.2);
    border-top-color: var(--vh-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    flex-shrink: 0;
}

.inline-spinner.sm {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

.inline-spinner.lg {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

/* Spinner inside buttons */
.btn-loading {
    position: relative;
    pointer-events: none;
    color: transparent;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2.5px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--vh-surface);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-loading.btn-loading-dark::after {
    border-color: rgba(var(--vh-primary-rgb), 0.2);
    border-top-color: var(--vh-primary);
}

/* Inline loading next to text */
.action-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--vh-text-muted);
    font-size: 0.85rem;
}

/* ====== EMPTY STATES (Enhanced) ====== */
.empty-state {
    text-align: center;
    padding: 3.5rem 2rem;
    color: var(--vh-text-muted);
    animation: vh-emptyFadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

@keyframes vh-emptyFadeIn {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.3;
}

/* SVG icon container for empty states */
.empty-state-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(var(--vh-primary-rgb), 0.06);
    border: 1.5px solid rgba(var(--vh-primary-rgb), 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    animation: vh-emptyIconFloat 3s ease-in-out infinite;
    position: relative;
}

.empty-state-icon-wrap svg {
    width: 32px;
    height: 32px;
    color: var(--vh-primary);
    opacity: 0.65;
    transition: opacity 0.3s ease;
}

.empty-state:hover .empty-state-icon-wrap svg {
    opacity: 0.85;
}

/* Subtle ring glow behind the icon */
.empty-state-icon-wrap::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(var(--vh-primary-rgb), 0.06);
    animation: vh-emptyRingPulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes vh-emptyIconFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

@keyframes vh-emptyRingPulse {
    0%, 100% { opacity: 0; transform: scale(1); }
    50%      { opacity: 1; transform: scale(1.08); }
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--vh-text);
    margin-bottom: 0.25rem;
}

.empty-state-text {
    font-size: 0.9rem;
    color: var(--vh-text-muted);
    max-width: 320px;
    line-height: 1.5;
}

/* Empty state CTA button */
.empty-state-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    margin-top: 0.75rem;
    background: rgba(var(--vh-primary-rgb), 0.1);
    color: var(--vh-primary);
    border: 1.5px solid rgba(var(--vh-primary-rgb), 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.empty-state-cta:hover {
    background: rgba(var(--vh-primary-rgb), 0.18);
    border-color: rgba(var(--vh-primary-rgb), 0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(var(--vh-primary-rgb), 0.15);
}

.empty-state-cta:focus-visible {
    outline: 2px solid var(--vh-primary);
    outline-offset: 2px;
}

.empty-state-cta svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Empty state link */
.empty-state-link {
    color: var(--vh-primary);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    transition: color 0.2s ease;
    margin-top: 0.25rem;
}

.empty-state-link:hover {
    color: var(--vh-primary-hover, #e0b640);
    text-decoration: underline;
}

/* ---- 6. Empty: No Searches ---- */
.empty-state-searches .empty-state-icon-wrap {
    background: rgba(var(--vh-primary-rgb), 0.08);
}

/* ---- 7. Empty: No Saved Items ---- */
.empty-state-saved .empty-state-icon-wrap {
    background: rgba(59, 130, 246, 0.06);
    border-color: rgba(59, 130, 246, 0.1);
}

.empty-state-saved .empty-state-icon-wrap svg {
    color: #3B82F6;
}

.empty-state-saved .empty-state-icon-wrap::before {
    border-color: rgba(59, 130, 246, 0.06);
}

/* ---- 8. Empty: No Messages ---- */
.empty-state-messages .empty-state-icon-wrap {
    background: rgba(139, 92, 246, 0.06);
    border-color: rgba(139, 92, 246, 0.1);
}

.empty-state-messages .empty-state-icon-wrap svg {
    color: #8B5CF6;
}

.empty-state-messages .empty-state-icon-wrap::before {
    border-color: rgba(139, 92, 246, 0.06);
}

/* ---- 9. Empty: No Activity ---- */
.empty-state-activity .empty-state-icon-wrap {
    background: rgba(var(--vh-success-rgb), 0.06);
    border-color: rgba(var(--vh-success-rgb), 0.1);
}

.empty-state-activity .empty-state-icon-wrap svg {
    color: var(--vh-success);
}

.empty-state-activity .empty-state-icon-wrap::before {
    border-color: rgba(var(--vh-success-rgb), 0.06);
}

/* ---- 10. Empty: No Billing ---- */
.empty-state-billing .empty-state-icon-wrap {
    background: rgba(6, 182, 212, 0.06);
    border-color: rgba(6, 182, 212, 0.1);
}

.empty-state-billing .empty-state-icon-wrap svg {
    color: #06B6D4;
}

.empty-state-billing .empty-state-icon-wrap::before {
    border-color: rgba(6, 182, 212, 0.06);
}

/* ====== MODAL ====== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

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

.modal {
    background: var(--vh-surface);
    border: 1.5px solid var(--vh-border);
    border-radius: var(--radius-xl, 22px);
    max-width: 520px;
    width: 92%;
    padding: 0;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35),
                0 0 0 1px rgba(255, 255, 255, 0.04);
    transform: translateY(24px) scale(0.92);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}

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

/* Modal closing animation class */
.modal-overlay.closing {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.closing .modal {
    transform: translateY(12px) scale(0.95);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
    padding: 2rem 2rem 0;
    margin-bottom: 0.25rem;
}

.modal-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.modal-description {
    color: var(--vh-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.modal-body {
    padding: 1.5rem 2rem 0.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

/* Edit mode expand/collapse */
.form-group.expanding {
    overflow: hidden;
    animation: vh-formExpand 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes vh-formExpand {
    from { max-height: 0; opacity: 0; margin-bottom: 0; }
    to   { max-height: 200px; opacity: 1; margin-bottom: 1.5rem; }
}

.form-group.collapsing {
    overflow: hidden;
    animation: vh-formCollapse 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes vh-formCollapse {
    from { max-height: 200px; opacity: 1; margin-bottom: 1.5rem; }
    to   { max-height: 0; opacity: 0; margin-bottom: 0; }
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--vh-text);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--vh-border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: var(--vh-surface);
    color: var(--vh-text);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--vh-primary);
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb), 0.15);
}

.form-input:focus-visible {
    outline: none;
    border-color: var(--vh-primary);
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb), 0.25);
}

/* Form validation feedback */
.form-input.input-error {
    border-color: var(--vh-error);
    animation: vh-inputShake 0.4s ease;
    box-shadow: 0 0 0 3px rgba(var(--vh-error-rgb), 0.15);
}

.form-input.input-success {
    border-color: var(--vh-success);
    box-shadow: 0 0 0 3px rgba(var(--vh-success-rgb), 0.15);
}

.form-input-hint {
    font-size: 0.78rem;
    margin-top: 0.35rem;
    transition: opacity 0.25s ease, transform 0.25s ease;
    opacity: 0;
    transform: translateY(-4px);
}

.form-input-hint.visible {
    opacity: 1;
    transform: translateY(0);
}

.form-input-hint.error {
    color: var(--vh-error);
}

.form-input-hint.success {
    color: var(--vh-success);
}

@keyframes vh-inputShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--vh-border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: var(--vh-surface);
    color: var(--vh-text);
    cursor: pointer;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-select:focus {
    outline: none;
    border-color: var(--vh-primary);
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb), 0.15);
}

.form-select:focus-visible {
    outline: none;
    border-color: var(--vh-primary);
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb), 0.25);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 0 2rem 2rem;
}

.modal-btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--vh-border);
    position: relative;
    overflow: hidden;
}

.modal-btn:focus-visible {
    outline: 3px solid var(--vh-primary);
    outline-offset: 3px;
}

.modal-btn-cancel {
    background: var(--vh-surface);
    color: var(--vh-text);
}

.modal-btn-cancel:hover {
    border-color: var(--vh-text);
    transform: translateY(-1px);
}

.modal-btn-confirm {
    background: var(--vh-primary);
    color: var(--vh-text);
    border-color: var(--vh-primary);
}

.modal-btn-confirm:hover {
    background: var(--vh-primary-hover);
    border-color: var(--vh-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--vh-primary-rgb), 0.3);
}

.modal-btn-confirm:disabled {
    background: rgba(var(--vh-primary-rgb), 0.15);
    border-color: rgba(var(--vh-primary-rgb), 0.15);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.modal-btn-danger {
    background: var(--vh-error);
    color: var(--vh-surface);
    border-color: var(--vh-error);
}

.modal-btn-danger:hover {
    background: var(--vh-error);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(var(--vh-error-rgb), 0.35);
}

.modal-btn-danger:disabled {
    background: rgba(var(--vh-error-rgb), 0.25);
    border-color: rgba(var(--vh-error-rgb), 0.25);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    color: rgba(255, 255, 255, 0.5);
}

/* ====== EDIT NAME MODAL ====== */
#editAccountModal .modal {
    border-top: 3px solid var(--vh-primary);
}

/* ====== CHANGE PASSWORD MODAL ====== */
#changePasswordModal .modal {
    border-top: 3px solid var(--vh-primary);
}

/* Password strength indicator bar */
.password-strength-bar {
    height: 4px;
    border-radius: var(--radius-xs, 8px);
    background: var(--vh-border);
    margin-top: 0.5rem;
    overflow: hidden;
    position: relative;
}

.password-strength-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    border-radius: var(--radius-xs, 8px);
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.4s ease;
}

.password-strength-bar.strength-weak::after {
    width: 25%;
    background: var(--vh-error);
}

.password-strength-bar.strength-fair::after {
    width: 50%;
    background: var(--vh-warning);
}

.password-strength-bar.strength-good::after {
    width: 75%;
    background: var(--vh-success);
}

.password-strength-bar.strength-strong::after {
    width: 100%;
    background: #10B981;
}

.password-strength-label {
    font-size: 0.75rem;
    margin-top: 0.35rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.password-strength-label.weak { color: var(--vh-error); }
.password-strength-label.fair { color: var(--vh-warning); }
.password-strength-label.good { color: var(--vh-success); }
.password-strength-label.strong { color: #10B981; }

/* Password visibility toggle */
.password-input-wrap {
    position: relative;
}

.password-input-wrap .form-input {
    padding-right: 2.8rem;
}

.password-toggle-btn {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--vh-text-muted);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: var(--radius-xs, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background 0.2s ease;
}

.password-toggle-btn:hover {
    color: var(--vh-text);
    background: rgba(255, 255, 255, 0.06);
}

.password-toggle-btn svg {
    width: 18px;
    height: 18px;
}

/* ====== DELETE ACCOUNT MODAL (DANGER) ====== */
#deleteAccountModal .modal {
    border-top: 3px solid var(--vh-error);
}

#deleteAccountModal .modal-title {
    color: var(--vh-error);
}

/* ====== CONTEXT CHANGE MODAL ====== */
#contextModal .modal {
    border-top: 3px solid var(--vh-primary);
}

/* Visual card selection for context (buyer/dealer) */
.context-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.context-card-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: var(--vh-surface-alt);
    border: 2px solid var(--vh-border);
    border-radius: var(--radius-lg, 16px);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    text-align: center;
}

.context-card-option:hover {
    border-color: var(--vh-text-muted);
    background: var(--vh-bg-highlight);
    transform: translateY(-2px);
}

.context-card-option.selected {
    border-color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.06);
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb), 0.12),
                0 4px 16px rgba(var(--vh-primary-rgb), 0.1);
}

.context-card-option.selected::after {
    content: '';
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--vh-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%231a1a2e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px;
}

.context-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md, 12px);
    background: rgba(var(--vh-primary-rgb), 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--vh-primary);
    transition: transform 0.3s ease;
}

.context-card-option:hover .context-card-icon {
    transform: scale(1.1);
}

.context-card-option.selected .context-card-icon {
    background: rgba(var(--vh-primary-rgb), 0.15);
}

.context-card-label {
    font-weight: 700;
    font-size: 0.95rem;
}

.context-card-desc {
    font-size: 0.8rem;
    color: var(--vh-text-muted);
    line-height: 1.4;
}

.context-card-option input[type="radio"] {
    display: none;
}

/* ====== EDIT PREFERENCES MODAL ====== */
#editPreferencesModal .modal,
#editOnboardingModal .modal {
    border-top: 3px solid var(--vh-primary);
}

/* ====== CONFIRMATION DIALOG ====== */
.confirm-dialog-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg, 18px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.confirm-dialog-icon.warning {
    background: rgba(var(--vh-primary-rgb), 0.12);
    color: var(--vh-primary);
}

.confirm-dialog-icon.danger {
    background: rgba(var(--vh-error-rgb), 0.12);
    color: var(--vh-error);
}

.confirm-dialog-icon.info {
    background: rgba(59, 130, 246, 0.12);
    color: #3B82F6;
}

.confirm-dialog-icon svg {
    width: 24px;
    height: 24px;
}

.confirm-dialog-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.confirm-dialog-desc {
    font-size: 0.88rem;
    color: var(--vh-text-muted);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

/* ====== LOADING OVERLAY ====== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.loading-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 2.5rem;
    background: var(--vh-surface);
    border: 1.5px solid var(--vh-border);
    border-radius: var(--radius-xl, 22px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.loading-overlay-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--vh-text-muted);
}

/* ====== CHECKBOX GROUP ====== */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: var(--vh-surface-alt);
    border: 1px solid var(--vh-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.checkbox-label:hover {
    border-color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.04);
}

.checkbox-label:has(input:checked) {
    background: rgba(var(--vh-primary-rgb), 0.08);
    border-color: var(--vh-primary);
}

.checkbox-label input {
    width: 14px;
    height: 14px;
    accent-color: var(--vh-primary);
}

/* ====== TOAST NOTIFICATIONS ====== */
.toast {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--vh-surface);
    color: var(--vh-text);
    padding: 0;
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(255, 255, 255, 0.06);
    transform: translateX(calc(100% + 2rem));
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.3s ease;
    z-index: 2000;
    font-weight: 500;
    max-width: 380px;
    min-width: 280px;
    overflow: hidden;
    border: 1.5px solid var(--vh-border);
}

.toast-inner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
}

.toast-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.toast-message {
    font-size: 0.82rem;
    color: var(--vh-text-muted);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--vh-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-xs, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--vh-text);
    background: rgba(255, 255, 255, 0.06);
}

.toast-close svg {
    width: 16px;
    height: 16px;
}

/* Toast auto-dismiss progress bar */
.toast-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
}

.toast-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    transform-origin: left;
    animation: vh-toastProgress 4s linear forwards;
    border-radius: 0 3px 3px 0;
}

@keyframes vh-toastProgress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

.toast.show {
    transform: translateX(0);
    animation: vh-toastIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.hiding {
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
}

@keyframes vh-toastIn {
    0%   { transform: translateX(calc(100% + 2rem)); opacity: 0; }
    60%  { transform: translateX(-6px); }
    100% { transform: translateX(0); opacity: 1; }
}

/* Toast type variants */
.toast.success {
    border-color: rgba(var(--vh-success-rgb), 0.25);
}

.toast.success .toast-icon {
    color: var(--vh-success);
}

.toast.success .toast-progress-bar {
    background: var(--vh-success);
}

.toast.error {
    border-color: rgba(var(--vh-error-rgb), 0.25);
}

.toast.error .toast-icon {
    color: var(--vh-error);
}

.toast.error .toast-progress-bar {
    background: var(--vh-error);
}

.toast.warning {
    border-color: rgba(var(--vh-primary-rgb), 0.25);
}

.toast.warning .toast-icon {
    color: var(--vh-primary);
}

.toast.warning .toast-progress-bar {
    background: var(--vh-primary);
}

.toast.info {
    border-color: rgba(59, 130, 246, 0.25);
}

.toast.info .toast-icon {
    color: #3B82F6;
}

.toast.info .toast-progress-bar {
    background: #3B82F6;
}

/* Legacy toast fallback (no inner structure) */
.toast:not(:has(.toast-inner)) {
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--vh-primary);
}

.toast.success:not(:has(.toast-inner)) {
    border-left-color: var(--vh-success);
    background: var(--vh-surface);
    color: var(--vh-text);
}

.toast.error:not(:has(.toast-inner)) {
    border-left-color: var(--vh-error);
    background: var(--vh-surface);
    color: var(--vh-text);
}

/* Toast stack spacing (for multiple toasts) */
.toast:nth-child(2) { top: calc(1.5rem + 80px); }
.toast:nth-child(3) { top: calc(1.5rem + 160px); }
.toast:nth-child(4) { top: calc(1.5rem + 240px); }

/* ====== SAVED TAB: SORT / FILTER BAR ====== */
.saved-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.saved-toolbar-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--vh-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.saved-sort-btn {
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-xs);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--vh-border);
    background: var(--vh-surface);
    color: var(--vh-text-secondary);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.saved-sort-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.saved-sort-btn:hover {
    border-color: var(--vh-primary);
    color: var(--vh-text);
    background: rgba(var(--vh-primary-rgb), 0.06);
}

.saved-sort-btn:hover svg {
    opacity: 1;
}

.saved-sort-btn.active {
    border-color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.12);
    color: var(--vh-primary);
    font-weight: 600;
}

.saved-sort-btn.active svg {
    opacity: 1;
}

.saved-sort-btn:focus-visible {
    outline: 2px solid var(--vh-primary);
    outline-offset: 1px;
}

.saved-results-count {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--vh-text-tertiary);
}

/* ====== SAVED CARDS GRID ====== */
.saved-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

@media (max-width: 1024px) {
    .saved-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .saved-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ====== SAVED CARD ====== */
.saved-card {
    border: 1px solid var(--vh-border);
    border-radius: var(--radius-md);
    background: var(--vh-surface);
    transition: box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* Staggered entrance animation */
    opacity: 0;
    animation: savedCardEntrance 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Stagger delays for each card (up to 12) */
.saved-card:nth-child(1)  { animation-delay: 0.04s; }
.saved-card:nth-child(2)  { animation-delay: 0.08s; }
.saved-card:nth-child(3)  { animation-delay: 0.12s; }
.saved-card:nth-child(4)  { animation-delay: 0.16s; }
.saved-card:nth-child(5)  { animation-delay: 0.20s; }
.saved-card:nth-child(6)  { animation-delay: 0.24s; }
.saved-card:nth-child(7)  { animation-delay: 0.28s; }
.saved-card:nth-child(8)  { animation-delay: 0.32s; }
.saved-card:nth-child(9)  { animation-delay: 0.36s; }
.saved-card:nth-child(10) { animation-delay: 0.40s; }
.saved-card:nth-child(11) { animation-delay: 0.44s; }
.saved-card:nth-child(12) { animation-delay: 0.48s; }

@keyframes savedCardEntrance {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (hover: hover) {
    .saved-card:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25),
                    0 0 0 1px rgba(var(--vh-primary-rgb), 0.15);
        transform: translateY(-4px);
        border-color: var(--vh-primary);
    }
}

/* -- Thumbnail -- */
.saved-card-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--vh-surface-alt);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.saved-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.saved-card:hover .saved-card-thumb img {
    transform: scale(1.05);
}

/* Placeholder when no image */
.saved-card-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--vh-text-tertiary);
    background: linear-gradient(135deg, var(--vh-surface-alt) 0%, var(--vh-bg) 100%);
}

.saved-card-thumb-placeholder svg {
    width: 40px;
    height: 40px;
    opacity: 0.35;
}

/* Score badge overlaid on thumbnail */
.saved-card-score {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    flex-shrink: 0;
    color: var(--vh-surface);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.saved-card:hover .saved-card-score {
    transform: scale(1.12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.saved-card-score.good { background: var(--vh-success); }
.saved-card-score.fair { background: #E2A100; }
.saved-card-score.bad  { background: var(--vh-error); }

/* -- Card body -- */
.saved-card-body {
    padding: 1rem 1.15rem 0.75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.saved-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

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

.saved-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--vh-text);
    line-height: 1.35;
    margin-bottom: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.saved-card-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--vh-primary);
    margin-bottom: 0.15rem;
}

.saved-card-subtitle {
    font-size: 0.8rem;
    color: var(--vh-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.saved-card-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill, 9999px);
    margin-top: 0.4rem;
}

.saved-card-badge.good { background: rgba(var(--vh-success-rgb), 0.12); color: var(--vh-success); }
.saved-card-badge.fair { background: rgba(var(--vh-warning-rgb), 0.12); color: var(--vh-warning); }
.saved-card-badge.bad  { background: rgba(var(--vh-error-rgb), 0.12); color: var(--vh-error); }
.saved-card-badge.info { background: rgba(59, 130, 246, 0.12); color: #3B82F6; }

.saved-card-verdict {
    font-size: 0.84rem;
    color: var(--vh-text-secondary);
    line-height: 1.45;
    margin-top: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.saved-card-meta {
    font-size: 0.72rem;
    color: var(--vh-text-tertiary);
    margin-top: auto;
    padding-top: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.saved-card-meta svg {
    width: 12px;
    height: 12px;
    opacity: 0.5;
    flex-shrink: 0;
}

/* ====== SAVED CARD ACTIONS ====== */
.saved-card-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.65rem 1.15rem 1rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--vh-border);
    margin-top: 0;
}

.saved-card-btn {
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-xs);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--vh-border);
    background: var(--vh-surface);
    color: var(--vh-text-secondary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.saved-card-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.saved-card-btn:hover {
    background: var(--vh-bg-highlight);
    transform: translateY(-1px);
    border-color: var(--vh-text-tertiary);
}

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

.saved-card-btn:focus-visible {
    outline: 3px solid var(--vh-primary);
    outline-offset: 3px;
}

/* View Analysis button */
.saved-card-btn.primary {
    background: var(--vh-primary);
    color: #1a1a2e;
    border-color: var(--vh-primary);
    font-weight: 600;
}

.saved-card-btn.primary:hover {
    background: var(--vh-primary-hover);
    border-color: var(--vh-primary-hover);
    box-shadow: 0 2px 8px rgba(var(--vh-primary-rgb), 0.25);
}

/* Share button */
.saved-card-btn.share {
    border-color: transparent;
    background: none;
}

.saved-card-btn.share:hover {
    background: rgba(var(--vh-primary-rgb), 0.08);
    color: var(--vh-primary);
}

/* Remove button with confirmation micro-interaction */
.saved-card-btn.remove {
    color: var(--vh-text-tertiary);
    border-color: transparent;
    background: none;
    margin-left: auto;
    position: relative;
    overflow: hidden;
}

.saved-card-btn.remove::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--vh-error);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
    z-index: 0;
}

.saved-card-btn.remove:hover {
    color: var(--vh-surface);
    border-color: var(--vh-error);
}

.saved-card-btn.remove:hover::before {
    opacity: 1;
}

.saved-card-btn.remove span,
.saved-card-btn.remove svg {
    position: relative;
    z-index: 1;
}

/* Confirmation state: after first click, shows "Sure?" */
.saved-card-btn.remove.confirming {
    color: var(--vh-surface);
    border-color: var(--vh-error);
    animation: savedRemoveShake 0.35s ease;
}

.saved-card-btn.remove.confirming::before {
    opacity: 1;
}

@keyframes savedRemoveShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-3px); }
    40%      { transform: translateX(3px); }
    60%      { transform: translateX(-2px); }
    80%      { transform: translateX(2px); }
}

/* ====== SAVED EMPTY STATE ====== */
.saved-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3.5rem 2rem;
    gap: 1rem;
}

.saved-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(var(--vh-primary-rgb), 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    animation: savedEmptyPulse 3s ease-in-out infinite;
}

.saved-empty-icon svg {
    width: 36px;
    height: 36px;
    color: var(--vh-primary);
    opacity: 0.7;
}

@keyframes savedEmptyPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.06); opacity: 0.85; }
}

.saved-empty-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--vh-text);
}

.saved-empty-desc {
    font-size: 0.9rem;
    color: var(--vh-text-muted);
    max-width: 320px;
    line-height: 1.5;
}

.saved-empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius-sm);
    background: var(--vh-primary);
    color: #1a1a2e;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.saved-empty-cta:hover {
    background: var(--vh-primary-hover);
    box-shadow: 0 4px 16px rgba(var(--vh-primary-rgb), 0.3);
    transform: translateY(-1px);
}

.saved-empty-cta svg {
    width: 16px;
    height: 16px;
}

/* ====== SAVED LOADING SKELETON ====== */
.saved-skeleton {
    border: 1px solid var(--vh-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--vh-surface);
}

.saved-skeleton-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(
        110deg,
        var(--vh-surface-alt) 30%,
        rgba(255, 255, 255, 0.04) 50%,
        var(--vh-surface-alt) 70%
    );
    background-size: 200% 100%;
    animation: savedSkeletonShimmer 1.5s ease-in-out infinite;
}

.saved-skeleton-body {
    padding: 1rem 1.15rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.saved-skeleton-line {
    height: 12px;
    border-radius: var(--radius-xs, 8px);
    background: linear-gradient(
        110deg,
        var(--vh-surface-alt) 30%,
        rgba(255, 255, 255, 0.04) 50%,
        var(--vh-surface-alt) 70%
    );
    background-size: 200% 100%;
    animation: savedSkeletonShimmer 1.5s ease-in-out infinite;
}

.saved-skeleton-line.title {
    width: 75%;
    height: 14px;
}

.saved-skeleton-line.price {
    width: 40%;
    height: 16px;
}

.saved-skeleton-line.subtitle {
    width: 60%;
}

.saved-skeleton-line.meta {
    width: 45%;
    height: 10px;
    margin-top: 0.5rem;
}

.saved-skeleton-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.65rem 1.15rem 1rem;
    border-top: 1px solid var(--vh-border);
}

.saved-skeleton-btn {
    height: 30px;
    border-radius: var(--radius-xs);
    flex: 1;
    background: linear-gradient(
        110deg,
        var(--vh-surface-alt) 30%,
        rgba(255, 255, 255, 0.04) 50%,
        var(--vh-surface-alt) 70%
    );
    background-size: 200% 100%;
    animation: savedSkeletonShimmer 1.5s ease-in-out infinite;
}

/* Stagger skeleton shimmer */
.saved-skeleton:nth-child(1) .saved-skeleton-thumb,
.saved-skeleton:nth-child(1) .saved-skeleton-line,
.saved-skeleton:nth-child(1) .saved-skeleton-btn { animation-delay: 0s; }
.saved-skeleton:nth-child(2) .saved-skeleton-thumb,
.saved-skeleton:nth-child(2) .saved-skeleton-line,
.saved-skeleton:nth-child(2) .saved-skeleton-btn { animation-delay: 0.15s; }
.saved-skeleton:nth-child(3) .saved-skeleton-thumb,
.saved-skeleton:nth-child(3) .saved-skeleton-line,
.saved-skeleton:nth-child(3) .saved-skeleton-btn { animation-delay: 0.3s; }
.saved-skeleton:nth-child(4) .saved-skeleton-thumb,
.saved-skeleton:nth-child(4) .saved-skeleton-line,
.saved-skeleton:nth-child(4) .saved-skeleton-btn { animation-delay: 0.45s; }
.saved-skeleton:nth-child(5) .saved-skeleton-thumb,
.saved-skeleton:nth-child(5) .saved-skeleton-line,
.saved-skeleton:nth-child(5) .saved-skeleton-btn { animation-delay: 0.6s; }
.saved-skeleton:nth-child(6) .saved-skeleton-thumb,
.saved-skeleton:nth-child(6) .saved-skeleton-line,
.saved-skeleton:nth-child(6) .saved-skeleton-btn { animation-delay: 0.75s; }

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

/* ====== SAVED TOOLBAR ENHANCEMENTS ====== */
#savedTab .saved-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.saved-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--vh-text-muted);
    white-space: nowrap;
}

.saved-sort-btns {
    display: flex;
    gap: 0.35rem;
}

/* ====== SAVED CARD SLIDE-OUT REMOVAL ====== */
.saved-card.removing {
    animation: savedCardSlideOut 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

@keyframes savedCardSlideOut {
    0%   { opacity: 1; transform: translateX(0) scale(1); max-height: 500px; }
    50%  { opacity: 0; transform: translateX(40px) scale(0.95); }
    100% { opacity: 0; transform: translateX(60px) scale(0.9); max-height: 0; margin-bottom: 0; padding: 0; border-width: 0; overflow: hidden; }
}

/* Remove confirmation overlay on card */
.saved-card-confirm-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(15, 15, 30, 0.92);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    opacity: 0;
    animation: savedConfirmFadeIn 0.25s ease forwards;
    border-radius: inherit;
}

@keyframes savedConfirmFadeIn {
    to { opacity: 1; }
}

.saved-card-confirm-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--vh-text);
    text-align: center;
}

.saved-card-confirm-actions {
    display: flex;
    gap: 0.5rem;
}

.saved-card-confirm-btn {
    padding: 0.45rem 1.1rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-xs, 8px);
    border: 1px solid var(--vh-border);
    background: var(--vh-surface);
    color: var(--vh-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.saved-card-confirm-btn:hover {
    border-color: var(--vh-text);
}

.saved-card-confirm-btn.danger {
    background: var(--vh-error);
    border-color: var(--vh-error);
    color: var(--vh-surface);
}

.saved-card-confirm-btn.danger:hover {
    background: var(--vh-error);
    box-shadow: 0 4px 12px rgba(var(--vh-error-rgb), 0.3);
}

/* Saved card hover action buttons reveal */
.saved-card-hover-actions {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    display: flex;
    gap: 0.35rem;
    z-index: 3;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

@media (hover: hover) {
    .saved-card:hover .saved-card-hover-actions {
        opacity: 1;
        transform: translateY(0);
    }
}

.saved-card-hover-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs, 8px);
    border: none;
    background: rgba(15, 15, 30, 0.75);
    backdrop-filter: blur(4px);
    color: var(--vh-surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.15s ease;
}

.saved-card-hover-btn:hover {
    background: var(--vh-primary);
    color: #1a1a2e;
    transform: scale(1.08);
}

.saved-card-hover-btn svg {
    width: 15px;
    height: 15px;
}

/* ====== MESSAGE SKELETON ====== */
.msg-skeleton {
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--vh-border);
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.msg-skeleton:last-child { border-bottom: none; }

.msg-skeleton-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-top: 0.35rem;
    flex-shrink: 0;
    background: linear-gradient(110deg, var(--vh-surface-alt) 30%, rgba(255,255,255,0.04) 50%, var(--vh-surface-alt) 70%);
    background-size: 200% 100%;
    animation: savedSkeletonShimmer 1.5s ease-in-out infinite;
}

.msg-skeleton-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.msg-skeleton-line {
    height: 12px;
    border-radius: var(--radius-xs, 8px);
    background: linear-gradient(110deg, var(--vh-surface-alt) 30%, rgba(255,255,255,0.04) 50%, var(--vh-surface-alt) 70%);
    background-size: 200% 100%;
    animation: savedSkeletonShimmer 1.5s ease-in-out infinite;
}

.msg-skeleton-line.subject { width: 55%; height: 14px; }
.msg-skeleton-line.preview { width: 80%; }
.msg-skeleton-line.meta    { width: 35%; height: 10px; }

.msg-skeleton:nth-child(1) .msg-skeleton-line,
.msg-skeleton:nth-child(1) .msg-skeleton-dot { animation-delay: 0s; }
.msg-skeleton:nth-child(2) .msg-skeleton-line,
.msg-skeleton:nth-child(2) .msg-skeleton-dot { animation-delay: 0.15s; }
.msg-skeleton:nth-child(3) .msg-skeleton-line,
.msg-skeleton:nth-child(3) .msg-skeleton-dot { animation-delay: 0.3s; }
.msg-skeleton:nth-child(4) .msg-skeleton-line,
.msg-skeleton:nth-child(4) .msg-skeleton-dot { animation-delay: 0.45s; }
.msg-skeleton:nth-child(5) .msg-skeleton-line,
.msg-skeleton:nth-child(5) .msg-skeleton-dot { animation-delay: 0.6s; }

/* ====== MESSAGES EMPTY STATE ====== */
.messages-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3.5rem 2rem;
    gap: 1rem;
}

.messages-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(var(--vh-primary-rgb), 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    animation: savedEmptyPulse 3s ease-in-out infinite;
}

.messages-empty-icon svg {
    width: 36px;
    height: 36px;
    color: var(--vh-primary);
    opacity: 0.7;
}

.messages-empty-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--vh-text);
}

.messages-empty-desc {
    font-size: 0.9rem;
    color: var(--vh-text-muted);
    max-width: 320px;
    line-height: 1.5;
}

.messages-empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius-sm);
    background: var(--vh-primary);
    color: #1a1a2e;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.messages-empty-cta:hover {
    background: var(--vh-primary-hover);
    box-shadow: 0 4px 16px rgba(var(--vh-primary-rgb), 0.3);
    transform: translateY(-1px);
}

.messages-empty-cta svg { width: 16px; height: 16px; }

/* ====== MESSAGE THREAD BUBBLES ENTRANCE ====== */
.message-bubble {
    opacity: 0;
    animation: msgBubbleIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.message-bubble:nth-child(1) { animation-delay: 0.05s; }
.message-bubble:nth-child(2) { animation-delay: 0.1s; }
.message-bubble:nth-child(3) { animation-delay: 0.15s; }
.message-bubble:nth-child(4) { animation-delay: 0.2s; }
.message-bubble:nth-child(5) { animation-delay: 0.25s; }
.message-bubble:nth-child(6) { animation-delay: 0.3s; }
.message-bubble:nth-child(7) { animation-delay: 0.35s; }
.message-bubble:nth-child(8) { animation-delay: 0.4s; }

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

.message-bubble.just-sent {
    animation: msgJustSent 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes msgJustSent {
    0%   { opacity: 0; transform: translateY(16px) scale(0.95); }
    60%  { transform: translateY(-2px) scale(1.01); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ====== MOBILE RESPONSIVE: SAVED CARDS & MESSAGES ====== */
@media (max-width: 768px) {
    #savedTab .saved-toolbar { gap: 0.5rem; }
    .saved-sort-btns { gap: 0.25rem; }
    .saved-sort-btn span { display: none; }
    .saved-sort-btn { padding: 0.4rem 0.6rem; }
    .saved-card-body { padding: 0.85rem 1rem 0.65rem; }
    .saved-card-actions { padding: 0.55rem 1rem 0.85rem; flex-wrap: wrap; }
    .saved-card-btn { flex: 1; min-width: 0; justify-content: center; font-size: 0.78rem; padding: 0.5rem 0.65rem; }
    .message-item { padding: 0.85rem 1rem; }
    .message-item-subject { font-size: 0.85rem; }
    .message-thread-body { max-height: 320px; padding: 1rem 0.85rem; }
    .message-bubble { max-width: 90%; font-size: 0.85rem; padding: 0.75rem 0.95rem; }
    .message-reply-textarea { min-height: 60px; font-size: 0.85rem; }
    .message-reply-area { padding: 0.85rem 1rem; }
    .message-send-btn { padding: 0.5rem 1rem; font-size: 0.8rem; }
}

@media (max-width: 480px) {
    .saved-cards-grid { grid-template-columns: 1fr; gap: 1rem; }
    .saved-card-hover-actions { opacity: 1; transform: translateY(0); }
    .message-thread-header { padding: 0.65rem 0.85rem; }
    .message-thread-title { font-size: 0.9rem; }
    .message-bubble { max-width: 92%; }
}

/* ====== TOGGLE SWITCH ====== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg, 18px);
    transition: background 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 2.5px;
    background: var(--vh-text-muted);
    border-radius: 50%;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                width 0.2s ease,
                background 0.35s ease,
                box-shadow 0.35s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Checked (on) state: gray -> yellow */
.toggle-switch input:checked + .toggle-slider {
    background: var(--vh-primary);
    border-color: rgba(var(--vh-primary-rgb), 0.3);
    box-shadow: 0 0 10px rgba(var(--vh-primary-rgb), 0.25),
                inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
    background: var(--vh-surface);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2),
                0 0 6px rgba(var(--vh-primary-rgb), 0.3);
}

.toggle-switch input:focus-visible + .toggle-slider {
    outline: 3px solid var(--vh-primary);
    outline-offset: 3px;
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb), 0.25);
}

/* Toggle switch smooth slide feedback on press -- knob stretches */
.toggle-switch:active .toggle-slider::before {
    width: 22px;
}

.toggle-switch input:checked:active + .toggle-slider::before {
    /* Shift left when expanding the checked knob */
    transform: translateX(18px);
}

/* Toggle save confirmation -- brief glow */
.toggle-switch.toggle-saved .toggle-slider {
    box-shadow: 0 0 14px rgba(var(--vh-primary-rgb), 0.45);
}

/* Hover glow on the track */
.toggle-switch:hover .toggle-slider {
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.06);
}

.toggle-switch:hover input:checked + .toggle-slider {
    box-shadow: 0 0 14px rgba(var(--vh-primary-rgb), 0.35);
}

/* ====== 2FA / NOTIFICATION SECTION ====== */
.security-2fa {
    grid-column: 1 / -1;
    border-top: 1px solid var(--vh-border);
    padding-top: 1rem;
    margin-top: 0.5rem;
}

.security-2fa-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
}

.security-2fa-desc {
    font-size: 0.85rem;
    color: var(--vh-text-muted);
    margin-top: 0.15rem;
    line-height: 1.4;
}

/* ====== NOTIFICATION PREFERENCES ====== */

/* --- Master toggle row --- */
.notification-grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    margin-bottom: 0.25rem;
    border-radius: var(--radius-sm);
    background: rgba(var(--vh-primary-rgb), 0.06);
    border: 1px solid rgba(var(--vh-primary-rgb), 0.12);
}

.notification-grid-header .notification-master-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--vh-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* --- Section sub-headers via CSS grouping --- */
.notification-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-top: 1.8rem;
}

/* "Activity" group label */
.notification-grid::before {
    content: 'Activity';
    position: absolute;
    top: 0;
    left: 0;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--vh-text-muted);
}

/* Separator + spacing between Activity (items 1-2) and Account (items 3-4) */
.notification-item:nth-child(2) {
    padding-bottom: 1.15rem;
}

.notification-item:nth-child(3) {
    border-top: 1px solid var(--vh-border);
    padding-top: 1.15rem;
    position: relative;
    margin-top: 1.8rem;
}

/* "Account" group label */
.notification-item:nth-child(3)::before {
    content: 'Account';
    position: absolute;
    top: -1.5rem;
    left: 0;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--vh-text-muted);
    pointer-events: none;
}

/* --- Notification items --- */
.notification-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-sm);
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    gap: 1rem;
    position: relative;
    margin-bottom: 0.5rem;
}

.notification-item:last-child {
    margin-bottom: 0;
}

.notification-item:hover {
    background: var(--vh-bg-highlight);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Smooth transition when toggling notification */
.notification-item.saving {
    opacity: 0.7;
    pointer-events: none;
}

.notification-item.saved {
    animation: vh-notifSaved 0.6s ease;
}

@keyframes vh-notifSaved {
    0%   { background: var(--vh-surface-alt); box-shadow: none; }
    30%  { background: rgba(var(--vh-primary-rgb), 0.1); box-shadow: 0 0 12px rgba(var(--vh-primary-rgb), 0.15); }
    100% { background: var(--vh-surface-alt); box-shadow: none; }
}

/* --- Auto-save pulse indicator --- */
.notification-item.saving::after {
    content: '';
    position: absolute;
    right: 4.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--vh-primary);
    animation: vh-notifPulse 0.8s ease infinite;
    pointer-events: none;
}

@keyframes vh-notifPulse {
    0%, 100% { opacity: 0.4; transform: translateY(-50%) scale(1); }
    50% { opacity: 1; transform: translateY(-50%) scale(1.3); }
}

/* --- Notification info with icons --- */
.notification-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding-left: 2.4rem;
    position: relative;
}

/* Icon base style */
.notification-info::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1.7rem;
    height: 1.7rem;
    border-radius: var(--radius-xs, 8px);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

/* Envelope icon -- Email Updates (1st item, fallback + :has) */
.notification-item:nth-child(1) .notification-info::before,
.notification-item:has(#notifEmailUpdates) .notification-info::before {
    background: rgba(var(--vh-primary-rgb), 0.1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F2C94C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'/%3E%3Cpolyline points='22,6 12,13 2,6'/%3E%3C/svg%3E") center / 58% no-repeat;
}

/* Bell icon -- Search Alerts (2nd item) */
.notification-item:nth-child(2) .notification-info::before,
.notification-item:has(#notifSearchAlerts) .notification-info::before {
    background: rgba(var(--vh-primary-rgb), 0.1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F2C94C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 01-3.46 0'/%3E%3C/svg%3E") center / 58% no-repeat;
}

/* Shield icon -- Security (3rd item) */
.notification-item:nth-child(3) .notification-info::before,
.notification-item:has(#notifSecurity) .notification-info::before {
    background: rgba(var(--vh-primary-rgb), 0.1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F2C94C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E") center / 58% no-repeat;
}

/* Megaphone icon -- Marketing (4th item) */
.notification-item:nth-child(4) .notification-info::before,
.notification-item:has(#notifMarketing) .notification-info::before {
    background: rgba(var(--vh-primary-rgb), 0.1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F2C94C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z'/%3E%3Cline x1='9' y1='10' x2='15' y2='10'/%3E%3C/svg%3E") center / 58% no-repeat;
}

.notification-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
    color: var(--vh-text);
    transition: color 0.25s ease;
}

.notification-info p {
    font-size: 0.78rem;
    color: var(--vh-text-muted);
    line-height: 1.4;
}

/* Dim label + icon when toggle is off */
.notification-item:has(input:not(:checked)) .notification-info h3 {
    color: var(--vh-text-muted);
}

.notification-item:has(input:not(:checked)) .notification-info::before {
    opacity: 0.35;
    filter: grayscale(1);
}

/* ====== SESSIONS LIST (improved card layout) ====== */
.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.5rem;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-sm);
    gap: 1rem;
    transition: background 0.25s ease, border-color 0.25s ease;
    border: 1px solid transparent;
}

.session-item:hover {
    background: var(--vh-bg-highlight);
    border-color: var(--vh-border);
}

.session-item.current-session {
    border-color: rgba(var(--vh-primary-rgb), 0.25);
    background: rgba(var(--vh-primary-rgb), 0.03);
}

/* Session icon */
.session-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm, 10px);
    background: var(--vh-surface);
    border: 1px solid var(--vh-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--vh-text-muted);
}

.session-item.current-session .session-icon {
    border-color: var(--vh-primary);
    color: var(--vh-primary);
}

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

.session-device {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-meta {
    font-size: 0.8rem;
    color: var(--vh-text-muted);
}

.session-current-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    background: rgba(var(--vh-primary-rgb), 0.15);
    color: var(--vh-primary);
    border-radius: var(--radius-xs, 8px);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.session-revoke {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--vh-error);
    border-radius: var(--radius-xs);
    background: none;
    color: var(--vh-error);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.session-revoke:hover {
    background: var(--vh-error);
    color: var(--vh-surface);
    transform: translateY(-1px);
}

.session-revoke:focus-visible {
    outline: 3px solid var(--vh-primary);
    outline-offset: 3px;
}

/* ====== LANGUAGE SELECT ====== */
.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.language-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--vh-surface-alt);
    border: 2px solid var(--vh-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.9rem;
}

.language-option:hover {
    border-color: var(--vh-text-muted);
    background: var(--vh-bg-highlight);
}

.language-option.active {
    border-color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.08);
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb), 0.1);
    color: var(--vh-primary);
    font-weight: 600;
}

.language-option input {
    display: none;
}

/* ====== PAGINATION ====== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination-btn {
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--vh-border);
    border-radius: var(--radius-xs);
    background: var(--vh-surface);
    color: var(--vh-text);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.08);
    transform: translateY(-1px);
}

.pagination-btn:focus-visible {
    outline: 3px solid var(--vh-primary);
    outline-offset: 3px;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--vh-text-muted);
    padding: 0 0.5rem;
}

/* ====== BUDGET GRID ====== */
.form-group.budget-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ====== MESSAGES ====== */

/* --- Messages Header Bar --- */
.messages-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.messages-filter-group {
    display: flex;
    gap: 0.35rem;
}

.messages-filter-btn {
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--vh-border);
    border-radius: var(--radius-xl, 22px);
    background: transparent;
    color: var(--vh-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.messages-filter-btn:hover {
    border-color: rgba(var(--vh-primary-rgb), 0.4);
    color: var(--vh-text);
}

.messages-filter-btn.active {
    background: rgba(var(--vh-primary-rgb), 0.12);
    border-color: var(--vh-primary);
    color: var(--vh-primary);
}

/* New message button with envelope icon */
.btn-new-message {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--vh-bg, #121212);
    background: var(--vh-primary);
    border: none;
    border-radius: var(--radius-xs, 8px);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.btn-new-message:hover {
    background: #e0b83e;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(var(--vh-primary-rgb), 0.25);
}

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

.btn-new-message svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* --- Empty State: "No messages yet" with Contact link --- */
.messages-empty {
    text-align: center;
    padding: 3.5rem 2rem;
    color: var(--vh-text-tertiary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.messages-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.25rem;
    color: var(--vh-text-tertiary);
    opacity: 0.4;
}

.messages-empty-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--vh-text);
    margin-bottom: 0.35rem;
}

.messages-empty-desc {
    font-size: 0.85rem;
    color: var(--vh-text-muted);
    margin-bottom: 1.25rem;
}

.messages-empty a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--vh-primary);
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.messages-empty a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* --- Inbox Message List --- */
.messages-list {
    display: flex;
    flex-direction: column;
}

.message-item {
    cursor: pointer;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--vh-border);
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    transition: background 0.2s ease, border-color 0.2s ease,
                box-shadow 0.25s ease, transform 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.message-item:last-child {
    border-bottom: none;
}

.message-item:hover {
    background: rgba(var(--vh-primary-rgb), 0.04);
    border-left-color: rgba(var(--vh-primary-rgb), 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 1;
}

.message-item:focus-visible {
    outline: 2px solid var(--vh-primary);
    outline-offset: -2px;
    border-radius: var(--radius-xs, 8px);
}

/* Unread message styling -- bold title + colored left border */
.message-item.unread {
    background: rgba(var(--vh-primary-rgb), 0.03);
    border-left-color: var(--vh-primary);
}

.message-item.unread .message-item-subject {
    font-weight: 700;
    color: var(--vh-text);
}

.message-item.unread .message-item-preview {
    color: var(--vh-text-muted);
}

/* Unread dot indicator */
.unread-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--vh-primary);
    flex-shrink: 0;
    margin-top: 0.35rem;
    box-shadow: 0 0 8px rgba(var(--vh-primary-rgb), 0.35);
    animation: vh-unreadPulse 2.5s ease-in-out infinite;
}

.message-item:not(.unread) .unread-dot {
    visibility: hidden;
}

@keyframes vh-unreadPulse {
    0%, 100% { box-shadow: 0 0 6px rgba(var(--vh-primary-rgb), 0.3); }
    50%      { box-shadow: 0 0 14px rgba(var(--vh-primary-rgb), 0.55); }
}

/* Message body layout -- subject, preview, timestamp */
.message-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.message-item-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.message-item-subject {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--vh-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.message-item-timestamp {
    font-size: 0.72rem;
    color: var(--vh-text-tertiary);
    white-space: nowrap;
    flex-shrink: 0;
}

.message-item-preview {
    font-size: 0.82rem;
    color: var(--vh-text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.message-item-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.message-item-meta {
    font-size: 0.72rem;
    color: var(--vh-text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message-item-id {
    font-size: 0.65rem;
    color: var(--vh-text-tertiary);
    font-family: monospace;
    opacity: 0.7;
}

.message-item-arrow {
    color: var(--vh-text-tertiary);
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
    align-self: center;
}

.message-item:hover .message-item-arrow {
    transform: translateX(4px);
    color: var(--vh-primary);
}

/* --- Status Badges: Open (blue), Resolved (green), Pending (yellow) --- */
.msg-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: var(--radius-md, 12px);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

.msg-status-badge--open {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.msg-status-badge--resolved {
    background: rgba(var(--vh-success-rgb), 0.12);
    color: #4ade80;
    border: 1px solid rgba(var(--vh-success-rgb), 0.25);
}

.msg-status-badge--pending {
    background: rgba(250, 204, 21, 0.12);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.25);
}

.msg-status-badge .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.msg-status-badge--open .status-dot    { background: #60a5fa; }
.msg-status-badge--resolved .status-dot { background: #4ade80; }
.msg-status-badge--pending .status-dot  { background: #facc15; }

/* --- Thread View (chat-bubble style) --- */
.message-thread {
    display: flex;
    flex-direction: column;
}

.message-thread-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--vh-border);
}

.message-thread-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--vh-border);
    border-radius: var(--radius-xs, 8px);
    background: transparent;
    color: var(--vh-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.message-thread-back:hover {
    border-color: var(--vh-primary);
    color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.06);
}

.message-thread-back svg {
    width: 16px;
    height: 16px;
}

.message-thread-title {
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-thread-status {
    flex-shrink: 0;
}

/* Chat bubbles container */
.message-thread-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 1.15rem;
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--vh-border) transparent;
}

.message-thread-body::-webkit-scrollbar {
    width: 5px;
}

.message-thread-body::-webkit-scrollbar-track {
    background: transparent;
}

.message-thread-body::-webkit-scrollbar-thumb {
    background: var(--vh-border);
    border-radius: var(--radius-xs, 8px);
}

/* Sent vs received chat bubbles */
.message-bubble {
    max-width: 80%;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-lg, 18px);
    font-size: 0.88rem;
    line-height: 1.55;
    position: relative;
    word-break: break-word;
}

.message-bubble--sent {
    align-self: flex-end;
    background: rgba(var(--vh-primary-rgb), 0.12);
    border: 1px solid rgba(var(--vh-primary-rgb), 0.2);
    border-bottom-right-radius: 4px;
    color: var(--vh-text);
}

.message-bubble--received {
    align-self: flex-start;
    background: var(--vh-surface-alt, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--vh-border);
    border-bottom-left-radius: 4px;
    color: var(--vh-text);
}

.message-bubble-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.45rem;
    font-size: 0.68rem;
    color: var(--vh-text-tertiary);
}

.message-bubble-sender {
    font-weight: 600;
    color: var(--vh-text-muted);
}

.message-bubble-time {
    white-space: nowrap;
}

/* --- Reply Compose Area with character counter --- */
.message-reply-area {
    border-top: 1px solid var(--vh-border);
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.message-reply-textarea {
    width: 100%;
    min-height: 80px;
    max-height: 180px;
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    font-family: inherit;
    line-height: 1.5;
    color: var(--vh-text);
    background: var(--vh-surface-alt, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--vh-border);
    border-radius: var(--radius-md, 12px);
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.message-reply-textarea::placeholder {
    color: var(--vh-text-tertiary);
}

.message-reply-textarea:focus {
    outline: none;
    border-color: var(--vh-primary);
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb), 0.1);
}

.message-reply-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Character counter states */
.message-char-counter {
    font-size: 0.72rem;
    color: var(--vh-text-tertiary);
    transition: color 0.2s ease;
}

.message-char-counter.near-limit {
    color: #facc15;
}

.message-char-counter.at-limit {
    color: var(--vh-error, #ef4444);
    font-weight: 600;
}

/* Send button with loading spinner */
.message-send-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.25rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--vh-bg, #121212);
    background: var(--vh-primary);
    border: none;
    border-radius: var(--radius-xs, 8px);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease,
                box-shadow 0.2s ease, opacity 0.2s ease;
}

.message-send-btn:hover:not(:disabled) {
    background: #e0b83e;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(var(--vh-primary-rgb), 0.25);
}

.message-send-btn:active:not(:disabled) {
    transform: translateY(0);
}

.message-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.message-send-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.message-send-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.message-send-btn.loading .send-icon {
    display: none;
}

.message-send-btn.loading .send-spinner {
    display: inline-block;
}

.send-spinner {
    display: none;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-top-color: var(--vh-bg, #121212);
    border-radius: 50%;
    animation: vh-sendSpin 0.65s linear infinite;
}

@keyframes vh-sendSpin {
    to { transform: rotate(360deg); }
}

/* --- Error State --- */
.messages-error {
    text-align: center;
    padding: 2rem 1.5rem;
    color: var(--vh-text-tertiary);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ====== PROFILE SECTION ANIMATIONS ====== */
.profile-container > * {
    opacity: 0;
    animation: vh-sectionIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.profile-container > *:nth-child(1) { animation-delay: 0.1s; }
.profile-container > *:nth-child(2) { animation-delay: 0.2s; }
.profile-container > *:nth-child(3) { animation-delay: 0.3s; }
.profile-container > *:nth-child(4) { animation-delay: 0.4s; }
.profile-container > *:nth-child(5) { animation-delay: 0.5s; }

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

/* ====== CONFIRMATION FEEDBACK OVERLAY ====== */
.action-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: var(--vh-surface);
    border: 2px solid var(--vh-primary);
    border-radius: var(--radius-lg);
    padding: 2rem 3rem;
    text-align: center;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.action-feedback.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.action-feedback-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    color: var(--vh-success);
}

.action-feedback-icon.error {
    color: var(--vh-error);
}

.action-feedback-text {
    font-weight: 600;
    font-size: 1rem;
}

/* ====== AVATAR DRAG & DROP ZONE ====== */
/* -- Avatar dashed border rotation animation -- */
@keyframes vh-avatarDashRotate {
    to { transform: rotate(360deg); }
}

@keyframes vh-avatarDashPulse {
    0%, 100% { border-color: var(--vh-border); }
    50% { border-color: rgba(var(--vh-primary-rgb), 0.45); }
}

.avatar-dropzone {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--vh-surface-alt);
    border: 3px dashed var(--vh-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    overflow: visible;
    flex-shrink: 0;
}

/* Animated dashed border ring (pseudo-element) */
.avatar-dropzone::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px dashed transparent;
    transition: border-color 0.4s ease, opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
    animation: vh-avatarDashRotate 12s linear infinite;
}

.avatar-dropzone:hover::before,
.avatar-dropzone.drag-over::before {
    border-color: rgba(var(--vh-primary-rgb), 0.35);
    opacity: 1;
}

.avatar-dropzone:hover {
    border-color: var(--vh-primary);
    transform: scale(1.06);
    box-shadow: 0 0 24px rgba(var(--vh-primary-rgb), 0.18);
}

.avatar-dropzone:focus-visible {
    outline: 3px solid var(--vh-primary);
    outline-offset: 5px;
}

.avatar-dropzone.drag-over {
    border-color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.08);
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(var(--vh-primary-rgb), 0.3);
    animation: vh-avatarDashPulse 1s ease-in-out infinite;
}

/* Drag-over overlay text */
.avatar-dropzone.drag-over .avatar-drop-hint {
    opacity: 1;
    transform: scale(1);
}

.avatar-drop-hint {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 2;
    pointer-events: none;
    backdrop-filter: blur(2px);
}

.avatar-drop-hint svg {
    width: 24px;
    height: 24px;
    color: var(--vh-primary);
    filter: drop-shadow(0 0 4px rgba(var(--vh-primary-rgb), 0.5));
}

.avatar-dropzone img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: 1;
}

/* Has-image state: solid border */
.avatar-dropzone.has-image {
    border-style: solid;
    border-color: rgba(var(--vh-primary-rgb), 0.3);
    overflow: hidden;
}

.avatar-dropzone.has-image:hover {
    border-color: var(--vh-primary);
}

.avatar-dropzone-label {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 26px;
    height: 26px;
    background: var(--vh-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid var(--vh-surface);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 3;
}

.avatar-dropzone:hover .avatar-dropzone-label {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(var(--vh-primary-rgb), 0.3);
}

/* Remove avatar button */
.avatar-remove-btn {
    position: absolute;
    top: -4px;
    right: -4px;
    z-index: 4;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--vh-surface);
    background: var(--vh-error);
    color: var(--vh-surface);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    line-height: 1;
    padding: 0;
    box-shadow: 0 2px 6px rgba(var(--vh-error-rgb), 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.avatar-remove-btn:hover {
    transform: scale(1.15);
    background: var(--vh-error);
    box-shadow: 0 3px 10px rgba(var(--vh-error-rgb), 0.45);
}

.avatar-remove-btn.visible {
    display: flex;
}

/* ====== GLOBAL FOCUS-VISIBLE (yellow accent, 3px offset) ====== */
*:focus-visible {
    outline: 3px solid var(--vh-primary);
    outline-offset: 3px;
}

/* Override for form inputs that have their own focus styles */
.form-input:focus-visible,
.form-select:focus-visible {
    outline: none;
}

button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--vh-primary);
    outline-offset: 3px;
}

/* ====== SAFE AREA & TOUCH TARGETS ====== */
@supports (padding: env(safe-area-inset-bottom)) {
    .profile-container {
        padding-bottom: calc(4rem + env(safe-area-inset-bottom));
        padding-left: calc(1rem + env(safe-area-inset-left));
        padding-right: calc(1rem + env(safe-area-inset-right));
    }
    .toast { top: calc(1.5rem + env(safe-area-inset-top, 0)); }
    .modal-overlay {
        padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    }
    .tabs {
        padding-left: calc(0.5rem + env(safe-area-inset-left));
        padding-right: calc(0.5rem + env(safe-area-inset-right));
    }
}

@media (pointer: coarse) {
    .tab { min-height: 44px; }
    .card-action,
    .modal-btn { min-height: 44px; min-width: 44px; }
    .form-input,
    .form-select { min-height: 48px; font-size: 1rem; }
    .saved-card-btn { min-height: 44px; padding: 0.6rem 1rem; }
    .checkbox-label { min-height: 44px; }
    .activity-item { min-height: 48px; }
    .toggle-switch { width: 54px; height: 30px; }
    .toggle-slider::before { width: 22px; height: 22px; }
    .toggle-switch input:checked + .toggle-slider::before { transform: translateX(24px); }
    .notification-item { min-height: 56px; }
    .pagination-btn { min-height: 44px; min-width: 44px; }
    .session-revoke { min-height: 44px; padding: 0.5rem 1rem; }
    .language-option { min-height: 48px; }
    .message-item { min-height: 48px; }
    .inline-copy-btn,
    .copy-email-btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
}

/* ====== SMOOTH LAYOUT TRANSITIONS BETWEEN BREAKPOINTS ====== */
.profile-container,
.card,
.info-grid,
.saved-cards-grid,
.activity-list,
.sessions-list,
.notification-grid,
.preferences-grid,
.language-grid,
.form-group.budget-grid {
    transition: padding 0.3s ease, gap 0.3s ease;
}

.tab,
.card-title,
.page-title,
.page-subtitle,
.info-value,
.info-label {
    transition: font-size 0.3s ease, padding 0.3s ease;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .profile-container {
        padding: calc(64px + 2rem) 1rem 3rem;
    }

    .page-header {
        margin-bottom: 2rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    /* Stacked scrollable tabs */
    .tabs {
        gap: 0;
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }

    .tab {
        padding: 0.65rem 1rem;
        font-size: 0.88rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 1.25rem;
        border-radius: var(--radius-lg, 16px);
    }

    .card-header {
        margin-bottom: 1rem;
    }

    .card-title {
        font-size: 1.15rem;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .modal {
        width: 100%;
        max-width: 100%;
        border-radius: var(--radius-xl, 22px) var(--radius-xl, 22px) 0 0;
        max-height: 88vh;
        border-bottom: none;
    }

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

    .modal-overlay .modal {
        transform: translateY(100%) scale(1);
    }

    .modal-header {
        padding: 1.5rem 1.5rem 0;
    }

    .modal-body {
        padding: 1.25rem 1.5rem 0.5rem;
    }

    .modal-title {
        font-size: 1.2rem;
    }

    .modal-actions {
        flex-direction: column-reverse;
        padding: 0 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 0));
    }

    .modal-btn {
        width: 100%;
        text-align: center;
    }

    /* Mobile toast: full-width at top */
    .toast {
        left: 0.75rem;
        right: 0.75rem;
        top: 0.75rem;
        max-width: none;
        min-width: 0;
    }

    .toast:nth-child(2) { top: calc(0.75rem + 76px); }
    .toast:nth-child(3) { top: calc(0.75rem + 152px); }

    /* Mobile context card grid */
    .context-card-grid {
        grid-template-columns: 1fr;
    }

    .language-grid {
        grid-template-columns: 1fr 1fr;
    }

    .session-item {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 1rem;
    }

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

    .session-info {
        flex-basis: calc(100% - 90px);
    }

    .session-revoke,
    .session-current-badge {
        margin-left: auto;
    }

    .preference-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    /* Preferences tab mobile overrides */
    .context-toggle-group {
        grid-template-columns: 1fr;
    }

    .context-toggle-option {
        flex-direction: row;
        padding: 1.15rem;
        gap: 1rem;
        text-align: left;
    }

    .context-toggle-option.active::after {
        top: auto;
        bottom: auto;
        right: 12px;
    }

    .pref-budget-inputs {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .pref-budget-separator {
        display: none;
    }

    .pref-usage-pills {
        grid-template-columns: repeat(2, 1fr);
    }

    .pref-body-types {
        grid-template-columns: repeat(3, 1fr);
    }

    .pref-save-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .pref-save-btn {
        justify-content: center;
    }

    .pref-save-status {
        text-align: center;
    }

    .pref-priority-item {
        padding: 0.7rem 0.85rem;
    }

    .form-group.budget-grid {
        grid-template-columns: 1fr;
    }

    .notification-item {
        gap: 0.75rem;
        padding: 1rem;
        min-height: 56px;
    }

    .notification-grid {
        padding-top: 1.6rem;
    }

    .notification-grid-header {
        padding: 0.85rem 1rem;
    }

    .notification-info {
        padding-left: 2.2rem;
    }

    .notification-info::before {
        width: 1.5rem;
        height: 1.5rem;
    }

    /* Larger touch targets for toggles on mobile */
    .toggle-switch {
        width: 52px;
        height: 30px;
    }

    .toggle-slider {
        border-radius: var(--radius-lg, 18px);
    }

    .toggle-slider::before {
        width: 22px;
        height: 22px;
    }

    .toggle-switch input:checked + .toggle-slider::before {
        transform: translateX(22px);
    }

    .saved-toolbar {
        gap: 0.5rem;
    }

    .saved-card-actions {
        flex-direction: column;
    }

    .saved-card-btn {
        text-align: center;
        justify-content: center;
    }

    .saved-card-btn.remove {
        margin-left: 0;
    }

    .saved-empty {
        padding: 2.5rem 1.5rem;
    }

    /* ---- Subscription tab responsive (768px) ---- */
    #subscriptionTab .info-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    #subscriptionTab .info-item {
        padding: 0.85rem;
    }

    #subscriptionPlan {
        font-size: 1.15rem;
    }

    .sub-plan-features {
        grid-template-columns: 1fr;
    }

    .sub-autorenew-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .sub-billing-table thead th,
    .sub-billing-table tbody td {
        padding: 0.65rem 0.75rem;
        font-size: 0.8rem;
    }

    .sub-cta-btn {
        font-size: 0.92rem;
        padding: 0.75rem 1.25rem;
    }

    .sub-billing-empty {
        padding: 2rem 1rem;
    }

    .sub-credits-meter {
        padding: 1rem;
    }

    .sub-renewal-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* ---- Messages tab responsive (768px) ---- */
    .messages-header {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .messages-filter-group {
        order: 3;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }

    .btn-new-message {
        font-size: 0.78rem;
        padding: 0.45rem 0.9rem;
    }

    .message-item {
        padding: 0.85rem 0.9rem;
    }

    .message-bubble {
        max-width: 90%;
    }

    .message-thread-body {
        padding: 1rem 0.85rem;
        max-height: 350px;
    }

    .message-reply-area {
        padding: 0.85rem 0.9rem;
    }

    .message-reply-textarea {
        min-height: 70px;
    }

    .messages-empty {
        padding: 2.5rem 1.25rem;
    }

    .messages-empty-icon {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 480px) {
    .tabs {
        gap: 0;
    }

    .tab {
        padding: 0.6rem 0.75rem;
        font-size: 0.82rem;
    }

    .card {
        padding: 1rem;
    }

    .language-grid {
        grid-template-columns: 1fr;
    }

    /* ---- Preferences tab responsive (480px) ---- */
    .pref-body-types {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .pref-usage-pills {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .pref-usage-pill {
        padding: 0.75rem 0.5rem;
    }

    .context-toggle-icon {
        width: 40px;
        height: 40px;
    }

    .pref-import-toggle {
        flex-direction: column;
        align-items: flex-start;
    }

    .pref-condition-pills {
        flex-direction: column;
    }

    /* ---- Subscription tab responsive (480px) ---- */
    #subscriptionTab > .card:first-child::before {
        width: 160px;
        height: 160px;
    }

    .sub-billing-table thead th,
    .sub-billing-table tbody td {
        padding: 0.55rem 0.6rem;
        font-size: 0.76rem;
    }

    .sub-billing-status {
        font-size: 0.68rem;
        padding: 0.2rem 0.5rem;
    }

    .sub-feature-card {
        padding: 0.7rem 0.85rem;
    }

    .sub-feature-name {
        font-size: 0.8rem;
    }

    .sub-countdown-badge {
        font-size: 0.72rem;
    }

    .sub-credits-meter-count {
        font-size: 0.95rem;
    }

    /* ---- Messages tab responsive (480px) ---- */
    .messages-header {
        gap: 0.5rem;
    }

    .messages-filter-btn {
        padding: 0.3rem 0.65rem;
        font-size: 0.72rem;
    }

    .btn-new-message {
        width: 100%;
        justify-content: center;
        font-size: 0.8rem;
    }

    .message-item {
        padding: 0.75rem 0.7rem;
        gap: 0.6rem;
    }

    .message-item-subject {
        font-size: 0.84rem;
    }

    .message-item-preview {
        font-size: 0.78rem;
    }

    .message-bubble {
        max-width: 92%;
        padding: 0.7rem 0.9rem;
        font-size: 0.84rem;
    }

    .message-thread-header {
        padding: 0.75rem 0.85rem;
        gap: 0.5rem;
    }

    .message-thread-title {
        font-size: 0.9rem;
    }

    .message-thread-body {
        padding: 0.85rem 0.7rem;
        gap: 0.75rem;
    }

    .message-reply-area {
        padding: 0.75rem 0.7rem;
    }

    .message-send-btn {
        padding: 0.5rem 1rem;
        font-size: 0.78rem;
    }

    .msg-status-badge {
        font-size: 0.62rem;
        padding: 0.15rem 0.45rem;
    }
}

/* ====== DELETE ACCOUNT MODAL CONTENT ====== */
.delete-warning {
    background: rgba(var(--vh-error-rgb), 0.06);
    border: 1.5px solid rgba(var(--vh-error-rgb), 0.2);
    border-radius: var(--radius-md, 12px);
    padding: 1.15rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
    color: var(--vh-error);
    line-height: 1.55;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.delete-warning::before {
    content: '';
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23EF4444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
}

.delete-confirm-input {
    margin-top: 1rem;
}

.delete-confirm-input .form-label {
    color: var(--vh-error);
    font-size: 0.85rem;
}

.delete-confirm-input .form-input {
    border-color: rgba(var(--vh-error-rgb), 0.25);
    font-family: var(--vh-font-body);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-align: center;
}

.delete-confirm-input .form-input:focus {
    border-color: var(--vh-error);
    box-shadow: 0 0 0 3px rgba(var(--vh-error-rgb), 0.12);
}

.delete-confirm-input .form-input::placeholder {
    font-family: var(--vh-font-body);
    font-weight: 700;
    letter-spacing: 0.1em;
    color: rgba(var(--vh-error-rgb), 0.25);
}

/* ============================================================================
   ACCESSIBILITY ENHANCEMENTS
   ---------------------------------------------------------------------------- */

/* ====== SKIP LINK (visible on focus only) ====== */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    padding: 0.75rem 1.5rem;
    background: var(--vh-primary);
    color: #1a1a2e;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: var(--radius-sm, 8px);
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: top 0.15s ease;
    white-space: nowrap;
}

.skip-to-content:focus,
.skip-to-content:focus-visible {
    top: 1rem;
    outline: 3px solid var(--vh-primary);
    outline-offset: 3px;
}

/* ====== ARIA LANDMARK STYLING / VISUAL HIERARCHY ====== */
.card[role="region"],
.card[aria-labelledby] {
    position: relative;
}

/* Section header underline accent for landmark clarity */
.card-header {
    border-bottom: 1px solid var(--vh-border);
    padding-bottom: 1rem;
}

/* ====== SCREEN READER ONLY HELPER TEXT ====== */
.sr-only,
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ====== FORM LABEL ASSOCIATION STYLING ====== */
.form-label {
    cursor: pointer;
    user-select: none;
}

.form-label:hover {
    color: var(--vh-primary);
}

.form-label .required-indicator {
    color: var(--vh-error, #ef4444);
    font-weight: 700;
}

.form-group legend,
.form-group .group-label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--vh-text);
    display: block;
}

.form-group:focus-within {
    border-radius: var(--radius-sm, 8px);
    background: rgba(var(--vh-primary-rgb), 0.02);
}

/* ====== KEYBOARD-ACTIVATED DROPDOWN / SELECT STYLING ====== */
.form-select:focus-visible {
    outline: 3px solid var(--vh-primary);
    outline-offset: 3px;
    border-color: var(--vh-primary);
    box-shadow: 0 0 0 4px rgba(var(--vh-primary-rgb), 0.2);
}

.language-option:focus-visible {
    outline: 3px solid var(--vh-primary);
    outline-offset: 3px;
}

.checkbox-label:focus-within {
    outline: 3px solid var(--vh-primary);
    outline-offset: 3px;
    border-color: var(--vh-primary);
}

.checkbox-label input:focus-visible {
    outline: 3px solid var(--vh-primary);
    outline-offset: 2px;
}

/* ====== INTERACTIVE ELEMENT MINIMUM SIZE (44x44px) ====== */
.tab {
    min-height: 44px;
    min-width: 44px;
}

.card-action,
.modal-btn,
.sub-cta-btn {
    min-height: 44px;
    min-width: 44px;
}

.saved-card-btn {
    min-height: 44px;
    min-width: 44px;
}

.pagination-btn {
    min-height: 44px;
    min-width: 44px;
}

.session-revoke {
    min-height: 44px;
    min-width: 44px;
}

.toggle-switch {
    min-width: 44px;
    min-height: 24px;
}

.checkbox-label {
    min-height: 44px;
}

.language-option {
    min-height: 44px;
}

.message-item {
    min-height: 44px;
}

.sub-receipt-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    min-width: 44px;
}

/* ====== FOCUS TRAP STYLING FOR MODALS ====== */
.modal-overlay.active .modal:focus,
.modal-overlay.active .modal:focus-visible {
    outline: 3px solid var(--vh-primary);
    outline-offset: -3px;
    border-color: var(--vh-primary);
}

.modal-overlay.active .modal:focus-within {
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35),
                0 0 0 3px rgba(var(--vh-primary-rgb), 0.4);
}

/* ====== COLOR CONTRAST ADJUSTMENTS (WCAG AA 4.5:1) ====== */
.info-label,
.activity-meta,
.activity-time,
.session-meta,
.notification-info p,
.preference-info p,
.sub-autorenew-desc,
.sub-credits-meter-label,
.message-item-meta,
.message-item-id {
    color: var(--vh-text-muted, #9ca3af);
}

.page-subtitle {
    color: var(--vh-text-muted, #9ca3af);
}

.modal-btn-confirm:disabled {
    opacity: 0.55;
    color: var(--vh-text-muted, #9ca3af);
}

.pagination-btn:disabled {
    opacity: 0.5;
}

.preference-value-display {
    color: var(--vh-primary);
}

/* ====== HIGH CONTRAST MODE SUPPORT (forced-colors) ====== */
@media (forced-colors: active) {
    .card,
    .modal,
    .form-input,
    .form-select,
    .preference-card,
    .notification-item,
    .session-item,
    .activity-item,
    .saved-card,
    .checkbox-label,
    .language-option,
    .sub-feature-card,
    .sub-billing-status,
    .subscription-badge,
    .sub-countdown-badge,
    .sub-autorenew-row,
    .sub-credits-meter,
    .delete-warning,
    .toast {
        border: 2px solid ButtonText;
        forced-color-adjust: none;
    }

    *:focus-visible {
        outline: 3px solid Highlight;
        outline-offset: 3px;
    }

    .card-action,
    .modal-btn,
    .sub-cta-btn,
    .saved-card-btn,
    .pagination-btn,
    .session-revoke,
    .tab,
    .language-option,
    .message-item {
        border: 2px solid ButtonText;
        color: ButtonText;
        background: ButtonFace;
    }

    .card-action:hover,
    .modal-btn:hover,
    .sub-cta-btn:hover,
    .saved-card-btn:hover,
    .tab:hover,
    .tab.active {
        border-color: Highlight;
        color: Highlight;
    }

    .toggle-slider {
        border: 2px solid ButtonText;
        background: ButtonFace;
    }

    .toggle-switch input:checked + .toggle-slider {
        background: Highlight;
        border-color: Highlight;
    }

    .toggle-slider::before {
        background: ButtonText;
    }

    .form-input,
    .form-select {
        border: 2px solid ButtonText;
        background: Field;
        color: FieldText;
    }

    .form-input:focus,
    .form-select:focus {
        border-color: Highlight;
    }

    .subscription-badge,
    .sub-billing-status,
    .saved-card-badge,
    .session-current-badge {
        border: 2px solid ButtonText;
    }

    .sub-credits-bar {
        border: 1px solid ButtonText;
    }

    .sub-credits-bar-fill {
        background: Highlight;
    }

    .status-indicator,
    .activity-type-dot,
    .unread-dot {
        border: 2px solid ButtonText;
    }

    .skip-to-content {
        border: 2px solid ButtonText;
        background: Highlight;
        color: HighlightText;
    }

    .modal-overlay.active {
        background: rgba(0, 0, 0, 0.8);
    }

    .modal {
        border: 3px solid Highlight;
    }

    a, .sub-receipt-link, .messages-empty a {
        color: LinkText;
    }

    .avatar-dropzone {
        border: 3px dashed ButtonText;
    }

    .skeleton {
        border: 1px solid ButtonText;
        background: ButtonFace;
        animation: none;
    }

    .sub-billing-table thead th {
        border-bottom: 2px solid ButtonText;
    }

    .sub-billing-table tbody td {
        border-bottom: 1px solid ButtonText;
    }

    .card-action.danger,
    .modal-btn-danger,
    .delete-warning {
        border-color: ButtonText;
    }

    .card:hover {
        border-color: Highlight;
    }

    .tabs-indicator {
        background: Highlight;
    }

    .tabs {
        border-bottom-color: ButtonText;
    }
}


/* ============================================================================
   SECURITY SECTION ENHANCEMENTS
   ---------------------------------------------------------------------------- */

/* ====== SECURITY SECTION VISUAL GROUPING ====== */
#accountTab .card:nth-child(2),
#accountTab .card:nth-child(3) {
    border-left: 3px solid rgba(var(--vh-primary-rgb), 0.35);
}

#accountTab .card:nth-child(2) .card-header,
#accountTab .card:nth-child(3) .card-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--vh-border);
}

/* ====== PASSWORD CHANGE SECTION ====== */
#accountTab .card:nth-child(2) .section-icon {
    filter: drop-shadow(0 0 4px rgba(var(--vh-primary-rgb), 0.3));
}

#accountTab .card:nth-child(2) .info-grid {
    align-items: center;
}

#accountTab .card:nth-child(2) .info-value {
    letter-spacing: 0.2em;
    font-family: monospace;
    color: var(--vh-text-muted);
}

#btnChangePassword {
    background: rgba(var(--vh-primary-rgb), 0.08);
    border-color: rgba(var(--vh-primary-rgb), 0.3);
    color: var(--vh-primary);
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#btnChangePassword:hover {
    background: var(--vh-primary);
    color: var(--vh-text);
    border-color: var(--vh-primary);
    box-shadow: 0 4px 16px rgba(var(--vh-primary-rgb), 0.25);
    transform: translateY(-2px);
}

/* ====== PASSWORD MODAL ENHANCEMENTS ====== */
#changePasswordModal .modal {
    border-top: 3px solid var(--vh-primary);
}

#changePasswordModal .modal-header {
    position: relative;
    padding-left: 3rem;
}

#changePasswordModal .modal-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.2rem;
    width: 28px;
    height: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F2C94C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

#changePasswordModal .form-group {
    position: relative;
}

#changePasswordModal .form-input {
    padding-right: 3rem;
}

/* Password strength indicator bar */
.password-strength-bar {
    height: 4px;
    border-radius: var(--radius-xs, 8px);
    background: var(--vh-border);
    margin-top: 0.5rem;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.password-strength-bar-fill {
    height: 100%;
    border-radius: var(--radius-xs, 8px);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.4s ease;
}

.password-strength-bar-fill.weak   { width: 25%;  background: var(--vh-error); }
.password-strength-bar-fill.fair   { width: 50%;  background: var(--vh-warning); }
.password-strength-bar-fill.good   { width: 75%;  background: #06B6D4; }
.password-strength-bar-fill.strong { width: 100%; background: var(--vh-success); }

.password-strength-label {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.3rem;
    transition: color 0.3s ease;
}

.password-strength-label.weak   { color: var(--vh-error); }
.password-strength-label.fair   { color: var(--vh-warning); }
.password-strength-label.good   { color: #06B6D4; }
.password-strength-label.strong { color: var(--vh-success); }

/* Show/hide password toggle button */
.password-toggle-btn {
    position: absolute;
    right: 0.75rem;
    top: 2.4rem;
    background: none;
    border: none;
    color: var(--vh-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-xs, 8px);
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle-btn:hover {
    color: var(--vh-primary);
}

.password-toggle-btn svg {
    width: 18px;
    height: 18px;
}

/* ====== TWO-FACTOR AUTHENTICATION ENHANCEMENTS ====== */
#accountTab .card:nth-child(3) .section-icon {
    filter: drop-shadow(0 0 4px rgba(var(--vh-primary-rgb), 0.3));
}

.security-2fa-row {
    padding: 1.25rem 1.5rem;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-sm);
    border: 1px solid var(--vh-border);
    transition: border-color 0.3s ease, background 0.3s ease;
}

.security-2fa-row:hover {
    border-color: rgba(var(--vh-primary-rgb), 0.2);
}

/* 2FA status badge */
.security-2fa-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-pill, 9999px);
    margin-top: 0.5rem;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.security-2fa-status.enabled {
    background: rgba(var(--vh-success-rgb), 0.12);
    color: var(--vh-success);
}

.security-2fa-status.disabled {
    background: rgba(var(--vh-error-rgb), 0.08);
    color: var(--vh-text-muted);
}

.security-2fa-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.security-2fa-status.enabled .security-2fa-status-dot {
    animation: vh-statusPulse 2s ease-in-out infinite;
}

/* Enhanced 2FA toggle switch */
.security-2fa-row .toggle-switch {
    width: 52px;
    height: 28px;
}

.security-2fa-row .toggle-slider {
    border-radius: var(--radius-lg, 18px);
}

.security-2fa-row .toggle-slider::before {
    width: 22px;
    height: 22px;
}

.security-2fa-row .toggle-switch input:checked + .toggle-slider {
    background: var(--vh-success);
    box-shadow: 0 0 10px rgba(var(--vh-success-rgb), 0.3);
}

.security-2fa-row .toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

/* ====== ACTIVE SESSIONS ENHANCEMENTS ====== */
#accountTab .card:nth-child(6) .card-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--vh-border);
}

.session-item {
    border-radius: var(--radius-md, 14px);
    border: 1px solid var(--vh-border);
    background: var(--vh-surface-alt);
    padding: 1.25rem 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.session-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    border-radius: 0 3px 3px 0;
    background: var(--vh-text-muted);
    opacity: 0.3;
    transition: all 0.3s ease;
}

.session-item:hover {
    border-color: rgba(var(--vh-primary-rgb), 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.session-item:hover::before {
    opacity: 0.6;
    height: 80%;
    background: var(--vh-primary);
}

.session-item.current-session {
    border-color: rgba(var(--vh-primary-rgb), 0.3);
    background: rgba(var(--vh-primary-rgb), 0.03);
    box-shadow: 0 0 0 1px rgba(var(--vh-primary-rgb), 0.08);
}

.session-item.current-session::before {
    background: var(--vh-primary);
    opacity: 1;
    height: 70%;
}

.session-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md, 12px);
    background: var(--vh-surface);
    border: 1.5px solid var(--vh-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--vh-text-muted);
    transition: all 0.3s ease;
}

.session-icon svg {
    width: 20px;
    height: 20px;
}

.session-item.current-session .session-icon {
    border-color: var(--vh-primary);
    color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.06);
    box-shadow: 0 0 8px rgba(var(--vh-primary-rgb), 0.15);
}

.session-item:hover .session-icon {
    border-color: var(--vh-primary);
    color: var(--vh-primary);
}

.session-device {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.session-meta {
    font-size: 0.8rem;
    color: var(--vh-text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.session-current-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    background: rgba(var(--vh-primary-rgb), 0.15);
    color: var(--vh-primary);
    border-radius: var(--radius-pill, 9999px);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    border: 1px solid rgba(var(--vh-primary-rgb), 0.2);
    animation: vh-currentBadgePulse 3s ease-in-out infinite;
}

@keyframes vh-currentBadgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--vh-primary-rgb), 0); }
    50%      { box-shadow: 0 0 10px 2px rgba(var(--vh-primary-rgb), 0.12); }
}

.session-revoke {
    padding: 0.45rem 0.9rem;
    border: 1.5px solid rgba(var(--vh-error-rgb), 0.4);
    border-radius: var(--radius-sm);
    background: rgba(var(--vh-error-rgb), 0.04);
    color: var(--vh-error);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.session-revoke::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--vh-error);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.session-revoke:hover {
    border-color: var(--vh-error);
    color: var(--vh-surface);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--vh-error-rgb), 0.25);
}

.session-revoke:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.session-revoke span,
.session-revoke {
    position: relative;
    z-index: 1;
}

/* ====== DATA & PRIVACY / EXPORT SECTION ====== */
#accountTab .card:nth-child(7) .activity-item {
    border-left: 3px solid #06B6D4;
}

#accountTab .card:nth-child(7) .section-icon {
    color: #06B6D4;
}

#btnExportData {
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.3);
    color: #06B6D4;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#btnExportData:hover {
    background: #06B6D4;
    color: var(--vh-surface);
    border-color: #06B6D4;
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.25);
    transform: translateY(-2px);
}

/* ====== DANGER ZONE ====== */
#accountTab .card:nth-child(8) {
    border-color: rgba(var(--vh-error-rgb), 0.25);
    border-left: 4px solid var(--vh-error);
    background: linear-gradient(135deg, var(--vh-surface) 0%, rgba(var(--vh-error-rgb), 0.02) 100%);
    position: relative;
    overflow: hidden;
}

#accountTab .card:nth-child(8)::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    background: repeating-linear-gradient(
        -45deg,
        rgba(var(--vh-error-rgb), 0.06),
        rgba(var(--vh-error-rgb), 0.06) 4px,
        transparent 4px,
        transparent 8px
    );
    border-radius: 50%;
    pointer-events: none;
}

#accountTab .card:nth-child(8):hover {
    border-color: rgba(var(--vh-error-rgb), 0.4);
    box-shadow: 0 4px 20px rgba(var(--vh-error-rgb), 0.08);
}

#accountTab .card:nth-child(8) .card-title {
    color: var(--vh-error);
}

#accountTab .card:nth-child(8) .section-icon {
    color: var(--vh-error);
    filter: drop-shadow(0 0 4px rgba(var(--vh-error-rgb), 0.3));
}

#accountTab .card:nth-child(8) .activity-item {
    border-left: 3px solid var(--vh-error);
    background: rgba(var(--vh-error-rgb), 0.03);
}

#accountTab .card:nth-child(8) .activity-item:hover {
    background: rgba(var(--vh-error-rgb), 0.06);
}

#accountTab .card:nth-child(8) .activity-title {
    color: var(--vh-error);
    font-weight: 700;
}

#btnDeleteAccount {
    background: rgba(var(--vh-error-rgb), 0.08);
    border-color: var(--vh-error);
    color: var(--vh-error);
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

#btnDeleteAccount::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--vh-error);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

#btnDeleteAccount:hover {
    color: var(--vh-surface);
    border-color: var(--vh-error);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--vh-error-rgb), 0.3);
}

#btnDeleteAccount:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

#btnDeleteAccount span {
    position: relative;
    z-index: 1;
}

/* ====== DELETE ACCOUNT MODAL ENHANCEMENTS ====== */
#deleteAccountModal .modal {
    border-top: 3px solid var(--vh-error);
}

#deleteAccountModal .modal-title {
    color: var(--vh-error);
}

#deleteAccountModal .modal-header {
    position: relative;
    padding-left: 3.5rem;
}

#deleteAccountModal .modal-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.1rem;
    width: 36px;
    height: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23EF4444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* ====== SECURITY MODAL ANIMATIONS ====== */
.security-expand-enter {
    overflow: hidden;
    animation: vh-securityExpand 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes vh-securityExpand {
    from { max-height: 0; opacity: 0; transform: translateY(-8px); }
    to   { max-height: 500px; opacity: 1; transform: translateY(0); }
}

.security-expand-leave {
    overflow: hidden;
    animation: vh-securityCollapse 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes vh-securityCollapse {
    from { max-height: 500px; opacity: 1; transform: translateY(0); }
    to   { max-height: 0; opacity: 0; transform: translateY(-8px); }
}

/* ====== SECURITY SECTION ENHANCEMENTS ====== */
.security-section-group {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.security-block {
    padding: 1.25rem;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-md, 14px);
    border: 1px solid var(--vh-border);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.security-block:hover {
    border-color: rgba(var(--vh-primary-rgb), 0.2);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.security-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.security-block-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--vh-text);
}

.security-block-title svg {
    width: 18px;
    height: 18px;
    color: var(--vh-text-muted);
    flex-shrink: 0;
}

.security-block-desc {
    font-size: 0.85rem;
    color: var(--vh-text-muted);
    line-height: 1.5;
    margin-top: 0.4rem;
}

/* 2FA status indicator */
.twofa-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill, 9999px);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.twofa-status.enabled {
    background: rgba(var(--vh-success-rgb), 0.12);
    color: var(--vh-success);
    border: 1px solid rgba(var(--vh-success-rgb), 0.2);
}

.twofa-status.disabled {
    background: rgba(148, 163, 184, 0.12);
    color: #94A3B8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Sessions count badge */
.security-sessions-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--vh-text-muted);
    background: var(--vh-surface-alt);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill, 9999px);
    border: 1px solid var(--vh-border);
}

/* Revoke confirm state */
.session-revoke.confirm-state {
    background: var(--vh-error);
    color: var(--vh-surface);
    border-color: var(--vh-error);
    animation: vh-revokeShake 0.3s ease;
}

@keyframes vh-revokeShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.session-item.revoking {
    animation: vh-sessionRevoke 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes vh-sessionRevoke {
    0%   { opacity: 1; transform: translateX(0); }
    50%  { opacity: 0.5; transform: translateX(20px); background: rgba(var(--vh-error-rgb), 0.08); }
    100% { opacity: 0; transform: translateX(40px); max-height: 0; padding: 0; margin: 0; border: 0; }
}

/* ====== SECURITY SECTION MOBILE RESPONSIVE ====== */
@media (max-width: 768px) {
    #accountTab .card:nth-child(2),
    #accountTab .card:nth-child(3) {
        border-left-width: 2px;
    }

    .session-item {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .session-item::before {
        display: none;
    }

    .session-icon {
        width: 38px;
        height: 38px;
        border-radius: var(--radius-sm, 10px);
    }

    .session-info {
        flex-basis: calc(100% - 54px);
        min-width: 0;
    }

    .session-device {
        font-size: 0.88rem;
    }

    .session-revoke,
    .session-current-badge {
        margin-left: auto;
    }

    .session-revoke {
        width: auto;
        text-align: center;
    }

    .security-2fa-row {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .security-2fa-row .toggle-switch {
        align-self: flex-end;
    }

    #accountTab .card:nth-child(8) {
        border-left-width: 3px;
    }

    #accountTab .card:nth-child(8)::after {
        width: 60px;
        height: 60px;
    }

    #changePasswordModal .modal-header {
        padding-left: 0;
        padding-top: 2.5rem;
    }

    #changePasswordModal .modal-header::before {
        top: 0;
        left: 0;
        width: 24px;
        height: 24px;
    }

    #deleteAccountModal .modal-header {
        padding-left: 0;
        padding-top: 3rem;
    }

    #deleteAccountModal .modal-header::before {
        top: 0;
        left: 0;
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .session-item {
        padding: 0.85rem;
    }

    .session-icon {
        width: 34px;
        height: 34px;
    }

    .security-2fa-row {
        padding: 0.85rem;
    }

    .security-2fa-status {
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
    }

    #accountTab .card:nth-child(8)::after {
        display: none;
    }
}

/* ====== REDUCED MOTION (profile-specific animations disabled) ====== */
@media (prefers-reduced-motion: reduce) {
    .card,
    .tab-content,
    .tab-content.active,
    .tab-content.fade-out,
    .profile-container > *,
    .activity-item.stagger-in,
    .info-value.stat-animate {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .tabs-indicator {
        transition: none !important;
    }

    .tab-content.active .card {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .sub-credits-bar-fill {
        transition: none !important;
    }

    .sub-credits-bar-fill::after {
        animation: none !important;
    }

    .sub-cta-btn::after {
        animation: none !important;
    }

    .subscription-badge.active {
        animation: none !important;
    }

    .status-indicator {
        animation: none !important;
        opacity: 1 !important;
    }

    .info-value.credits-glow {
        animation: none !important;
    }

    .unread-dot {
        animation: none !important;
    }

    .card-action.save-success,
    .modal-btn-confirm.save-success {
        animation: none !important;
    }

    .btn-checkmark path {
        animation: none !important;
        stroke-dashoffset: 0 !important;
    }

    .form-group.expanding,
    .form-group.collapsing {
        animation: none !important;
    }

    .form-input.input-error {
        animation: none !important;
    }

    .toast.show {
        animation: none !important;
    }

    .toast-progress-bar {
        animation: none !important;
    }

    .modal-overlay,
    .modal-overlay .modal,
    .modal-overlay.closing,
    .modal-overlay.closing .modal {
        transition: none !important;
    }

    .modal {
        transform: none !important;
        opacity: 1;
    }

    .modal-overlay.active .modal {
        transform: none !important;
    }

    .toast {
        transform: none !important;
    }

    .toast.show {
        transform: none !important;
    }

    .empty-state {
        animation: none !important;
        opacity: 1 !important;
    }

    .empty-state-icon-wrap {
        animation: none !important;
    }

    .empty-state-icon-wrap::before {
        animation: none !important;
    }

    .inline-spinner,
    .btn-loading::after {
        animation: none !important;
    }

    .action-feedback {
        transition: none !important;
    }

    .notification-item.saved {
        animation: none !important;
    }

    .saved-card:hover .saved-card-score {
        transform: none !important;
    }

    .avatar-dropzone:hover,
    .avatar-dropzone.drag-over {
        transform: none !important;
    }

    .card-action:hover,
    .modal-btn-cancel:hover,
    .modal-btn-confirm:hover,
    .modal-btn-danger:hover,
    .saved-card-btn:hover,
    .pagination-btn:hover:not(:disabled),
    .session-revoke:hover,
    .sub-cta-btn.upgrade:hover,
    .sub-cta-btn.downgrade:hover,
    .activity-item:hover,
    .preference-card:hover {
        transform: none !important;
    }

    .skeleton {
        animation: none !important;
    }

    .password-strength-bar::after {
        transition: none !important;
    }

    .toggle-switch:active .toggle-slider::before {
        width: 18px;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ====== ACCOUNT INFO CARD (Enhanced) ====== */
.account-info-card {
    overflow: hidden;
}

.account-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.account-edit-btn .edit-pencil-icon {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.account-edit-btn:hover .edit-pencil-icon {
    transform: rotate(-12deg) scale(1.1);
}

.account-edit-btn.active {
    background: var(--vh-primary);
    border-color: var(--vh-primary);
    color: var(--vh-text);
}

.account-identity-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--vh-border);
}

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

.account-display-name {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--vh-text);
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.account-email-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.account-email-text {
    font-size: 0.9rem;
    color: var(--vh-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-email-btn,
.inline-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-xs, 8px);
    border: 1px solid var(--vh-border);
    background: var(--vh-surface-alt);
    color: var(--vh-text-muted);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    padding: 0;
}

.copy-email-btn:hover,
.inline-copy-btn:hover {
    border-color: var(--vh-primary);
    color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.08);
    transform: scale(1.08);
}

.copy-email-btn.copied,
.inline-copy-btn.copied {
    border-color: var(--vh-success);
    color: var(--vh-success);
    background: rgba(var(--vh-success-rgb), 0.1);
    animation: vh-copyPulse 0.4s ease;
}

@keyframes vh-copyPulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Copy-to-clipboard tooltip */
.copy-tooltip-wrap {
    position: relative;
    display: inline-flex;
}

.copy-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--vh-surface);
    color: var(--vh-text);
    border: 1px solid var(--vh-border);
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-xs, 8px);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.copy-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--vh-border);
}

.copy-tooltip.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.copy-tooltip.copied-state {
    background: var(--vh-success);
    border-color: var(--vh-success);
    color: var(--vh-surface);
}

.copy-tooltip.copied-state::after {
    border-top-color: var(--vh-success);
}

.account-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0;
}

.account-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-radius: var(--radius-md, 12px);
    transition: background 0.25s ease;
    position: relative;
}

.account-detail-item:hover {
    background: var(--vh-surface-alt);
}

.account-detail-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm, 10px);
    background: var(--vh-surface-alt);
    border: 1px solid var(--vh-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--vh-text-muted);
    transition: all 0.25s ease;
}

.account-detail-item:hover .account-detail-icon {
    border-color: var(--vh-primary);
    color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.06);
}

.account-detail-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.account-detail-content .info-label {
    margin-bottom: 0;
    font-size: 0.78rem;
}

.account-detail-content .info-value {
    font-size: 1.05rem;
}

.info-value-with-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-pill, 9999px);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    width: fit-content;
    transition: all 0.3s ease;
}

.plan-free {
    background: rgba(148, 163, 184, 0.12);
    color: #94A3B8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.plan-pro {
    background: rgba(var(--vh-primary-rgb), 0.14);
    color: #D4A800;
    border: 1px solid rgba(var(--vh-primary-rgb), 0.3);
    box-shadow: 0 0 12px rgba(var(--vh-primary-rgb), 0.1);
    animation: vh-proBadgeGlow 3s ease-in-out infinite;
}

@keyframes vh-proBadgeGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(var(--vh-primary-rgb), 0.08); }
    50% { box-shadow: 0 0 16px rgba(var(--vh-primary-rgb), 0.2); }
}

.plan-pro .plan-badge-icon {
    color: var(--vh-primary);
    filter: drop-shadow(0 0 3px rgba(var(--vh-primary-rgb), 0.4));
}

.plan-dealer {
    background: rgba(59, 130, 246, 0.12);
    color: #3B82F6;
    border: 1px solid rgba(59, 130, 246, 0.25);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.08);
}

.plan-enterprise {
    background: rgba(139, 92, 246, 0.12);
    color: #A78BFA;
    border: 1px solid rgba(139, 92, 246, 0.25);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.08);
}

/* Badge icon (star, shield, etc.) */
.plan-badge-icon {
    width: 12px;
    height: 12px;
    margin-right: 0.2rem;
    flex-shrink: 0;
}

.credits-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.45rem;
}

.credits-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-xs, 8px);
    overflow: hidden;
    border: 1px solid var(--vh-border);
    max-width: 120px;
}

.credits-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--vh-primary), #E2A100);
    border-radius: var(--radius-xs, 8px);
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}

/* Shimmer effect on credits bar */
.credits-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    animation: vh-creditsShimmer 2.5s ease-in-out infinite;
}

@keyframes vh-creditsShimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

.credits-progress-fill.low {
    background: linear-gradient(90deg, var(--vh-error), var(--vh-warning));
}

.credits-progress-fill.medium {
    background: linear-gradient(90deg, var(--vh-warning), var(--vh-warning));
}

.credits-progress-text {
    font-size: 0.72rem;
    color: var(--vh-text-muted);
    white-space: nowrap;
}

/* Low credits warning */
.credits-low-warning {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding: 0.4rem 0.7rem;
    background: rgba(var(--vh-error-rgb), 0.08);
    border: 1px solid rgba(var(--vh-error-rgb), 0.2);
    border-radius: var(--radius-xs, 8px);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--vh-error);
    animation: vh-lowCreditsFlash 2s ease-in-out infinite;
}

@keyframes vh-lowCreditsFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.credits-low-warning svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.account-detail-credits {
    grid-column: 1 / -1;
    padding-top: 0.75rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--vh-border);
}

.member-since-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.member-duration-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill, 9999px);
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(var(--vh-primary-rgb), 0.1);
    color: var(--vh-primary);
    border: 1px solid rgba(var(--vh-primary-rgb), 0.2);
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.member-duration-badge svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

.member-duration-badge:empty {
    display: none;
}

/* Duration badge color tiers */
.member-duration-badge.tenure-new {
    background: rgba(var(--vh-success-rgb), 0.1);
    color: var(--vh-success);
    border-color: rgba(var(--vh-success-rgb), 0.2);
}

.member-duration-badge.tenure-veteran {
    background: rgba(139, 92, 246, 0.1);
    color: #A78BFA;
    border-color: rgba(139, 92, 246, 0.2);
}

.account-edit-section {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.45s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                margin 0.35s ease;
    margin-top: 0;
}

.account-edit-section.open {
    max-height: 320px;
    opacity: 1;
    margin-top: 0.5rem;
}

.account-edit-inner {
    padding-top: 0.5rem;
}

.account-edit-divider {
    height: 1px;
    background: var(--vh-border);
    margin-bottom: 1.25rem;
}

.account-edit-heading {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--vh-primary);
    margin-bottom: 1rem;
}

.account-edit-fields {
    margin-bottom: 1rem;
}

.account-edit-fields .form-group {
    margin-bottom: 0.75rem;
}

.account-edit-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.account-edit-actions .modal-btn {
    padding: 0.55rem 1.25rem;
    font-size: 0.88rem;
}

@media (max-width: 768px) {
    .account-identity-row {
        gap: 1rem;
    }

    .account-display-name {
        font-size: 1.15rem;
    }

    .account-details-grid {
        grid-template-columns: 1fr;
    }

    .account-detail-item {
        padding: 0.75rem 0.85rem;
    }

    .account-detail-icon {
        width: 32px;
        height: 32px;
    }

    .account-edit-actions {
        flex-direction: column-reverse;
    }

    .account-edit-actions .modal-btn {
        width: 100%;
        text-align: center;
    }

    .credits-progress-bar {
        max-width: 100px;
    }
}

@media (max-width: 480px) {
    .account-identity-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .account-display-name {
        font-size: 1.1rem;
    }

    .account-email-text {
        font-size: 0.82rem;
    }

    .member-since-row {
        flex-wrap: wrap;
    }
}

/* ============================================================================
   ACTIVITY TAB -- Enhanced Styles
   ============================================================================ */

/* ====== SEARCH HISTORY FILTERS BAR ====== */
.search-history-filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--vh-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.filter-select,
.filter-input {
    padding: 0.45rem 0.75rem;
    border: 1.5px solid var(--vh-border);
    border-radius: var(--radius-xs, 6px);
    background: var(--vh-surface);
    color: var(--vh-text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    min-width: 0;
}

.filter-select:hover,
.filter-input:hover {
    border-color: var(--vh-text-muted);
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--vh-primary);
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb), 0.12);
}

.filter-input[type="date"] {
    max-width: 150px;
}

.filter-divider {
    width: 1px;
    height: 24px;
    background: var(--vh-border);
    flex-shrink: 0;
}

/* ====== SEARCH HISTORY CARDS (enhanced) ====== */
#activityTab .activity-item {
    padding: 0;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-md, 12px);
    border-left: none;
    overflow: hidden;
    cursor: default;
    transition: background 0.25s ease, box-shadow 0.3s ease, transform 0.25s ease;
    position: relative;
}

#activityTab .activity-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    background: var(--vh-surface-alt);
}

#activityTab .activity-item:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.search-card-inner {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 0;
}

.search-card-thumb {
    width: 100px;
    min-height: 80px;
    background: var(--vh-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.search-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

#activityTab .activity-item:hover .search-card-thumb img {
    transform: scale(1.08);
}

.search-card-thumb-placeholder {
    color: var(--vh-text-muted);
    opacity: 0.25;
    transition: opacity 0.25s ease;
}

#activityTab .activity-item:hover .search-card-thumb-placeholder {
    opacity: 0.4;
}

.search-card-body {
    flex: 1;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    gap: 0.3rem;
}

.search-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--vh-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.search-card-url {
    font-size: 0.78rem;
    color: var(--vh-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.7;
}

.search-card-date {
    font-size: 0.78rem;
    color: var(--vh-text-muted);
    margin-top: 0.15rem;
}

.search-card-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    border-radius: var(--radius-sm, 10px);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--vh-surface);
    flex-shrink: 0;
    margin: auto 0;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.search-card-score.good {
    background: var(--vh-success);
    box-shadow: 0 2px 8px rgba(var(--vh-success-rgb), 0.25);
}

.search-card-score.fair {
    background: #E2A100;
    box-shadow: 0 2px 8px rgba(226, 161, 0, 0.25);
}

.search-card-score.bad {
    background: var(--vh-error);
    box-shadow: 0 2px 8px rgba(var(--vh-error-rgb), 0.25);
}

#activityTab .activity-item:hover .search-card-score {
    transform: scale(1.1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.search-card-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.75rem;
    flex-shrink: 0;
}

.search-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-xs, 8px);
    border: 1.5px solid var(--vh-border);
    background: var(--vh-surface);
    color: var(--vh-text-muted);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

.search-card-btn:hover {
    border-color: var(--vh-primary);
    color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.06);
    transform: scale(1.1);
}

.search-card-btn:active {
    transform: scale(0.95);
}

.search-card-btn:focus-visible {
    outline: 2px solid var(--vh-primary);
    outline-offset: 2px;
}

.search-card-btn.view-btn:hover {
    border-color: var(--vh-primary);
    color: var(--vh-primary);
}

.search-card-btn.delete-btn:hover {
    border-color: var(--vh-error);
    color: var(--vh-error);
    background: rgba(var(--vh-error-rgb), 0.06);
}

.search-card-btn svg {
    width: 16px;
    height: 16px;
}

/* ====== CLEAR ALL HISTORY BUTTON ====== */
#btnClearHistory {
    color: var(--vh-error);
    border-color: rgba(var(--vh-error-rgb), 0.3);
    font-size: 0.82rem;
    padding: 0.4rem 0.9rem;
}

#btnClearHistory:hover {
    background: var(--vh-error);
    color: var(--vh-surface);
    border-color: var(--vh-error);
    box-shadow: 0 4px 14px rgba(var(--vh-error-rgb), 0.25);
}

.clear-history-warning {
    background: rgba(var(--vh-error-rgb), 0.06);
    border: 1px solid rgba(var(--vh-error-rgb), 0.15);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--vh-text);
    line-height: 1.5;
}

.clear-history-warning-icon {
    color: var(--vh-error);
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.clear-history-count {
    font-weight: 700;
    color: var(--vh-primary);
}

/* ====== LOAD MORE BUTTON ====== */
.load-more-container {
    display: flex;
    justify-content: center;
    padding-top: 1rem;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.75rem;
    border: 2px solid var(--vh-border);
    border-radius: var(--radius-pill, 9999px);
    background: var(--vh-surface);
    color: var(--vh-text);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}

.load-more-btn:hover {
    border-color: var(--vh-primary);
    background: rgba(var(--vh-primary-rgb), 0.04);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

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

.load-more-btn:focus-visible {
    outline: 2px solid var(--vh-primary);
    outline-offset: 2px;
}

.load-more-btn.loading {
    pointer-events: none;
    color: transparent;
}

.load-more-btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--vh-border);
    border-top-color: var(--vh-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
}

.load-more-count {
    font-size: 0.75rem;
    color: var(--vh-text-muted);
    font-weight: 400;
}

.pagination-btn.active {
    background: var(--vh-primary);
    color: var(--vh-text);
    border-color: var(--vh-primary);
}

.pagination-btn.active:hover {
    background: var(--vh-primary-hover);
    border-color: var(--vh-primary-hover);
}

/* ====== ACTIVITY LOG TIMELINE ====== */
.activity-timeline {
    position: relative;
    padding-left: 2.5rem;
}

.activity-timeline::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--vh-border) 0%, rgba(var(--vh-primary-rgb), 0.2) 50%, var(--vh-border) 100%);
    border-radius: var(--radius-xs, 8px);
}

.activity-timeline-item {
    position: relative;
    padding: 0.85rem 1.15rem;
    margin-bottom: 0.5rem;
    background: var(--vh-surface-alt);
    border-radius: var(--radius-sm);
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    cursor: default;
}

.activity-timeline-item:last-child {
    margin-bottom: 0;
}

.activity-timeline-item:hover {
    background: var(--vh-bg-highlight);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.activity-timeline-item:active {
    transform: translateX(2px);
}

.activity-timeline-icon {
    position: absolute;
    left: -2.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--vh-surface);
    z-index: 1;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.activity-timeline-item:hover .activity-timeline-icon {
    transform: translateY(-50%) scale(1.15);
}

.activity-timeline-icon svg {
    width: 14px;
    height: 14px;
    color: var(--vh-surface);
}

.activity-timeline-icon.login {
    background: #3B82F6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.activity-timeline-icon.search {
    background: var(--vh-success);
    box-shadow: 0 2px 8px rgba(var(--vh-success-rgb), 0.35);
}

.activity-timeline-icon.settings {
    background: #6B7280;
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.35);
}

.activity-timeline-icon.payment,
.activity-timeline-icon.billing {
    background: var(--vh-primary);
    box-shadow: 0 2px 8px rgba(var(--vh-primary-rgb), 0.35);
}

.activity-timeline-icon.security {
    background: var(--vh-error);
    box-shadow: 0 2px 8px rgba(var(--vh-error-rgb), 0.35);
}

.activity-timeline-icon.default {
    background: var(--vh-text-muted);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.activity-timeline-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.activity-timeline-body {
    flex: 1;
    min-width: 0;
}

.activity-timeline-action {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--vh-text);
    line-height: 1.3;
}

.activity-timeline-details {
    font-size: 0.8rem;
    color: var(--vh-text-muted);
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-timeline-timestamp {
    font-size: 0.75rem;
    color: var(--vh-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.25s ease;
}

.activity-timeline-item:hover .activity-timeline-timestamp {
    opacity: 1;
}

.activity-event-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-xs, 8px);
    margin-left: 0.5rem;
    vertical-align: middle;
}

.activity-event-badge.login {
    background: rgba(59, 130, 246, 0.12);
    color: #3B82F6;
}

.activity-event-badge.search {
    background: rgba(var(--vh-success-rgb), 0.12);
    color: var(--vh-success);
}

.activity-event-badge.settings {
    background: rgba(107, 114, 128, 0.12);
    color: #9CA3AF;
}

.activity-event-badge.payment,
.activity-event-badge.billing {
    background: rgba(var(--vh-primary-rgb), 0.12);
    color: var(--vh-primary);
}

.activity-event-badge.security {
    background: rgba(var(--vh-error-rgb), 0.12);
    color: var(--vh-error);
}

/* ====== EMPTY STATES (enhanced with illustrations) ====== */
#activityTab .empty-state {
    padding: 3.5rem 2rem;
}

.empty-state-illustration {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: var(--vh-surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: vh-emptyFloat 4s ease-in-out infinite;
}

@keyframes vh-emptyFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.empty-state-illustration::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px dashed var(--vh-border);
    opacity: 0.5;
    animation: vh-emptyRotate 20s linear infinite;
}

@keyframes vh-emptyRotate {
    to { transform: rotate(360deg); }
}

.empty-state-illustration svg {
    width: 48px;
    height: 48px;
    color: var(--vh-text-muted);
    opacity: 0.4;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--vh-text);
    margin-bottom: 0.5rem;
}

#activityTab .empty-state .empty-state-text {
    font-size: 0.9rem;
    color: var(--vh-text-muted);
    line-height: 1.5;
    max-width: 320px;
    margin: 0 auto;
}

.empty-state-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.25rem;
    padding: 0.55rem 1.25rem;
    border: 2px solid var(--vh-primary);
    border-radius: var(--radius-pill, 9999px);
    background: transparent;
    color: var(--vh-primary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    text-decoration: none;
}

.empty-state-cta:hover {
    background: var(--vh-primary);
    color: var(--vh-text);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--vh-primary-rgb), 0.25);
}

.empty-state-cta:active {
    transform: translateY(0);
}

/* ====== ACTIVITY STAGGER & REMOVE ANIMATIONS ====== */
#activityTab .activity-item.stagger-in,
.activity-timeline-item.stagger-in {
    opacity: 0;
    animation: vh-activityStaggerIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes vh-activityStaggerIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

#activityTab .activity-item.stagger-in:nth-child(1),
.activity-timeline-item.stagger-in:nth-child(1) { animation-delay: 0.03s; }
#activityTab .activity-item.stagger-in:nth-child(2),
.activity-timeline-item.stagger-in:nth-child(2) { animation-delay: 0.06s; }
#activityTab .activity-item.stagger-in:nth-child(3),
.activity-timeline-item.stagger-in:nth-child(3) { animation-delay: 0.09s; }
#activityTab .activity-item.stagger-in:nth-child(4),
.activity-timeline-item.stagger-in:nth-child(4) { animation-delay: 0.12s; }
#activityTab .activity-item.stagger-in:nth-child(5),
.activity-timeline-item.stagger-in:nth-child(5) { animation-delay: 0.15s; }
#activityTab .activity-item.stagger-in:nth-child(6),
.activity-timeline-item.stagger-in:nth-child(6) { animation-delay: 0.18s; }
#activityTab .activity-item.stagger-in:nth-child(7),
.activity-timeline-item.stagger-in:nth-child(7) { animation-delay: 0.21s; }
#activityTab .activity-item.stagger-in:nth-child(8),
.activity-timeline-item.stagger-in:nth-child(8) { animation-delay: 0.24s; }
#activityTab .activity-item.stagger-in:nth-child(9),
.activity-timeline-item.stagger-in:nth-child(9) { animation-delay: 0.27s; }
#activityTab .activity-item.stagger-in:nth-child(10),
.activity-timeline-item.stagger-in:nth-child(10) { animation-delay: 0.30s; }

#activityTab .activity-item.removing {
    animation: vh-activityRemove 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

@keyframes vh-activityRemove {
    to {
        opacity: 0;
        transform: translateX(30px) scale(0.95);
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* ====== SECTION DIVIDER ====== */
.activity-section-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--vh-text-muted);
}

.activity-section-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--vh-border);
}

/* ====== RIPPLE on activity items ====== */
#activityTab .activity-item::after,
.activity-timeline-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(var(--vh-primary-rgb), 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    border-radius: inherit;
}

#activityTab .activity-item:active::after,
.activity-timeline-item:active::after {
    opacity: 1;
    transition: opacity 0.05s ease;
}

/* ====== ACTIVITY TAB RESPONSIVE (768px) ====== */
@media (max-width: 768px) {
    .search-history-filters {
        gap: 0.5rem;
    }
    .filter-group {
        flex: 1 1 auto;
        min-width: 0;
    }
    .filter-group label {
        display: none;
    }
    .filter-select,
    .filter-input {
        width: 100%;
        min-height: 40px;
    }
    .filter-divider {
        display: none;
    }
    .search-card-inner {
        flex-direction: column;
    }
    .search-card-thumb {
        width: 100%;
        height: 120px;
        min-height: 0;
    }
    .search-card-body {
        padding: 0.75rem 1rem;
    }
    .search-card-actions {
        flex-direction: row;
        justify-content: flex-end;
        padding: 0 1rem 0.75rem;
        gap: 0.5rem;
    }
    .search-card-btn {
        width: 40px;
        height: 40px;
    }
    .activity-timeline {
        padding-left: 2rem;
    }
    .activity-timeline::before {
        left: 12px;
    }
    .activity-timeline-icon {
        left: -2rem;
        width: 24px;
        height: 24px;
    }
    .activity-timeline-icon svg {
        width: 11px;
        height: 11px;
    }
    .activity-timeline-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    .activity-timeline-timestamp {
        font-size: 0.72rem;
    }
    #activityTab .pagination {
        flex-wrap: wrap;
    }
    #activityTab .pagination-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem 0.75rem;
    }
    .load-more-btn {
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }
    .empty-state-illustration {
        width: 96px;
        height: 96px;
    }
    .empty-state-illustration svg {
        width: 36px;
        height: 36px;
    }
}

/* ====== ACTIVITY TAB RESPONSIVE (480px) ====== */
@media (max-width: 480px) {
    .search-history-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group {
        width: 100%;
    }
    .search-card-score {
        min-width: 34px;
        height: 34px;
        font-size: 0.8rem;
        border-radius: var(--radius-xs, 8px);
    }
    .activity-timeline {
        padding-left: 1.75rem;
    }
    .activity-timeline::before {
        left: 10px;
    }
    .activity-timeline-icon {
        left: -1.75rem;
        width: 22px;
        height: 22px;
        border-width: 2px;
    }
    .activity-timeline-icon svg {
        width: 10px;
        height: 10px;
    }

    .activity-filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem 1rem;
    }

    .activity-date-range {
        width: 100%;
    }

    .activity-date-input {
        flex: 1;
        min-width: 0;
    }

    .pref-section {
        padding: 0.85rem 1rem;
    }

    .pref-notif-row {
        padding: 0.85rem 1rem;
    }

    .pref-budget-inputs {
        flex-wrap: wrap;
    }

    .pref-budget-field {
        min-width: 0;
    }
}

/* ====== ACTIVITY TAB TOUCH TARGETS ====== */
@media (pointer: coarse) {
    .search-card-btn {
        width: 44px;
        height: 44px;
    }
    .filter-select,
    .filter-input {
        min-height: 44px;
        padding: 0.5rem 0.85rem;
    }
    .load-more-btn {
        min-height: 48px;
        padding: 0.75rem 2rem;
    }
    .activity-timeline-item {
        padding: 1rem 1.25rem;
        min-height: 48px;
    }
    #activityTab .activity-item {
        min-height: 0;
    }
    .empty-state-cta {
        min-height: 44px;
        padding: 0.6rem 1.5rem;
    }
}

/* ============================================================================
   AVATAR UPLOAD PROGRESS RING
   ---------------------------------------------------------------------------- */

.avatar-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    z-index: 2;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.avatar-upload-progress {
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-progress-ring {
    width: 48px;
    height: 48px;
    transform: rotate(-90deg);
}

.avatar-progress-ring svg {
    width: 100%;
    height: 100%;
}

.avatar-ring-bg {
    stroke: rgba(255, 255, 255, 0.15);
}

.avatar-ring-fill {
    stroke: var(--vh-primary);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================================
   TOAST CONTAINER (stacking system)
   ---------------------------------------------------------------------------- */

.vh-toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 380px;
    min-width: 280px;
    pointer-events: none;
}

.vh-toast-container .toast {
    position: relative;
    top: auto;
    right: auto;
    pointer-events: all;
    transform: translateX(calc(100% + 2rem));
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.3s ease,
                margin-top 0.3s ease;
}

.vh-toast-container .toast.show {
    transform: translateX(0);
}

.vh-toast-container .toast.hiding {
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
    margin-top: -4rem;
}

.vh-toast-container .toast:nth-child(n+2) {
    top: auto;
}

@media (max-width: 768px) {
    .vh-toast-container {
        left: 0.75rem;
        right: 0.75rem;
        top: 0.75rem;
        max-width: none;
        min-width: 0;
    }
}

/* ============================================================================
   BILLING TABLE -- Responsive card layout on mobile
   ---------------------------------------------------------------------------- */

@media (max-width: 640px) {
    .sub-billing-table thead {
        display: none;
    }

    .sub-billing-table,
    .sub-billing-table tbody,
    .sub-billing-table tbody tr,
    .sub-billing-table tbody td {
        display: block;
        width: 100%;
    }

    .sub-billing-table tbody tr {
        padding: 1rem;
        margin-bottom: 0.75rem;
        border-radius: var(--radius-sm);
        border: 1px solid var(--vh-border);
        background: var(--vh-surface-alt);
    }

    .sub-billing-table tbody tr:hover {
        border-color: rgba(var(--vh-primary-rgb), 0.3);
    }

    .sub-billing-table tbody td {
        padding: 0.35rem 0;
        border-bottom: none;
        white-space: normal;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .sub-billing-table tbody td::before {
        content: attr(data-label);
        font-size: 0.72rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--vh-text-muted);
        flex-shrink: 0;
        margin-right: 1rem;
    }

    .sub-billing-table tbody td:first-child {
        border-radius: 0;
        font-weight: 600;
    }

    .sub-billing-table tbody td:last-child {
        border-radius: 0;
    }
}

/* ============================================================================
   360px BREAKPOINT -- Very small devices
   ---------------------------------------------------------------------------- */

@media (max-width: 360px) {
    .profile-container {
        padding: calc(56px + 1.5rem) 0.75rem 2.5rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .page-subtitle {
        font-size: 0.85rem;
    }

    .tabs {
        padding: 0 0.25rem;
    }

    .tab {
        padding: 0.5rem 0.6rem;
        font-size: 0.76rem;
    }

    .card {
        padding: 0.85rem;
        border-radius: var(--radius-md, 14px);
    }

    .card-title {
        font-size: 1rem;
    }

    .card-header {
        margin-bottom: 0.75rem;
    }

    .card-action {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .info-value {
        font-size: 0.95rem;
    }

    .info-label {
        font-size: 0.75rem;
    }

    .modal {
        max-height: 92vh;
    }

    .modal-header {
        padding: 1.25rem 1.25rem 0;
    }

    .modal-body {
        padding: 1rem 1.25rem 0.5rem;
    }

    .modal-actions {
        padding: 0 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0));
    }

    .modal-title {
        font-size: 1.1rem;
    }

    .avatar-dropzone {
        width: 64px;
        height: 64px;
    }

    .notification-item {
        padding: 0.85rem;
    }

    .notification-info {
        padding-left: 0;
    }

    .notification-info::before {
        display: none;
    }

    .session-item {
        padding: 0.85rem;
    }

    .activity-item {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .pref-body-types {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }

    .pref-usage-pills {
        grid-template-columns: 1fr;
    }

    .pref-multi-pills {
        gap: 0.35rem;
    }

    .pref-multi-pill {
        padding: 0.4rem 0.75rem;
        font-size: 0.78rem;
    }

    .language-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .language-option {
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
    }

    .saved-card-body {
        padding: 0.75rem 0.85rem 0.5rem;
    }

    .saved-card-actions {
        padding: 0.5rem 0.85rem 0.75rem;
    }

    .sub-credits-meter {
        padding: 0.85rem;
    }

    .sub-credits-meter-count {
        font-size: 0.9rem;
    }

    .context-toggle-option {
        padding: 1rem 0.85rem;
    }

    .form-input, .form-select {
        font-size: 0.9rem;
        padding: 0.65rem 0.85rem;
    }
}

/* ============================================================================
   REDUCED MOTION -- Accessibility preference
   ---------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .tabs-indicator {
        transition: none;
    }

    .tab-content.active {
        animation: none;
        opacity: 1;
    }

    .tab-content.fade-out {
        animation: none;
        opacity: 0;
    }

    .card {
        animation: none;
        opacity: 1;
    }

    .tab-content.active .card {
        animation: none;
        opacity: 1;
    }

    .skeleton {
        animation: none;
        background: var(--vh-surface-alt);
    }

    .sub-credits-bar-fill {
        transition: none;
    }

    .sub-credits-bar-fill::after {
        animation: none;
    }

    .sub-cta-btn::after {
        animation: none;
    }

    .subscription-badge.active {
        animation: none;
    }

    .status-indicator {
        animation: none;
        opacity: 1;
    }

    .info-value.credits-glow {
        animation: none;
    }

    .empty-state-icon-wrap {
        animation: none;
    }

    .empty-state-icon-wrap::before {
        animation: none;
    }

    .toast {
        transition: opacity 0.01ms !important;
        transform: none !important;
    }

    .toast.show {
        animation: none;
        transform: none !important;
    }

    .toast-progress-bar {
        animation: none;
        transform: scaleX(0);
    }

    .modal {
        transition: opacity 0.01ms !important;
        transform: none !important;
    }

    .modal-overlay {
        transition: opacity 0.01ms !important;
    }

    .modal-overlay.active .modal {
        transform: none;
    }

    .activity-item.stagger-in {
        animation: none;
        opacity: 1;
    }

    .saved-card {
        animation: none;
        opacity: 1;
    }

    .profile-container > * {
        animation: none;
        opacity: 1;
    }

    .unread-dot {
        animation: none;
    }

    .toggle-slider,
    .toggle-slider::before {
        transition-duration: 0.01ms !important;
    }

    .avatar-dropzone {
        transition: none;
    }

    .avatar-ring-fill {
        transition: none;
    }

    .form-input.input-error {
        animation: none;
    }

    .pref-save-btn.success {
        animation: none;
    }

    .card-action.save-success,
    .modal-btn-confirm.save-success {
        animation: none;
    }

    .btn-checkmark path {
        animation: none;
        stroke-dashoffset: 0;
    }

    .saved-empty-icon {
        animation: none;
    }

    .notification-item.saved {
        animation: none;
    }
}

/* ============================================================================
   MOBILE DEEP POLISH — comprehensive touch & layout refinements
   ---------------------------------------------------------------------------- */

/* ====== 1. TAB BAR — scrollable, no overflow, fade edges ====== */
@media (max-width: 768px) {
    .tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        -ms-overflow-style: none;
        mask-image: linear-gradient(to right, transparent 0, #000 1rem, #000 calc(100% - 1rem), transparent 100%);
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 1rem, #000 calc(100% - 1rem), transparent 100%);
        padding: 0 0.75rem;
    }
    .tabs::-webkit-scrollbar { display: none; }
    .tab {
        flex-shrink: 0;
        scroll-snap-align: center;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .tabs {
        padding: 0 0.5rem;
        gap: 0;
    }
    .tab {
        padding: 0.6rem 0.7rem;
        font-size: 0.8rem;
    }
}

/* ====== 2. AVATAR — centered, proper size on mobile ====== */
@media (max-width: 768px) {
    .account-identity-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }
    .avatar-dropzone {
        width: 88px;
        height: 88px;
        flex-shrink: 0;
    }
    .account-identity-info {
        align-items: center;
        text-align: center;
    }
    .account-email-row {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .avatar-dropzone {
        width: 76px;
        height: 76px;
    }
    .account-display-name {
        font-size: 1.05rem;
    }
    .account-email-text {
        font-size: 0.8rem;
    }
}

/* ====== 3. ACCOUNT INFO — stacked, readable ====== */
@media (max-width: 768px) {
    .account-details-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .account-detail-item {
        padding: 0.85rem 1rem;
    }
    .info-value {
        font-size: 0.92rem;
        word-break: break-word;
    }
    .info-label {
        font-size: 0.78rem;
    }
}

@media (max-width: 480px) {
    .account-detail-item {
        padding: 0.75rem 0.85rem;
    }
    .account-detail-icon {
        width: 32px;
        height: 32px;
    }
    .info-value-with-action {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }
}

/* ====== 4. MODALS — bottom sheet polish ====== */
@media (max-width: 768px) {
    .modal {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    .modal-body {
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    .modal-actions .modal-btn {
        min-height: 48px;
        font-size: 0.95rem;
        border-radius: var(--radius-md, 12px);
    }
    /* Drag handle for bottom sheet feel */
    .modal-header::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: var(--vh-border);
        border-radius: var(--radius-xs, 8px);
        margin: 0 auto 1rem;
    }
}

@media (max-width: 480px) {
    .modal {
        max-height: 92vh;
    }
    .modal-header {
        padding: 1.25rem 1.25rem 0;
    }
    .modal-body {
        padding: 1rem 1.25rem 0.5rem;
    }
    .modal-actions {
        padding: 0 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0));
        gap: 0.5rem;
    }
    .modal-title {
        font-size: 1.1rem;
    }
}

/* ====== 5. BILLING TABLE — card layout on small screens ====== */
@media (max-width: 640px) {
    .sub-billing-scroll {
        overflow-x: visible;
    }
    .sub-billing-table {
        border: none;
        border-collapse: collapse;
    }
    .sub-billing-table thead {
        display: none;
    }
    .sub-billing-table tbody {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    .sub-billing-table tbody tr {
        display: flex;
        flex-direction: column;
        background: var(--vh-surface-alt);
        border-radius: var(--radius-md, 12px);
        padding: 1rem;
        gap: 0.5rem;
        border: 1px solid var(--vh-border);
    }
    .sub-billing-table tbody tr:nth-child(odd),
    .sub-billing-table tbody tr:nth-child(even) {
        background: var(--vh-surface-alt);
    }
    .sub-billing-table tbody tr:hover {
        background: var(--vh-bg-highlight);
    }
    .sub-billing-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.35rem 0;
        font-size: 0.85rem;
        border: none;
        border-bottom: none;
        border-radius: 0;
        white-space: normal;
    }
    .sub-billing-table tbody td:first-child,
    .sub-billing-table tbody td:last-child {
        border-radius: 0;
    }
    .sub-billing-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.78rem;
        color: var(--vh-text-muted);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        flex-shrink: 0;
        margin-right: 1rem;
    }
    .sub-billing-status {
        font-size: 0.72rem;
    }
}

/* ====== 6. SAVED CARDS — single column on mobile (already 1fr at 640px, polish) ====== */
@media (max-width: 640px) {
    .saved-cards-grid {
        gap: 0.85rem;
    }
    .saved-card {
        border-radius: var(--radius-lg, 16px);
    }
    .saved-card-header {
        padding: 0.75rem 1rem;
    }
    .saved-card-body {
        padding: 0.85rem 1rem;
    }
    .saved-card-actions {
        flex-direction: row;
        justify-content: stretch;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }
    .saved-card-btn {
        flex: 1;
        justify-content: center;
        text-align: center;
        min-height: 44px;
    }
    .saved-toolbar {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    .saved-sort-group {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ====== 7. MESSAGES — full width bubbles, readable thread ====== */
@media (max-width: 768px) {
    .message-thread-body {
        max-height: 50vh;
    }
    .message-bubble {
        max-width: 92%;
    }
    .message-reply-area {
        flex-direction: column;
        gap: 0.5rem;
    }
    .message-reply-textarea {
        min-height: 80px;
        font-size: 1rem;
    }
    .message-send-btn {
        min-height: 44px;
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .message-bubble {
        max-width: 96%;
        padding: 0.65rem 0.85rem;
        font-size: 0.88rem;
    }
    .message-thread-body {
        max-height: 45vh;
        padding: 0.75rem 0.5rem;
    }
    .message-item {
        gap: 0.5rem;
    }
    .message-thread-header {
        flex-wrap: wrap;
    }
    .message-thread-back {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .message-reply-area {
        padding: 0.65rem;
    }
    .message-send-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ====== 8. ACTIVITY TIMELINE — compact on mobile (augmenting existing) ====== */
@media (max-width: 768px) {
    .activity-filter-pills {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.35rem;
        padding-bottom: 0.25rem;
    }
    .activity-filter-pills::-webkit-scrollbar { display: none; }
    .activity-filter-pill {
        flex-shrink: 0;
        white-space: nowrap;
    }
    .activity-filter-bar {
        gap: 0.75rem;
    }
    .activity-timeline-item {
        padding: 0.75rem 1rem;
        margin-bottom: 0.35rem;
    }
    .activity-timeline-action {
        font-size: 0.85rem;
    }
    .activity-timeline-details {
        font-size: 0.75rem;
    }
    /* Disable hover translate on touch */
    .activity-timeline-item:hover {
        transform: none;
    }
}

@media (max-width: 480px) {
    .activity-timeline-item {
        padding: 0.65rem 0.85rem;
        margin-bottom: 0.25rem;
    }
    .activity-timeline-action {
        font-size: 0.82rem;
    }
    .activity-filter-pill {
        padding: 0.45rem 0.75rem;
        font-size: 0.78rem;
    }
    .activity-date-input {
        font-size: 0.82rem;
        min-height: 44px;
    }
}

/* ====== 9. PREFERENCES — sliders/toggles touch-friendly ====== */
@media (pointer: coarse) {
    /* Budget range slider: larger thumb for touch */
    .pref-budget-slider input[type="range"]::-webkit-slider-thumb {
        width: 30px;
        height: 30px;
        border-width: 3px;
    }
    .pref-budget-slider input[type="range"]::-moz-range-thumb {
        width: 30px;
        height: 30px;
        border-width: 3px;
    }
    /* Touch-friendly pills */
    .pref-usage-pill {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .pref-body-type {
        min-height: 44px;
    }
    .pref-condition-pill {
        min-height: 44px;
        padding: 0.5rem 1rem;
    }
    .context-toggle-option {
        min-height: 48px;
    }
    .pref-priority-item {
        min-height: 48px;
        padding: 0.85rem 1rem;
    }
    .pref-priority-handle {
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .pref-save-btn {
        min-height: 48px;
        padding: 0.75rem 2rem;
    }
    .pref-notif-row {
        min-height: 48px;
    }
}

@media (max-width: 768px) {
    .pref-budget-slider {
        height: 40px;
        margin: 0.5rem 0 1rem;
    }
    .pref-priority-list {
        gap: 0.35rem;
    }
    .pref-notif-row {
        gap: 0.75rem;
    }
    .pref-section {
        padding: 1rem 1.15rem;
    }
}

@media (max-width: 480px) {
    .pref-body-types {
        gap: 0.4rem;
    }
    .pref-body-type {
        padding: 0.6rem 0.25rem;
        font-size: 0.75rem;
    }
    .pref-body-type svg {
        width: 28px;
        height: 28px;
    }
}

/* ====== 10. ALL BUTTONS — minimum 44px touch targets (catch-all) ====== */
@media (pointer: coarse) {
    /* Buttons and interactive elements that may have been missed */
    .card-action,
    .modal-btn,
    .btn-new-message,
    .message-filter-btn,
    .messages-filter-btn,
    .activity-filter-pill,
    .pref-save-btn,
    .sub-cta-btn,
    .sub-manage-btn,
    .data-export-btn,
    .delete-account-btn,
    .twofa-btn,
    .session-revoke,
    .saved-card-btn,
    .message-send-btn,
    .message-thread-back,
    .load-more-btn,
    .pagination-btn {
        min-height: 44px;
        min-width: 44px;
    }
    /* Form controls */
    .form-input,
    .form-select,
    .form-textarea,
    .activity-date-input {
        min-height: 48px;
        font-size: max(1rem, 16px); /* prevent iOS zoom on focus */
    }
    /* Inline action buttons */
    .inline-copy-btn,
    .copy-email-btn,
    .account-edit-btn {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* ====== SAFE AREA INSETS — notch & home indicator ====== */
@media (max-width: 768px) {
    .profile-container {
        padding-left: calc(1rem + env(safe-area-inset-left));
        padding-right: calc(1rem + env(safe-area-inset-right));
        padding-bottom: calc(3rem + env(safe-area-inset-bottom));
    }
    .modal-actions {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0));
    }
}

/* ====== BILLING TABLE: MOBILE CARD LAYOUT ====== */
@media (max-width: 640px) {
    .sub-billing-table thead {
        display: none;
    }
    .sub-billing-table tbody,
    .sub-billing-table tbody tr,
    .sub-billing-table tbody td {
        display: block;
        width: 100%;
    }
    .sub-billing-table tbody tr {
        background: var(--vh-surface-alt);
        border: 1px solid var(--vh-border);
        border-radius: var(--radius-md, 12px);
        padding: 1rem 1.15rem;
        margin-bottom: 0.75rem;
        position: relative;
    }
    .sub-billing-table tbody tr:nth-child(odd),
    .sub-billing-table tbody tr:nth-child(even) {
        background: var(--vh-surface-alt);
    }
    .sub-billing-table tbody tr:hover {
        border-color: rgba(var(--vh-primary-rgb), 0.3);
        background: rgba(var(--vh-primary-rgb), 0.03);
    }
    .sub-billing-table tbody td {
        padding: 0.25rem 0;
        border-bottom: none;
        border-radius: 0;
        white-space: normal;
    }
    .sub-billing-table tbody td::before {
        content: attr(data-label);
        display: inline-block;
        font-size: 0.72rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--vh-text-muted);
        width: 80px;
        flex-shrink: 0;
    }
    .sub-billing-table tbody td {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    .sub-billing-table tbody td:first-child {
        font-weight: 600;
        font-size: 0.95rem;
        margin-bottom: 0.15rem;
        border-radius: 0;
    }
    .sub-billing-table tbody td:last-child {
        border-radius: 0;
    }
}

/* ====== UPGRADE MODAL: SIDE-BY-SIDE FEATURE LISTS ====== */
.sub-upgrade-side-credits {
    display: block;
    font-size: 0.82rem;
    color: var(--vh-text-muted);
    margin-top: 0.25rem;
    font-weight: 600;
}
.sub-upgrade-side.new-plan .sub-upgrade-side-credits {
    color: var(--vh-primary);
}
.sub-upgrade-side-features {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-align: left;
}
.sub-upgrade-side-features li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--vh-text-secondary);
    line-height: 1.35;
}
.sub-upgrade-side-features li svg {
    flex-shrink: 0;
    color: var(--vh-success);
}
.sub-upgrade-side.new-plan .sub-upgrade-side-features li svg {
    color: var(--vh-primary);
}

/* ====== TAB PANEL CROSSFADE ANIMATION ====== */
.tab-content.fade-out {
    animation: vh-tabFadeOut 0.2s ease forwards;
    pointer-events: none;
}
/* ====== PLAN COMPARISON GRID: ENSURE EVEN COLUMNS ====== */
@media (min-width: 900px) {
    .sub-comparison-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ====== CREDITS LOW WARNING BANNER ====== */
.credits-low-warning {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    margin-top: 0.75rem;
    background: rgba(var(--vh-error-rgb), 0.08);
    border: 1px solid rgba(var(--vh-error-rgb), 0.2);
    border-radius: var(--radius-sm, 8px);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--vh-error, #ef4444);
    animation: vh-creditsWarn 0.5s ease;
}
.credits-low-warning svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--vh-error, #ef4444);
}
@keyframes vh-creditsWarn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ====== GENERAL STAGGER-IN FOR NON-ACTIVITY ITEMS ====== */
.session-item.stagger-in,
.notification-item.stagger-in,
.message-item.stagger-in {
    opacity: 0;
    animation: vh-staggerFadeIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ====== AVATAR UPLOAD PROGRESS RING ====== */
.avatar-spinner {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    backdrop-filter: blur(2px);
}
.avatar-upload-progress {
    display: flex;
    align-items: center;
    justify-content: center;
}
.avatar-progress-ring svg {
    width: 36px;
    height: 36px;
    transform: rotate(-90deg);
}
.avatar-ring-bg {
    stroke: rgba(255, 255, 255, 0.15);
}
.avatar-ring-fill {
    stroke: var(--vh-primary);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.2s ease;
}
