/* Instagram Viewer - Optimized CSS */

:root {
    /* Backgrounds */
    --bg: #f5f5f7;
    --card-bg: #ffffff;
    --item-bg: #ebebed;
    --item-hover: #e3e3e5;
    --overlay-bg: #000;
    
    /* Text colors */
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-tertiary: #afafaf;
    --text-on-dark: #fff;
    --text-on-accent: #fff;
    
    /* Borders */
    --border: #d1d1d6;
    --border-light: #dadadd;
    --accent: #1d1d1f;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
    --shadow: 0 2px 8px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.05);
    --shadow-lg: 0 4px 16px rgba(0,0,0,.12), 0 8px 32px rgba(0,0,0,.08);
    
    /* Border radius */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Accent & gradients */
    --accent-color: #FF006E;
    --accent-color-soft: #e00062;
    --accent-color-rgb: 255,0,110;
    --gradient-warm-start: #FF006E;
    --gradient-warm-mid: #FF5C8A;
    --gradient-warm-end: #FFB347;

/* --accent-color: #DC143C;
--accent-color-soft: #c41136;
--accent-color-rgb: 220,20,60;
--gradient-warm-start: #DC143C;
--gradient-warm-mid: #E94B7C;
--gradient-warm-end: #FF6B9D; */

    /* Component-specific */
    --search-btn-bg: #1d1d1f;
    --search-btn-color: #fff;
    
    /* Spacing scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Transitions */
    --transition-fast: 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    /* Backgrounds */
    --bg: #000000;
    --card-bg: #030303;
    --item-bg: #0d0d0d;
    --item-hover: #131313;
    --overlay-bg: #000;
    
    /* Text colors */
    --text-primary: #fafafa;
    --text-secondary: #a1a1a6;
    --text-tertiary: #48484a;
    --text-on-dark: #fff;
    --text-on-accent: #fff;
    
    /* Borders */
    --border: rgba(255,255,255,.06);
    --border-light: #151515;
    --accent: #fafafa;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 2px 4px rgba(0,0,0,.2);
    --shadow: 0 2px 4px rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.25);
    --shadow-lg: 0 4px 12px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
}

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

html { font-size: 16px; scroll-behavior: smooth; }
@media (max-width: 768px) { html { font-size: 15px; } }
@media (max-width: 480px) { html { font-size: 14px; } }

body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
background: 
        radial-gradient(ellipse at top left, rgba(var(--accent-color-rgb), 0.03) 0%, transparent 100%),
        var(--bg);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

input, textarea, select, button {
    font-family: inherit;
}

[data-theme="dark"] body {
    background: 
        radial-gradient(ellipse at bottom left, rgba(var(--accent-color-rgb), 0.04) 0%, transparent 100%),
        var(--bg);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 32px) 60px;
}

/* Header */
.site-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-light);
    padding: 0 clamp(12px, 4vw, 32px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 clamp(16px, 4vw, 48px);
    position: relative;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

/* Image-based logo with theme switching */
.logo-image {
    height: 54px;
    width: auto;
    display: block;
    /* Crop ~3% from the right edge */
    clip-path: inset(0 3% 0 0);
    margin-right: -3%; /* Compensate for the clipped space */
}

.logo-image.logo-light {
    display: block;
}

.logo-image.logo-dark {
    display: none;
}

[data-theme="dark"] .logo-image.logo-light {
    display: none;
}

[data-theme="dark"] .logo-image.logo-dark {
    display: block;
}

/* Fallback text logo (hidden when images exist) */
.logo-icon { width: 24px; height: 24px; display: none; align-items: center; justify-content: center; }
.logo-icon svg { width: 20px; height: 20px; }

.logo-text { font-size: 20px; font-weight: 700; letter-spacing: -.5px; color: var(--text-primary); display: none; }
.logo-accent { color: var(--accent-color); }

/* Logo link */
.logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.5px;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
}

/* Header Navigation */
.header-nav {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-right: 12px;
}

.nav-link {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: background .15s, color .15s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--item-bg);
}

/* Dropdown Navigation */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-toggle svg {
    width: 12px;
    height: 12px;
    transition: transform .15s;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .15s, transform .15s, visibility .15s;
    z-index: 1000;
}

.dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: background .1s;
}

.dropdown-item:hover {
    background: var(--item-bg);
}

.header-notes {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 24px;
    pointer-events: none;
}

.note {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: lowercase;
    letter-spacing: .3px;
    opacity: .7;
    transition: opacity .2s;
}
.note-1 { transform: translateY(-3px); }
.note-2 { transform: translateY(4px); opacity: .6; }
.note-3 { transform: translateY(-5px); font-weight: 600; opacity: .8; }
.note-4 { transform: translateY(3px); opacity: .55; }
.note-5 { transform: translateY(-2px); opacity: .65; }
.site-header:hover .note { opacity: 1; }

