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

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0a0a0a;
    min-height: 100vh;
    color: #ffffff;
    width: 100vw;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    line-height: 1.4;
    padding-bottom: 80px; /* Space for bottom nav */
}

/* Icon definitions */
.icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    position: relative;
}

.icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: currentColor;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    filter: contrast(100%) invert(0);
}

@media (prefers-color-scheme: dark) {
    .icon::before {
        filter: contrast(100%) invert(1);
    }
}

.icon-add::before { 
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 4v16m8-8H4'%2F%3E%3C/svg%3E"); 
}
.icon-back::before { 
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 19l-7-7 7-7'%2F%3E%3C/svg%3E"); 
}
.icon-recent::before { 
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z'%2F%3E%3C/svg%3E"); 
}
.icon-home::before { 
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6'%2F%3E%3C/svg%3E"); 
}
.icon-settings::before { 
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37-.996.608-2.296.07-2.572-1.065z'%2F%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'%2F%3E%3C/svg%3E"); 
}
.icon-logout::before { 
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M17 16l-4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1'%2F%3E%3C/svg%3E"); 
}
.icon-send::before { 
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 19l9 2-9-18-9 18 9-2zm0 0v-8'%2F%3E%3C/svg%3E"); 
}
.icon-chat::before { 
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z'%2F%3E%3C/svg%3E"); 
}
.icon-slots::before { 
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v2'%2F%3E%3C/svg%3E"); 
}
.icon-search::before { 
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%2F%3E%3C/svg%3E"); 
}
.icon-comment::before { 
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 012-2v2'%2F%3E%3C/svg%3E"); 
}
.icon-user::before { 
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M16 14a4 4 0 10-8 0m8 0a4 4 0 01-8 0m8 0v1a4 4 0 004 4H4a4 4 0 004-4v-1m4-9a4 4 0 110 8 4 4 0 010-8z'%2F%3E%3C/svg%3E");
}
.icon-me::before {
    mask-image: none;
    background: none;
    content: 'ME';
    font-weight: 900;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
    mix-blend-mode: difference;
}

.navbar {
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Hide navbar on chat page */
.page.active#chatPage ~ .navbar,
body:has(.page.active#chatPage) .navbar {
    display: none;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-btn {
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    position: relative;
    gap: 4px;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.nav-btn.active {
    background: rgba(0, 123, 255, 0.2);
    color: white;
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.3);
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border-top: 1px solid #333;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Hide bottom nav on chat page */
.page.active#chatPage ~ .bottom-nav,
body:has(.page.active#chatPage) .bottom-nav {
    display: none;
}

.bottom-nav .nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 60px;
    height: 60px;
    border-radius: 8px;
}

.bottom-nav .nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.bottom-nav .nav-btn.active {
    background: rgba(0, 123, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.3);
}

.main-content {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 60px);
    background: #0a0a0a;
    padding-bottom: 80px; /* Space for bottom nav */
}

/* Chat page adjustments */
#chatPage.active {
    padding-bottom: 0;
}

#chatPage.active .main-content {
    padding-bottom: 0;
}

.page {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
    padding: 20px;
    padding-bottom: 100px; /* Space for bottom nav */
    opacity: 0;
    transform: none;
    transition: opacity 0.3s ease;
    pointer-events: none;
    visibility: hidden;
    display: none;
}

.page.active {
    opacity: 1;
    transform: none;
    pointer-events: all;
    visibility: visible;
    display: block;
    position: relative;
}