.site-header .theme-slider { position: static; }

/* Theme Slider Toggle */
.theme-slider {
    position: fixed;
    top: 20px;
    right: 20px;
    cursor: pointer;
    z-index: 100;
    transition: transform .15s;
}
.theme-slider:hover { transform: scale(1.08); }
.theme-slider:active { transform: scale(.92); }

.slider-track {
    position: relative;
    width: 44px;
    height: 22px;
    background: linear-gradient(135deg, #74b9ff 0%, #81ecec 50%, #ffeaa7 100%);
    border-radius: 11px;
    box-shadow: 
        var(--shadow-sm),
        inset 0 1px 2px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    transition: background .4s cubic-bezier(.4, 0, .2, 1), box-shadow .3s;
    overflow: hidden;
}

[data-theme="dark"] .slider-track {
    background: linear-gradient(135deg, #2d3436 0%, #636e72 50%, #1e272e 100%);
    box-shadow: 
        var(--shadow-sm),
        inset 0 1px 2px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

.slider-thumb {
    position: absolute;
    left: 3px;
    width: 16px;
    height: 16px;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 50%;
    box-shadow: 
        0 1px 4px rgba(0, 0, 0, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: left .4s cubic-bezier(.4, 0, .2, 1), transform .2s, background .3s;
    z-index: 2;
}

[data-theme="dark"] .slider-thumb {
    left: calc(100% - 19px);
    background: linear-gradient(145deg, #dfe6e9 0%, #b2bec3 100%);
    box-shadow: 
        0 1px 4px rgba(0, 0, 0, 0.4),
        0 1px 2px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.slider-thumb::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), transparent 50%);
    border-radius: 50%;
}

.slider-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    transition: opacity .3s, transform .3s;
    z-index: 1;
}

.slider-icon svg {
    width: 10px;
    height: 10px;
    stroke-width: 2;
    fill: none;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
}

.slider-icon.icon-sun svg {
    stroke: #f39c12;
    fill: #f39c12;
    fill-opacity: 0.2;
}

.slider-icon.icon-moon svg {
    stroke: #ecf0f1;
    fill: #ecf0f1;
    fill-opacity: 0.3;
}

/* Light mode: sun visible, moon faded */
.icon-sun { opacity: 1; transform: scale(1); }
.icon-moon { opacity: 0.4; transform: scale(0.9); }

/* Dark mode: moon visible, sun faded */
[data-theme="dark"] .icon-sun { opacity: 0.4; transform: scale(0.9); }
[data-theme="dark"] .icon-moon { opacity: 1; transform: scale(1); }

/* Hover glow effect */
.theme-slider:hover .slider-track {
    box-shadow: 
        var(--shadow),
        inset 0 1px 2px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.3),
        0 0 12px rgba(116, 185, 255, 0.3);
}

[data-theme="dark"] .theme-slider:hover .slider-track {
    box-shadow: 
        var(--shadow),
        inset 0 1px 2px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 0 12px rgba(99, 110, 114, 0.4);
}

/* Search */
.search-container { display: flex; justify-content: center; margin-bottom: 40px; padding-top: 24px; }

.search-box {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 6px 6px 6px 20px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow);
    transition: box-shadow .15s, transform .15s, border-color .15s;
}
.search-box:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--border); }
.search-box:focus-within { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: rgba(0,0,0,.15); }
[data-theme="dark"] .search-box:focus-within { box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.1); }

.at-symbol { color: var(--text-tertiary); font-size: 16px; font-weight: 500; transition: color .15s, transform .15s; transform: translateY(-1px); }
.search-box:hover .at-symbol { color: var(--text-secondary); }
.search-box:focus-within .at-symbol { color: var(--text-primary); transform: translateY(-1px) scale(1.1); }

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 14px 10px;
    background: transparent;
    color: var(--text-primary);
}
.search-box input::placeholder { color: var(--text-tertiary); }

.search-btn {
    background: var(--search-btn-bg);
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--search-btn-color);
    transition: background .2s ease, transform .15s ease, box-shadow .2s ease;
}
.search-btn svg { width: 16px; height: 16px; stroke: var(--search-btn-color); stroke-width: 2; fill: none; transition: stroke .2s ease; }
.search-btn:hover { background: #333; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.search-btn:active { transform: scale(.95); }
.search-btn:disabled { opacity: .5; cursor: not-allowed; }

[data-theme="dark"] .search-btn:hover { background: #3a3a3a; box-shadow: 0 2px 12px rgba(0,0,0,.3); }

/* Loading */
.loading { text-align: center; padding: 10px 0; }
.loader-container { display: flex; flex-direction: column; align-items: center; }

.loader-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(110deg, #d0d0d0 30%, #ffffff 50%, #d0d0d0 70%);
    background-size: 200% 100%;
    animation: shimmer 1.2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}
[data-theme="dark"] .loader-avatar {
    background: linear-gradient(110deg, #0f0f0f 30%, #4a4a4a 50%, #0f0f0f 70%);
    background-size: 200% 100%;
}
.loader-avatar.loaded {
    animation: none;
    background: var(--border-light);
}
.loader-avatar img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.loader-avatar.loaded img { opacity: 1; }

.loader-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    border-top-color: #3b82f6;
    animation: spin .7s linear infinite;
}
.loader-ring.done { border-top-color: #22c55e; animation: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.loader-username {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .25s, transform .25s;
    min-height: 24px;
}
.loader-username.show { opacity: 1; transform: translateY(0); }

.loader-status { font-size: 14px; color: var(--text-secondary); display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 20px; }
.loader-status.done { color: #22c55e; }

.loader-dots span { display: inline-block; width: 4px; height: 4px; background: var(--text-secondary); border-radius: 50%; animation: blink .9s ease-in-out infinite; }
.loader-dots span:nth-child(2) { animation-delay: .15s; }
.loader-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

/* Error - Compact inline style */
.error-card {
    text-align: center;
    padding: 16px 24px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    max-width: 400px;
    margin: 24px auto;
}
.error-message {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.error-retry {
    background: none;
    color: var(--accent-color);
    border: none;
    padding: 8px 0;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity .15s;
    display: inline-block;
}
.error-retry:hover { opacity: .7; }
.error-retry:active { opacity: .5; }

/* Profile Card */
.profile-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: clamp(16px, 3vw, 24px) clamp(16px, 4vw, 32px);
    display: flex;
    gap: clamp(14px, 3vw, 24px);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    scroll-margin-top: 80px;
    transition: box-shadow .15s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-pic-wrapper {
    position: relative;
    width: 110px;
    height: 110px;
    flex-shrink: 0;
    text-decoration: none;
    cursor: pointer;
    align-self: center;
}

.profile-pic-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--gradient-warm-start), var(--gradient-warm-mid), var(--gradient-warm-end), var(--gradient-warm-mid), var(--gradient-warm-start));
    padding: 4px;
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
    transition: opacity .12s cubic-bezier(0.4, 0, 0.2, 1);
}
.profile-pic-wrapper:hover .profile-pic-ring { opacity: 0.85; }

.profile-pic {
    width: 102px;
    height: 102px;
    border-radius: 50%;
    object-fit: cover;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(110deg, #d0d0d0 30%, #ffffff 50%, #d0d0d0 70%);
    background-size: 200% 100%;
    animation: shimmer 1.2s ease-in-out infinite;
    border: 4px solid var(--card-bg);
    opacity: 0;
    transition: opacity .2s ease-out;
}
[data-theme="dark"] .profile-pic {
    background: linear-gradient(110deg, #0f0f0f 30%, #4a4a4a 50%, #0f0f0f 70%);
    background-size: 200% 100%;
}
.profile-pic.loaded {
    animation: none;
    background: none;
    opacity: 1;
}

.profile-pic-overlay {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .12s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}
.profile-pic-wrapper:hover .profile-pic-overlay { opacity: 1; }
.profile-pic-overlay svg { width: 26px; height: 26px; stroke: var(--text-on-dark); stroke-width: 2; fill: none; }

.profile-info { flex: 1; min-width: 0; }
.profile-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 2px; }
.profile-info h2 { font-size: 20px; font-weight: 600; letter-spacing: -.3px; margin: 0; }
.profile-username { color: var(--text-secondary); font-size: 14px; margin-bottom: 6px; transition: color .1s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer; }
.profile-username:hover { color: var(--accent-color-soft); }
.profile-bio { font-size: 13px; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }

.profile-stats { display: flex; gap: 24px; }
.stat { 
    display: flex; 
    flex-direction: column;
    cursor: default;
}
.stat-value { font-size: 16px; font-weight: 600; letter-spacing: -.2px; }
.stat-label { font-size: 11px; color: var(--text-secondary); }

/* Private Badge */
.private-badge {
    display: inline-flex;
    align-items: center;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    transition: all .1s cubic-bezier(0.4, 0, 0.2, 1);
}
.private-badge:hover { transform: scale(1.05); background: #fde68a; }
[data-theme="dark"] .private-badge { background: rgba(254,243,199,.15); color: #fcd34d; }
[data-theme="dark"] .private-badge:hover { background: rgba(254,243,199,.25); }

/* Gender Stats */
.gender-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 10px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    transition: box-shadow .12s cubic-bezier(0.4, 0, 0.2, 1);
}
.gender-stat { 
    display: flex; 
    align-items: center; 
    gap: 4px; 
    font-size: 13px; 
    font-weight: 500;
    transition: transform .1s cubic-bezier(0.4, 0, 0.2, 1), opacity .1s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}
.gender-stat:hover { transform: scale(1.05); opacity: 0.9; }
.gender-icon { font-size: 14px; transition: transform .1s cubic-bezier(0.4, 0, 0.2, 1); }
.gender-stat:hover .gender-icon { transform: rotate(12deg); }
.gender-stat.male { color: #3b82f6; }
.gender-stat.female { color: #ec4899; }
.gender-stat.unknown { color: var(--text-secondary); }

/* Private Message */
.private-message {
    text-align: center;
    padding: 32px 24px;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

[data-theme="dark"] .private-message {
    border-color: transparent;
}

.private-message h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.private-message p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

/* Profile Card Actions (Cross-linking buttons - right side) */
.profile-card-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-left: auto;
    padding-left: 16px;
    align-self: center;
}

.profile-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 11px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-secondary);
    background: var(--item-bg);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    text-decoration: none;
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap;
}

.profile-action-btn:hover {
    color: var(--text-primary);
    background: var(--item-hover);
    border-color: var(--border);
}

.profile-action-btn svg {
    width: 13px;
    height: 13px;
    stroke-width: 2;
    flex-shrink: 0;
}

.profile-action-btn.primary {
    background: var(--accent-color);
    color: var(--text-on-accent);
    border-color: transparent;
}

.profile-action-btn.primary:hover {
    background: var(--accent-color-soft);
    color: var(--text-on-accent);
}

/* Mobile: absolute positioned action buttons in top-right */
.profile-card-actions-mobile {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    z-index: 5;
}

.profile-action-btn-mobile {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all .15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.profile-action-btn-mobile:hover {
    color: var(--text-primary);
    background: var(--item-hover);
}

.profile-action-btn-mobile svg {
    width: 12px;
    height: 12px;
    stroke-width: 2;
}

/* Switch to mobile action buttons when profile card goes vertical (768px) */
@media (max-width: 768px) {
    .profile-card-actions {
        display: none;
    }
    .profile-card-actions-mobile {
        display: flex;
    }
}

/* Tabs */
.connections-container { 
    background: var(--card-bg); 
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg); 
    box-shadow: var(--shadow);
    padding: 12px;
    margin-bottom: 40px;
    /* Performance: contain this component's layout calculations */
    contain: layout style;
}
[data-theme="dark"] .connections-container {
    border-color: transparent;
    box-shadow: var(--shadow);
}

.tabs { display: flex; gap: 2px; padding: 4px; background: var(--item-bg); border-radius: 8px; margin-bottom: 12px; }
.tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color .1s, background .1s;
}
.tab:hover { color: var(--text-primary); }
.tab.active { background: var(--card-bg); color: var(--text-primary); }
[data-theme="dark"] .tab.active { background: var(--card-bg); }

.tab-count {
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
    line-height: 1;
    color: var(--text-tertiary);
    background: transparent;
    padding: 3px 6px;
    border-radius: 10px;
    transition: background .1s, color .1s;
    min-width: 20px;
    text-align: center;
}
.tab.active .tab-count { background: linear-gradient(135deg, var(--gradient-warm-start) 0%, var(--gradient-warm-start) 70%, var(--gradient-warm-end) 100%); color: var(--text-on-dark); }

/* Panels */
.tab-panel { display: none; padding: 0 2px 2px; }
.tab-panel.active { display: block; }

.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.panel-subtitle { font-size: 13px; font-weight: 500; margin: 0; }
.panel-subtitle strong { font-weight: 700; }
.panel-loaded { font-size: 12px; color: var(--text-tertiary); font-weight: 500; }

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: var(--item-bg);
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all .1s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}
.filter-bar:focus-within { background: var(--item-hover); border-color: rgba(var(--accent-color-rgb),.2); box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb),.05); }
.filter-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: all .1s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1);
}
.filter-bar:focus-within .filter-icon { color: var(--text-secondary); transform: scale(1.1); }
.filter-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
}
.filter-input::placeholder { color: var(--text-tertiary); }
.filter-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    background: var(--border);
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .1s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1);
}
.filter-clear:hover { background: var(--text-tertiary); color: var(--text-primary); transform: scale(1.1) rotate(90deg); }
.filter-clear:active { transform: scale(0.9) rotate(90deg); }
.filter-clear.hidden { display: none; }