.character-gallery {
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.character-gallery h2 {
    font-size: 1.8rem;
    color: #ffffff;
    margin-bottom: 0;
    font-weight: 600;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    padding: 12px 16px 12px 45px;
    border: 1px solid #333;
    border-radius: 12px;
    background: #1a1a1a;
    color: #ffffff;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 400px;
    min-width: 250px;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
    background: #222;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: #666;
    pointer-events: none;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.character-card {
    background: linear-gradient(145deg, #1a1a1a, #222);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #333;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #0056b3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.character-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 123, 255, 0.2);
    border-color: #007bff;
}

.character-card:hover::before {
    opacity: 1;
}

.character-card .thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid #2a2a2a;
}

.character-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.character-description {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.character-author {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}

.removed-badge, .timeline-badge {
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.removed-badge {
    background: rgba(0, 123, 255, 0.2);
    color: #007bff;
}

.timeline-badge {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.create-container, .recents-container, .comments-container {
    max-width: 600px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.page-header h2 {
    font-size: 1.8rem;
    color: #ffffff;
    font-weight: 600;
}

.back-btn {
    padding: 8px;
    border: 1px solid #333;
    border-radius: 8px;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.back-btn:hover {
    background: #333;
    border-color: #555;
    transform: translateY(-1px);
}

.character-form {
    background: linear-gradient(145deg, #1a1a1a, #222);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.9rem;
}

.form-group input, .form-group textarea {
    padding: 16px;
    border: 1px solid #333;
    border-radius: 12px;
    background: #0a0a0a;
    color: #ffffff;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
    background: #111;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.submit-btn {
    padding: 16px 24px;
    background: linear-gradient(145deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.submit-btn:hover {
    background: linear-gradient(145deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.submit-btn:disabled {
    background: #333;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.chat-container {
    max-width: none;
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #0a0a0a;
    border-radius: 0;
    border: none;
    overflow: hidden;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
}

.chat-header {
    background: linear-gradient(145deg, #1a1a1a, #222);
    padding: 20px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-height: 80px;
}

.chat-info h3 {
    font-size: 1.3rem;
    margin-bottom: 4px;
    color: #ffffff;
    font-weight: 600;
}

.chat-info p {
    font-size: 0.9rem;
    color: #ccc;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #0a0a0a;
    padding-bottom: 100px;
    padding-top: 100px;
}

.message {
    margin-bottom: 16px;
    padding: 16px 20px;
    border-radius: 20px;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
}

.message.user {
    background: linear-gradient(145deg, #007bff, #0056b3);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.message.assistant {
    background: linear-gradient(145deg, #1a1a1a, #222);
    color: #ffffff;
    border: 1px solid #333;
    border-bottom-left-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Top Navigation Tabs (for non-chat pages) */
.top-nav {
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    display: flex;
    padding: 0 20px;
    height: 60px;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    gap: 8px;
}

/* Hide top nav on chat page */
.page.active#chatPage ~ .top-nav,
body:has(.page.active#chatPage) .top-nav {
    display: none;
}

.top-nav .nav-btn {
    background: transparent;
    border-radius: 0;
    padding: 10px 14px;
    position: relative;
}

.top-nav .nav-btn::after {
    content: '';
    position: absolute;
    left: 12px; 
    right: 12px; 
    bottom: -1px;
    height: 2px; 
    background: #007bff;
    transform: scaleX(0); 
    transition: transform .25s ease;
}

.top-nav .nav-btn.active::after { 
    transform: scaleX(1); 
}

.chat-input {
    display: flex;
    padding: 20px;
    background: linear-gradient(145deg, #1a1a1a, #222);
    border-top: 1px solid #333;
    gap: 12px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 10;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.chat-input input {
    flex: 1;
    padding: 16px 20px;
    border: 1px solid #333;
    border-radius: 25px;
    background: #0a0a0a;
    color: #ffffff;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.chat-input input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
    background: #111;
}

.chat-input button {
    padding: 16px;
    background: linear-gradient(145deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 50px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.chat-input button:hover {
    background: linear-gradient(145deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.success-message {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(145deg, #28a745, #1e7e34);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: slideIn 0.4s ease;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 300px;
}

.progress-bar {
    width: 100%;
    max-width: 400px;
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 30px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    animation: loading 2s ease-in-out infinite;
    width: 30%;
    border-radius: 3px;
}

@keyframes loading {
    0% { 
        transform: translateX(-100%); 
    }
    100% { 
        transform: translateX(400%); 
    }
}

.loading-message {
    font-size: 1rem;
    color: #ccc;
    text-align: center;
    margin-top: 20px;
    font-weight: 500;
}

/* Status bar for cached/online sync */
.character-status {
    position: sticky;
    top: 60px;
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px dashed #444;
    background: linear-gradient(145deg, rgba(0, 123, 255, 0.08), rgba(0, 123, 255, 0.04));
    color: #9ecbff;
    font-size: 0.9rem;
    z-index: 5;
}

/* Improve contrast of status bar in light mode */
@media (prefers-color-scheme: light) {
    .character-status {
        background: rgba(0, 0, 0, 0.05);
        color: #0b3b74;
        border-color: rgba(0, 0, 0, 0.15);
    }
}

.context-menu {
    position: fixed;
    background: linear-gradient(145deg, #1a1a1a, #222);
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    min-width: 220px;
    padding: 8px 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.context-menu-item {
    display: block;
    width: 100%;
    padding: 16px 20px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ffffff;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.context-menu-item:hover,
.context-menu-item:focus {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
    outline: none;
}

.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.recent-card {
    background: linear-gradient(145deg, #1a1a1a, #222);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.recent-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 123, 255, 0.2);
    border-color: #007bff;
}

.recent-card .character-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

.recent-card .slots-info, .recent-card .last-interaction {
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 8px;
}

.create-container, .recents-container, .comments-container {
    max-width: 600px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.page-header h2 {
    font-size: 1.8rem;
    color: #ffffff;
    font-weight: 600;
}

.back-btn {
    padding: 8px;
    border: 1px solid #333;
    border-radius: 8px;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.back-btn:hover {
    background: #333;
    border-color: #555;
    transform: translateY(-1px);
}

.character-form {
    background: linear-gradient(145deg, #1a1a1a, #222);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.9rem;
}

.form-group input, .form-group textarea {
    padding: 16px;
    border: 1px solid #333;
    border-radius: 12px;
    background: #0a0a0a;
    color: #ffffff;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
    background: #111;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.submit-btn {
    padding: 16px 24px;
    background: linear-gradient(145deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.submit-btn:hover {
    background: linear-gradient(145deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.submit-btn:disabled {
    background: #333;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.chat-container {
    max-width: none;
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #0a0a0a;
    border-radius: 0;
    border: none;
    overflow: hidden;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
}

.chat-header {
    background: linear-gradient(145deg, #1a1a1a, #222);
    padding: 20px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-height: 80px;
}

.chat-info h3 {
    font-size: 1.3rem;
    margin-bottom: 4px;
    color: #ffffff;
    font-weight: 600;
}

.chat-info p {
    font-size: 0.9rem;
    color: #ccc;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #0a0a0a;
    padding-bottom: 100px;
    padding-top: 100px;
}

.message {
    margin-bottom: 16px;
    padding: 16px 20px;
    border-radius: 20px;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
}

.message.user {
    background: linear-gradient(145deg, #007bff, #0056b3);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.message.assistant {
    background: linear-gradient(145deg, #1a1a1a, #222);
    color: #ffffff;
    border: 1px solid #333;
    border-bottom-left-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Variables (character placeholders) section */
.variables-section {
    background: linear-gradient(145deg, #1a1a1a, #222);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #333;
    margin-top: -8px;
}
.variables-header h3 {
    font-size: 1.1rem;
    color: #ffffff;
    margin-bottom: 6px;
}
.variables-subtext {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 12px;
}
.variables-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Updated layout: key on top, hint below, then remove button */
.variable-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    background: rgba(255,255,255,0.02);
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 12px;
}

.variable-row input {
    padding: 12px;
    border: 1px solid #333;
    border-radius: 10px;
    background: #0a0a0a;
    color: #fff;
    width: 100%;
}

/* Place the remove button after the inputs, aligned to the right */
.variable-row .remove-var-btn {
    background: linear-gradient(145deg, #dc3545, #c82333);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    align-self: flex-end;
}

.variables-actions {
    margin-top: 10px;
}
.secondary-btn {
    background: linear-gradient(145deg, #6c757d, #545b62) !important;
}

/* Variable prompt overlay */
.variable-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.variable-card {
    width: 100%;
    max-width: 520px;
    background: linear-gradient(145deg, #1a1a1a, #222);
    border: 1px solid #333;
    border-radius: 16px;
    padding: 24px;
    color: #fff;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.variable-card h2 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}
.variable-desc {
    color: #bbb;
    margin-bottom: 16px;
}
.variable-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}
.variable-form .var-field {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}
.variable-form label {
    font-size: 0.9rem;
    color: #ddd;
}
.variable-form input {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #333;
    background: #0a0a0a;
    color: #fff;
}
.variable-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.variable-actions .secondary-btn {
    background: #333;
}

/* Character detail page styling */
.character-detail-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0;
}

.character-detail-header {
    background: linear-gradient(145deg, #1a1a1a, #222);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid #333;
    text-align: center;
}

.character-detail-header .detail-thumb {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #333;
    margin-bottom: 16px;
}

.character-detail-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.character-detail-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #ccc;
    margin-bottom: 16px;
    text-align: left;
    background: #0a0a0a;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #333;
}

.character-detail-author {
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
}

.character-detail-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.character-detail-action {
    padding: 16px;
    background: linear-gradient(145deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.character-detail-action:hover {
    background: linear-gradient(145deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.character-detail-action.secondary {
    background: linear-gradient(145deg, #6c757d, #545b62);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.character-detail-action.secondary:hover {
    background: linear-gradient(145deg, #545b62, #495057);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.character-detail-action.danger {
    background: linear-gradient(145deg, #dc3545, #c82333);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.character-detail-action.danger:hover {
    background: linear-gradient(145deg, #c82333, #a71e2a);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.character-detail-action:disabled {
    background: #333;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

@media (max-width: 768px) {
    .character-detail-action {
        padding: 14px;
        font-size: 0.9rem;
    }
    
    .search-input {
        width: 100%;
        max-width: none;
    }
}

/* Additional mobile-first enhancements */
@media (hover: none) and (pointer: coarse) {
    .character-card:hover,
    .recent-card:hover {
        transform: none;
    }
    
    .character-card:active,
    .recent-card:active {
        transform: scale(0.98);
    }
    
    .nav-btn:hover,
    .back-btn:hover,
    .submit-btn:hover {
        transform: none;
    }
    
    .nav-btn:active,
    .back-btn:active,
    .submit-btn:active {
        transform: scale(0.95);
    }
}

/* Dark scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Selection color */
::selection {
    background: rgba(0, 123, 255, 0.3);
    color: #ffffff;
}

::-moz-selection {
    background: rgba(0, 123, 255, 0.3);
    color: #ffffff;
}

/* Focus indicators for accessibility */
.nav-btn:focus,
.back-btn:focus,
.submit-btn:focus,
.character-card:focus,
.recent-card:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Ensure good contrast for form elements */
.form-group input::placeholder,
.form-group textarea::placeholder,
.chat-input input::placeholder {
    color: #666;
}

/* Language warnings */
.language-warning {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #ff6b7a;
    padding: 12px;
    border-radius: 8px;
    margin-top: 8px;
    font-size: 0.85rem;
}

/* Toggle switches */
.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-weight: 400 !important;
    gap: 12px;
    color: #ccc;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background: #333;
    border-radius: 12px;
    transition: background 0.3s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background: #007bff;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::after {
    transform: translateX(26px);
}

/* Model selection buttons */
.pollinations-models {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.model-option {
    padding: 20px;
    border: 2px solid #333;
    border-radius: 12px;
    background: linear-gradient(145deg, #1a1a1a, #222);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
}

.model-option:hover {
    border-color: #007bff;
    transform: translateY(-2px);
}

.model-option.active {
    border-color: #007bff;
    background: linear-gradient(145deg, #1a1a2a, #252535);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.2);
}

.model-option small {
    font-size: 0.8rem;
    color: #ccc;
    line-height: 1.3;
    display: block;
    margin-top: 4px;
}

/* Placeholders section styling */
.placeholders-section {
    margin-top: 20px;
}

.placeholders-list {
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.placeholder-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #333;
    font-size: 0.9rem;
}

.placeholder-item:last-child {
    border-bottom: none;
}

.placeholder-item code {
    background: #333;
    color: #007bff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.add-placeholder-form {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.add-placeholder-form input {
    flex: 1;
    min-width: 150px;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #0a0a0a;
    color: #ffffff;
    font-size: 0.9rem;
}

.add-placeholder-form input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.add-placeholder-form button {
    padding: 12px 20px;
    background: linear-gradient(145deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.add-placeholder-form button:hover {
    background: linear-gradient(145deg, #0056b3, #004085);
    transform: translateY(-1px);
}

.reset-placeholders-btn {
    background: linear-gradient(145deg, #dc3545, #c82333);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.reset-placeholders-btn:hover {
    background: linear-gradient(145deg, #c82333, #a71e2a);
    transform: translateY(-1px);
}

.model-name {
    font-size: 0.8rem;
    color: #007bff;
    margin-top: 8px;
    font-weight: 500;
}

/* Comment system styling */
.comments-list {
    margin: 30px 0;
    min-height: 200px;
}

.comment-item {
    background: linear-gradient(145deg, #1a1a1a, #222);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.comment-item:hover {
    border-color: #007bff;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.1);
}

.comment-item.reply {
    margin-left: 30px;
    border-left: 3px solid #007bff;
    background: linear-gradient(145deg, #1a1a2a, #252535);
}

.reply-to {
    font-size: 0.8rem;
    color: #007bff;
    margin-bottom: 8px;
    font-weight: 600;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.comment-author {
    font-weight: 600;
    color: #ffffff;
}

.comment-date {
    font-size: 0.8rem;
    color: #888;
}

.comment-content {
    margin-bottom: 16px;
    line-height: 1.5;
    word-wrap: break-word;
    color: #ccc;
}

.reply-btn {
    background: linear-gradient(145deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.reply-btn:hover {
    background: linear-gradient(145deg, #0056b3, #004085);
    transform: translateY(-1px);
}

.comment-form-container {
    position: sticky;
    bottom: 0;
    background: linear-gradient(145deg, #1a1a1a, #222);
    padding: 25px;
    border-top: 1px solid #333;
    border-radius: 12px 12px 0 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-form textarea {
    min-height: 100px;
    padding: 16px;
    border: 1px solid #333;
    border-radius: 12px;
    background: #0a0a0a;
    color: #ffffff;
    font-size: 0.9rem;
    resize: vertical;
    transition: all 0.2s ease;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
    background: #111;
}

.no-comments {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 60px 20px;
    font-size: 1rem;
}

/* Timeline styling */
.timeline-container {
    max-width: 800px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #0a0a0a;
    border-radius: 0;
    border: none;
    overflow: hidden;
    width: 100%;
}

.timeline-header {
    background: linear-gradient(145deg, #1a1a1a, #222);
    padding: 20px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.timeline-info h3 {
    font-size: 1.3rem;
    margin-bottom: 4px;
    color: #ffffff;
    font-weight: 600;
}

.timeline-info p {
    font-size: 0.9rem;
    color: #ccc;
}

.timeline-content {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    background: #0a0a0a;
}

.scenario-text {
    background: linear-gradient(145deg, #1a1a1a, #222);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    line-height: 1.7;
    font-size: 1rem;
    border: 1px solid #333;
    color: #ffffff;
}

.action-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.action-option-btn {
    padding: 20px;
    background: linear-gradient(145deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    line-height: 1.5;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.action-option-btn:hover {
    background: linear-gradient(145deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.action-option-btn:disabled {
    background: #333;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.action-result {
    background: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.3);
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-style: italic;
    border-left: 4px solid #2196f3;
    color: #ffffff;
}

.current-scenario {
    line-height: 1.7;
    color: #ffffff;
}

/* Slots styling */
.slots-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 25px;
}

.slot-item {
    background: linear-gradient(145deg, #1a1a1a, #222);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slot-item:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.2);
}

.slot-item.active {
    border-color: #007bff;
    background: linear-gradient(145deg, #1a1a2a, #252535);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.slot-info {
    font-size: 0.85rem;
    color: #888;
}

.create-slot-btn {
    background: linear-gradient(145deg, #28a745, #1e7e34);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.create-slot-btn:hover {
    background: linear-gradient(145deg, #1e7e34, #155724);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* Character count styling */
.char-counter {
    font-size: 0.8rem;
    color: #666;
    text-align: right;
    margin-top: 6px;
}

/* Migration overlay */
.migration-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.migration-card {
    width: 100%;
    max-width: 540px;
    background: linear-gradient(145deg, #1a1a1a, #222);
    border: 1px solid #333;
    border-radius: 16px;
    padding: 28px;
    color: #fff;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.migration-card h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    font-weight: 700;
}

.migration-card p {
    color: #ccc;
    margin-bottom: 16px;
}

.migration-list {
    list-style: none;
    margin: 0 0 18px 0;
    padding: 0;
}

.migration-list li {
    color: #bbb;
    padding: 6px 0;
    border-bottom: 1px dashed #333;
}

.migration-list li:last-child {
    border-bottom: none;
}

.migration-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.migration-note {
    margin-top: 12px;
    color: #888;
    font-size: 0.85rem;
}

/* Settings: Provider selection area (restored styling) */
.provider-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.provider-option-btn {
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    cursor: pointer;
    border-radius: 12px; /* for focus outline shape */
}

.provider-option-btn:focus {
    outline: none;
}

.provider-option-btn:focus .provider-card {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.provider-card {
    padding: 20px;
    border: 2px solid #333;
    border-radius: 12px;
    background: linear-gradient(145deg, #1a1a1a, #222);
    color: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 rgba(0,0,0,0);
}

.provider-card h4 {
    margin: 0 0 6px 0;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.provider-card p {
    margin: 0;
    color: #bbb;
    font-size: 0.9rem;
}

.provider-option-btn .provider-card:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 123, 255, 0.2);
}

.provider-option-btn.active .provider-card {
    border-color: #007bff;
    background: linear-gradient(145deg, #1a1a2a, #252535);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.2);
}

/* Keep hover-less behavior on touch devices */
@media (hover: none) and (pointer: coarse) {
    .provider-option-btn .provider-card:hover {
        transform: none;
        box-shadow: none;
    }
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.user-card {
    background: linear-gradient(145deg, #1a1a1a, #222);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 16px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}
.user-card:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 123, 255, 0.2);
}
.user-card .user-name {
    font-weight: 700;
    margin-bottom: 6px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.user-card .user-meta {
    color: #bbb;
    font-size: 0.9rem;
}

.badge { 
    display:inline-block; 
    font-size:0.7rem; 
    padding:2px 6px; 
    border:1px solid #444; 
    border-radius:999px; 
    margin-left:6px; 
}
.badge-dev { 
    border-color:#ffb703; 
    color:#ffb703; 
}
/* Utility for screen readers */
.sr-only { 
    position:absolute !important; 
    width:1px; 
    height:1px; 
    padding:0; 
    margin:-1px; 
    overflow:hidden; 
    clip:rect(0 0 0 0); 
    white-space:nowrap; 
    border:0; 
}
.age-badge {
    font-size: 0.7em;
    padding: 3px 6px;
    border-radius: 6px;
    font-weight: 700;
    margin-left: 8px;
    background: rgba(220,53,69,0.12);
    color: #ff6b7a;
    border: 1px solid rgba(220,53,69,0.22);
}