.panel-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 24px; color: var(--text-secondary); font-size: 14px; }
.mini-spinner { width: 18px; height: 18px; border: 2px solid var(--border-light); border-top-color: var(--text-secondary); border-radius: 50%; animation: spin .8s cubic-bezier(0.4, 0.0, 0.2, 1) infinite; }

.load-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    margin-top: 4px;
    background: var(--item-bg);
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .1s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    transform: scale(1);
    border: 1px solid transparent;
}
.load-more-btn:hover { background: var(--item-hover); color: var(--text-primary); transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.load-more-btn:active { transform: translateY(0) scale(.98); box-shadow: none; }
.load-more-btn:disabled { cursor: not-allowed; opacity: .7; transform: scale(1); }
.load-more-btn .btn-spinner { width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--text-primary); border-radius: 50%; animation: spin .8s cubic-bezier(0.4, 0.0, 0.2, 1) infinite; }

/* User List */
.user-list {
    display: flex;
    flex-direction: column;
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: var(--radius);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    /* Performance: contain paint to this element */
    contain: style;
}
.user-list::-webkit-scrollbar { width: 6px; }
.user-list::-webkit-scrollbar-track { background: transparent; }
.user-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    transition: background-color .08s ease-out;
    /* Performance: isolate each item's paint */
    contain: style;
}
.user-item:last-of-type { border-bottom: none; }
.user-item:hover { background: var(--item-hover); }

.user-item-index {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--border);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.user-item:hover .user-item-index { background: var(--item-hover); color: var(--text-primary); }

.avatar-wrapper {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--border-light);
}
/* Only animate shimmer when in viewport and not loaded - uses content-visibility */
.avatar-wrapper:not(.loaded) {
    background: linear-gradient(110deg, #d0d0d0 30%, #ffffff 50%, #d0d0d0 70%);
    background-size: 200% 100%;
    animation: shimmer 1.2s ease-in-out infinite;
}
[data-theme="dark"] .avatar-wrapper:not(.loaded) {
    background: linear-gradient(110deg, #0f0f0f 30%, #4a4a4a 50%, #0f0f0f 70%);
    background-size: 200% 100%;
}
.avatar-wrapper.loaded { animation: none; background: var(--border-light); }
.avatar-wrapper img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; opacity: 0; transition: opacity .15s ease-out; }
.avatar-wrapper.loaded img { opacity: 1; }

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

.user-item-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-item-link {
    display: inline-flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    max-width: 100%;
    overflow: hidden;
}
.user-item-link:hover .user-item-username { color: var(--accent-color-soft); }
.user-item-username { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .1s cubic-bezier(0.4, 0, 0.2, 1); }
.user-item-name { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 16px; }

/* Action buttons */
.user-item-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; opacity: 0; transition: opacity .1s ease-out; }
.user-item:hover .user-item-actions { opacity: 1; }

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--item-bg);
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background-color .08s ease-out, color .08s ease-out;
}
.action-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; }
.action-btn:hover { background: var(--border); color: var(--text-primary); }
.action-btn:active { opacity: 0.7; }

/* Copy button states */
.copy-btn svg:last-child { display: none; }
.copy-btn.copied svg:first-child { display: none; }
.copy-btn.copied svg:last-child { display: block; stroke: #22c55e; animation: checkPop .2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.copy-btn.copied { background: rgba(34,197,94,.15); color: #22c55e; }

@keyframes checkPop {
    0% { transform: scale(0.5) rotate(-5deg); opacity: 0; }
    50% { transform: scale(1.15) rotate(3deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* Private badge pill */
.private-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, var(--gradient-warm-start) 0%, var(--gradient-warm-start) 70%, var(--gradient-warm-end) 100%);
    color: var(--text-on-dark);
    font-size: 9px;
    font-weight: 600;
    padding: 3px 6px 3px 5px;
    border-radius: 5px;
    letter-spacing: .3px;
    text-transform: uppercase;
    line-height: 1;
    transition: opacity .1s cubic-bezier(0.4, 0, 0.2, 1);
}
.user-item:hover .private-badge-pill { opacity: 0.9; }
.private-badge-pill svg { width: 9px; height: 9px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* Top 3 styling */
.user-item.top1 { border-left: 4px solid var(--accent-color); }
.user-item.top2 { border-left: 3px solid rgba(var(--accent-color-rgb),.6); }
.user-item.top3 { border-left: 2px solid rgba(var(--accent-color-rgb),.35); }

/* Utilities */
.hidden:not(.results) { display: none !important; }
.results.hidden { max-height: 0 !important; opacity: 0 !important; transform: translateY(15px) scale(0.96) !important; }
.empty-list, .error-text { color: var(--text-tertiary); font-size: 14px; padding: 20px; text-align: center; }
.error-text { color: #b91c1c; }

/* Results unfold animation */
.results {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(15px) scale(0.96);
    transform-origin: top center;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s ease,
                transform 0.4s ease;
}
.results:not(.hidden) {
    max-height: 10000px; /* Large enough for any content */
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* New items animation - simplified for performance */
.user-item.new-item {
    animation: slideIn .2s ease-out backwards;
    will-change: opacity, transform;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .site-header { padding: 0 16px; }
    .header-content { height: 56px; }
    .header-notes { display: none; }
    .logo-text { font-size: 20px; }
    .logo-image { height: 48px; }
    
    .profile-card { flex-direction: column; align-items: center; text-align: center; gap: 20px; padding: 24px 20px; }
    .profile-pic-wrapper { width: 90px; height: 90px; }
    .profile-pic { width: 84px; height: 84px; }
    .profile-stats { justify-content: center; }
    
    .tab { padding: 14px 10px; }
    .tab-count { font-size: 12px; padding: 2px 7px; }
    
    .user-item { gap: 12px; padding: 12px 8px; margin: 0 -8px; }
    .avatar-wrapper { width: 44px; height: 44px; }
    .user-item-username { font-size: 14px; }
    .user-item-name { font-size: 12px; }
    
    /* Make action buttons visible on mobile by default */
    .user-item-actions {
        opacity: 1;
    }
    
    .action-btn {
        width: 32px;
        height: 32px;
        background: transparent;
        border: 1px solid var(--border);
        border-radius: 6px;
    }
    
    .action-btn svg {
        width: 16px;
        height: 16px;
        opacity: 0.6;
    }
    
    .action-btn:active {
        background: var(--item-bg);
    }
    
    .action-btn:active svg {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .container { padding: 12px 12px 40px; }
    .header-content { height: 52px; }
    .logo-text { font-size: 18px; }
    .logo-image { height: 42px; }
    .profile-card { scroll-margin-top: 60px; }
    .profile-pic-wrapper { width: 80px; height: 80px; }
    .profile-pic { width: 74px; height: 74px; }
}

/* ============== Footer ============== */
.site-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-light);
    padding: 32px 20px;
    margin-top: 80px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--accent-color);
}

.footer-separator {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.footer-copyright {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    font-weight: 400;
}

.footer-disclaimer {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 400;
    font-style: italic;
    opacity: 0.7;
}

@media (max-width: 600px) {
    .site-footer {
        padding: 24px 16px;
        margin-top: 40px;
    }
    
    .footer-content {
        gap: 10px;
    }
    
    .footer-links {
        font-size: 0.85rem;
    }
    
    .footer-copyright {
        font-size: 0.8rem;
    }
    
    .footer-disclaimer {
        font-size: 0.7rem;
    }
}
/* ============== MOBILE RESPONSIVE STYLES ============== */

/* Mobile Menu Button (Hamburger) */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 1001;
    transition: transform 0.2s ease;
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

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

/* Mobile Menu Drawer */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: var(--card-bg);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

[data-theme="dark"] .mobile-menu {
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
    border-left: 1px solid var(--border);
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.mobile-menu-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.mobile-menu-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--item-bg);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-menu-close:hover {
    background: var(--item-hover);
    transform: rotate(90deg);
}

.mobile-menu-close svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-primary);
}

.mobile-menu-content {
    padding: 12px;
    flex: 1;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.mobile-menu-item:hover {
    background: var(--item-bg);
}

.mobile-menu-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: var(--text-secondary);
    transition: stroke 0.2s ease;
}

.mobile-menu-item:hover svg {
    stroke: var(--accent-color);
}

.mobile-menu-divider {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 20px 16px 8px;
    margin-top: 12px;
}

/* Mobile Theme Toggle Visibility */
.mobile-theme-toggle {
    display: none;
}

.desktop-theme-toggle {
    display: flex;
}

/* Desktop Navigation Visibility */
.desktop-nav {
    display: flex;
}

/* Tablet and Mobile Responsive Breakpoints */
@media (max-width: 900px) {
    /* Show mobile hamburger button */
    .mobile-menu-btn {
        display: flex;
    }
    
    /* Hide desktop navigation */
    .desktop-nav {
        display: none !important;
    }
    
    /* Show mobile theme toggle, hide desktop one */
    .mobile-theme-toggle {
        display: flex;
    }
    
    .desktop-theme-toggle {
        display: none !important;
    }
    
    /* Adjust hero section */
    .hero-section {
        padding: 30px 16px 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    /* Features grid */
    .features {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 16px;
        margin-bottom: 50px;
    }
    
    .feature {
        padding: 18px 14px;
    }
    
    .feature-icon {
        width: 28px;
        height: 28px;
        margin-bottom: 10px;
    }
    
    .feature-title {
        font-size: 0.88rem;
    }
    
    .feature-text {
        font-size: 0.78rem;
    }
    
    /* Steps */
    .steps {
        padding: 0 16px;
        margin-bottom: 60px;
    }
    
    .steps-title {
        font-size: 1.6rem;
        margin-bottom: 32px;
    }
    
    .steps-grid {
        gap: 16px;
    }
    
    .step {
        padding: 24px 20px;
    }
    
    /* FAQ */
    .faq {
        margin: 60px auto;
        padding: 0 16px;
    }
    
    .faq-title {
        font-size: 1.6rem;
        margin-bottom: 32px;
    }
    
    .faq-list {
        gap: 20px;
    }
    
    .faq-item {
        padding-bottom: 20px;
    }
}

@media (max-width: 768px) {
    /* Header adjustments */
    .site-header {
        padding: 0 12px;
    }
    
    .header-content {
        height: 56px;
        padding: 0 8px;
    }
    
    .header-notes {
        display: none;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .logo-icon svg {
        width: 18px;
        height: 18px;
    }
    
    /* Make mobile theme toggle smaller */
    .mobile-theme-toggle .slider-track {
        width: 38px;
        height: 20px;
    }
    
    .mobile-theme-toggle .slider-thumb {
        width: 14px;
        height: 14px;
        left: 2px;
    }
    
    [data-theme="dark"] .mobile-theme-toggle .slider-thumb {
        left: calc(100% - 16px);
    }
    
    .mobile-theme-toggle .slider-icon {
        width: 10px;
        height: 10px;
    }
    
    .mobile-theme-toggle .slider-icon svg {
        width: 8px;
        height: 8px;
    }
    
    /* Container padding */
    .container {
        padding: 0 16px 50px;
    }
    
    /* Hero section */
    .hero-section {
        padding: 25px 16px 0;
    }
    
    .badge {
        font-size: 0.7rem;
        margin-bottom: 16px;
    }
    
    .hero-title {
        font-size: 1.75rem;
        margin-bottom: 16px;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 24px;
    }
    
    /* Search box */
    .search-container {
        max-width: 100%;
        margin-bottom: 20px;
    }
    
    .search-box {
        padding: 5px 5px 5px 16px;
    }
    
    .at-symbol {
        font-size: 15px;
    }
    
    .search-box input {
        font-size: 15px;
        padding: 12px 8px;
    }
    
    .search-btn {
        padding: 12px 14px;
    }
    
    .search-btn svg {
        width: 18px;
        height: 18px;
    }
    
    /* Stats */
    .stats {
        gap: 24px;
        margin-bottom: 28px;
        flex-wrap: wrap;
    }
    
    .stat {
        font-size: 0.85rem;
    }
    
    .stat-icon {
        width: 16px;
        height: 16px;
    }
    
    /* Profile card */
    .profile-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
        padding: 20px 16px;
    }
    
    .profile-pic-wrapper {
        width: 90px;
        height: 90px;
    }
    
    .profile-pic {
        width: 82px;
        height: 82px;
    }
    
    .profile-info h2 {
        font-size: 18px;
    }
    
    .profile-name-row {
        justify-content: center;
    }
    
    .profile-username {
        font-size: 13px;
    }
    
    .profile-bio {
        font-size: 12px;
    }
    
    .profile-stats {
        justify-content: center;
        gap: 20px;
    }
    
    .stat-value {
        font-size: 15px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    /* Gender stats */
    .gender-stats {
        gap: 12px;
        padding: 8px 12px;
    }
    
    .gender-stat {
        font-size: 12px;
    }
    
    /* Tabs */
    .tab {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .tab-count {
        font-size: 10px;
        padding: 2px 5px;
    }
    
    /* User items */
    .user-item {
        gap: 12px;
        padding: 12px 8px;
        margin: 0 -8px;
    }
    
    .avatar-wrapper {
        width: 44px;
        height: 44px;
    }
    
    .user-item-username {
        font-size: 14px;
    }
    
    .user-item-name {
        font-size: 12px;
    }
    
    .action-btn {
        width: 34px;
        height: 34px;
    }
    
    .action-btn svg {
        width: 16px;
        height: 16px;
    }
    
    /* Filter bar */
    .filter-bar {
        padding: 8px 12px;
    }
    
    .filter-input {
        font-size: 14px;
    }
    
    /* Features - stack to single column on smaller tablets */
    .features {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    /* Even smaller adjustments for phones */
    .container {
        padding: 0 12px 40px;
    }
    
    .header-content {
        height: 52px;
        padding: 0 4px;
    }
    
    .logo-text {
        font-size: 16px;
    }
    
    .logo-icon {
        width: 20px;
        height: 20px;
    }
    
    .logo-icon svg {
        width: 16px;
        height: 16px;
    }
    
    /* Mobile theme toggle even smaller */
    .mobile-theme-toggle .slider-track {
        width: 36px;
        height: 18px;
    }
    
    .mobile-theme-toggle .slider-thumb {
        width: 12px;
        height: 12px;
        left: 2px;
    }
    
    [data-theme="dark"] .mobile-theme-toggle .slider-thumb {
        left: calc(100% - 14px);
    }
    
    .mobile-theme-toggle .slider-icon {
        width: 9px;
        height: 9px;
    }
    
    .mobile-theme-toggle .slider-icon svg {
        width: 7px;
        height: 7px;
    }
    
    .mobile-menu-btn {
        width: 28px;
        height: 28px;
        padding: 5px;
    }
    
    /* Hero section */
    .hero-section {
        padding: 20px 12px 0;
    }
    
    .badge {
        font-size: 0.65rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    /* Search */
    .search-box {
        padding: 4px 4px 4px 12px;
    }
    
    .search-box input {
        font-size: 14px;
        padding: 10px 6px;
    }
    
    .search-btn {
        padding: 10px 12px;
    }
    
    /* Stats */
    .stats {
        gap: 16px;
        margin-bottom: 24px;
    }
    
    .stat {
        font-size: 0.8rem;
    }
    
    /* Profile card */
    .profile-card {
        padding: 16px 12px;
        gap: 14px;
        scroll-margin-top: 60px;
    }
    
    .profile-pic-wrapper {
        width: 80px;
        height: 80px;
    }
    
    .profile-pic {
        width: 72px;
        height: 72px;
    }
    
    .profile-info h2 {
        font-size: 16px;
    }
    
    .profile-username {
        font-size: 12px;
    }
    
    .profile-bio {
        font-size: 11px;
    }
    
    .profile-stats {
        gap: 16px;
    }
    
    .stat-value {
        font-size: 14px;
    }
    
    /* Gender stats */
    .gender-stats {
        gap: 10px;
        padding: 6px 10px;
    }
    
    .gender-stat {
        font-size: 11px;
    }
    
    /* Connections container */
    .connections-container {
        padding: 8px;
    }
    
    /* Tabs */
    .tabs {
        padding: 3px;
        gap: 1px;
    }
    
    .tab {
        padding: 8px 6px;
        font-size: 11px;
    }
    
    .tab-count {
        font-size: 9px;
        padding: 2px 4px;
        min-width: 18px;
    }
    
    /* Panel */
    .panel-subtitle {
        font-size: 12px;
    }
    
    .panel-loaded {
        font-size: 11px;
    }
    
    /* Filter bar */
    .filter-bar {
        padding: 6px 10px;
    }
    
    .filter-icon {
        width: 13px;
        height: 13px;
    }
    
    .filter-input {
        font-size: 13px;
    }
    
    /* User items */
    .user-item {
        gap: 10px;
        padding: 10px 6px;
        margin: 0 -6px;
    }
    
    .avatar-wrapper {
        width: 42px;
        height: 42px;
    }
    
    .user-item-username {
        font-size: 13px;
    }
    
    .user-item-name {
        font-size: 11px;
    }
    
    .action-btn {
        width: 32px;
        height: 32px;
    }
    
    .action-btn svg {
        width: 15px;
        height: 15px;
    }
    
    .private-badge-pill {
        font-size: 8px;
        padding: 2px 5px 2px 4px;
    }
    
    .private-badge-pill svg {
        width: 8px;
        height: 8px;
    }
    
    /* Load more button */
    .load-more-btn {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    /* Features */
    .features {
        margin-bottom: 40px;
    }
    
    .feature {
        padding: 16px 12px;
    }
    
    .feature-icon {
        width: 24px;
        height: 24px;
        margin-bottom: 8px;
    }
    
    .feature-title {
        font-size: 0.82rem;
        margin-bottom: 4px;
    }
    
    .feature-text {
        font-size: 0.75rem;
    }
    
    /* Steps */
    .steps {
        margin-bottom: 50px;
    }
    
    .steps-title {
        font-size: 1.4rem;
        margin-bottom: 28px;
    }
    
    .steps-grid {
        gap: 12px;
    }
    
    .step {
        padding: 20px 16px;
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
        margin-bottom: 12px;
    }
    
    .step-title {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .step-text {
        font-size: 0.85rem;
    }
    
    /* FAQ */
    .faq {
        margin: 50px auto;
    }
    
    .faq-title {
        font-size: 1.4rem;
        margin-bottom: 28px;
    }
    
    .faq-list {
        gap: 16px;
    }
    
    .faq-item {
        padding-bottom: 16px;
    }
    
    .faq-q {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }
    
    .faq-a {
        font-size: 0.85rem;
    }
    
    /* Private message */
    .private-message {
        padding: 24px 16px;
    }
    
    .private-message h3 {
        font-size: 15px;
    }
    
    .private-message p {
        font-size: 13px;
    }
    
    /* Loading */
    .loader-avatar {
        width: 70px;
        height: 70px;
        margin-bottom: 14px;
    }
    
    .loader-username {
        font-size: 16px;
    }
    
    .loader-status {
        font-size: 13px;
    }
    
    /* Error */
    .error-card {
        padding: 14px 20px;
    }
    
    .error-message {
        font-size: 14px;
    }
    
    .error-retry {
        font-size: 13px;
    }
}

/* Landscape phone optimization */
@media (max-width: 900px) and (max-height: 500px) {
    .hero-section {
        padding: 20px 16px 0;
    }
    
    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }
    
    .hero-subtitle {
        font-size: 0.85rem;
        margin-bottom: 16px;
    }
    
    .stats {
        margin-bottom: 20px;
    }
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
}