:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-card: #111111;
    --bg-hover: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --border-color: #222222;
    --accent-color: #8b5cf6;
    --accent-hover: #7c3aed;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --zap-color: #f7931a;
    --sidebar-width: 260px;
    --right-sidebar-width: 320px;
    --transition: 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Three Column Layout */
.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr var(--right-sidebar-width);
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

/* Left Sidebar */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--border-color);
    padding: 20px;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 12px;
    margin-bottom: 24px;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 50px;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    color: var(--text-primary);
    font-weight: 600;
}

.nav-item svg {
    flex-shrink: 0;
}

.post-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    background: var(--accent-color);
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: var(--transition);
}

.post-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-top: 16px;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-user:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-npub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

.login-btn {
    width: 100%;
    padding: 14px 24px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: auto;
    transition: var(--transition);
}

.login-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-color);
}

/* Main Feed */
.main-feed {
    border-right: 1px solid var(--border-color);
    max-width: 100%;
    overflow: hidden;
}

.feed-header {
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.feed-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.feed-tabs {
    display: flex;
    gap: 8px;
}

.tab-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 50px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-color);
    color: white;
}

.new-notes-btn {
    position: sticky;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    padding: 10px 20px;
    background: var(--accent-color);
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.notes-feed {
    padding: 0;
}

/* Note Card */
.note-card {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.note-card:hover {
    background: var(--bg-hover);
}

.note-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.note-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.note-content {
    flex: 1;
    min-width: 0;
}

.note-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.note-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.note-handle {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.note-time {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.note-separator {
    color: var(--text-muted);
}

.note-text {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 12px;
    word-wrap: break-word;
}

.note-media {
    margin-bottom: 12px;
    border-radius: 16px;
    overflow: hidden;
}

.note-media img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

.note-actions {
    display: flex;
    gap: 4px;
    margin-left: -8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 50px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background: rgba(139, 92, 246, 0.1);
}

.action-btn.reply:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
}

.action-btn.repost:hover {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.action-btn.like:hover {
    color: #f43f5e;
    background: rgba(244, 63, 94, 0.1);
}

.action-btn.like.active {
    color: #f43f5e;
}

.action-btn.zap:hover {
    color: var(--zap-color);
    background: rgba(247, 147, 26, 0.1);
}

.action-btn.zap.active {
    color: var(--zap-color);
}

.action-btn svg {
    width: 18px;
    height: 18px;
}

/* Loading */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 60px 20px;
    color: var(--text-muted);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Right Sidebar */
.right-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 16px 20px;
    overflow-y: auto;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.trend-item {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.trend-item:last-child {
    border-bottom: none;
}

.trend-item:hover .trend-tag {
    color: var(--accent-color);
}

.trend-tag {
    font-weight: 600;
    font-size: 0.95rem;
}

.trend-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.follow-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.follow-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.follow-info {
    flex: 1;
}

.follow-name {
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
}

.follow-handle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.follow-btn {
    padding: 6px 16px;
    background: var(--text-primary);
    border: none;
    border-radius: 50px;
    color: var(--bg-primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.follow-btn:hover {
    opacity: 0.9;
}

.sidebar-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-footer a:hover {
    color: var(--text-primary);
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 80px 20px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.compose-modal,
.login-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 560px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.1rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.compose-body {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
}

.compose-body textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: inherit;
    resize: none;
    min-height: 120px;
    outline: none;
}

.compose-body textarea::placeholder {
    color: var(--text-muted);
}

.compose-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
}

.char-counter {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Login Modal Specific */
.login-modal {
    max-width: 420px;
}

.modal-content {
    padding: 32px 24px;
    text-align: center;
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.modal-content h2 {
    margin-bottom: 8px;
}

.modal-desc {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.login-option {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    color: var(--text-primary);
}

.login-option:hover {
    background: var(--bg-hover);
    border-color: var(--accent-color);
}

.option-icon {
    font-size: 1.5rem;
}

.option-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.option-title {
    font-weight: 600;
}

.option-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.login-divider span {
    padding: 0 16px;
}

.nsec-login {
    text-align: left;
}

.nsec-login label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.input-group input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: monospace;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.toggle-btn {
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
}

.nsec-login .btn {
    width: 100%;
}

.login-footer {
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--accent-color);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 50px;
    opacity: 0;
    transition: var(--transition);
    z-index: 2000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Responsive */
@media (max-width: 1200px) {
    .right-sidebar {
        display: none;
    }

    .app-layout {
        grid-template-columns: var(--sidebar-width) 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        height: auto;
        border-right: none;
        border-top: 1px solid var(--border-color);
        padding: 8px;
        z-index: 100;
        background: var(--bg-primary);
    }

    .sidebar-content {
        flex-direction: row;
        justify-content: space-around;
    }

    .sidebar-logo,
    .post-btn span,
    .nav-item span,
    .sidebar-user,
    .login-btn {
        display: none;
    }

    .nav-menu {
        flex-direction: row;
        gap: 0;
    }

    .nav-item {
        padding: 12px;
    }

    .post-btn {
        width: auto;
        margin: 0;
        padding: 12px;
    }

    .app-layout {
        grid-template-columns: 1fr;
        padding-bottom: 70px;
    }
}

/* ============================================
   Profile Modal
   ============================================ */

.profile-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.profile-banner {
    height: 150px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 20px 20px 0 0;
    background-size: cover;
    background-position: center;
}

.profile-header {
    position: relative;
    padding: 0 24px;
    margin-top: -50px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.profile-avatar-lg {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border-radius: 50%;
    border: 4px solid var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    overflow: hidden;
}

.profile-avatar-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-close {
    position: absolute;
    top: -120px;
    right: 24px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.profile-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.profile-info {
    padding: 16px 24px 24px;
}

.profile-info h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-handle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.profile-bio {
    margin-bottom: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.profile-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.stat {
    display: flex;
    gap: 6px;
    align-items: center;
}

.stat-count {
    font-weight: 700;
    font-size: 1rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.npub-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.npub-display code {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-secondary);
    word-break: break-all;
    font-family: 'SF Mono', 'Consolas', monospace;
}

.npub-display button {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    transition: var(--transition);
}

.npub-display button:hover {
    transform: scale(1.1);
}

.profile-stats {
    display: flex;
    gap: 24px;
}

.profile-stats .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-stats .stat-count {
    font-weight: 600;
    font-size: 1.1rem;
}

.profile-stats .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.profile-stats-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 16px 0;
}

.profile-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.profile-tab {
    flex: 1;
    padding: 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.profile-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.profile-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.profile-notes {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}

.profile-notes .note-card {
    border-left: none;
    border-right: none;
}

.profile-actions {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    width: 100%;
    padding: 12px 24px;
    transition: var(--transition);
}

.btn-outline:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Empty state for profile notes */
.profile-notes .empty-state {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
}

.profile-notes .empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* Media Grid for Media Tab */
.media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
}

.media-item {
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: var(--bg-card);
    border-radius: 4px;
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.media-item:hover img,
.media-item:hover video {
    transform: scale(1.05);
}

.media-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* Profile Name Row with QR button */
.profile-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qr-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.qr-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-color);
}

/* ============================================
   QR Code Modal
   ============================================ */

.qr-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
}

.qr-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.qr-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qr-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    overflow: hidden;
}

.qr-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qr-name {
    font-weight: 600;
    font-size: 1rem;
}

.qr-tabs {
    display: flex;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
}

.qr-tab {
    flex: 1;
    padding: 14px 0;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.qr-tab:hover {
    color: var(--text-primary);
}

.qr-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.qr-content {
    padding: 24px 20px;
}

.qr-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: white;
    border-radius: 16px;
    margin-bottom: 20px;
}

.qr-frame canvas {
    max-width: 100%;
    height: auto;
}

.qr-keys {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qr-key-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qr-key-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.copy-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    width: 100%;
}

.copy-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-color);
}

.copy-btn span:first-child {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'SF Mono', 'Consolas', monospace;
}

.copy-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

/* ============================================
   Edit Profile Modal
   ============================================ */

.edit-profile-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.edit-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.edit-profile-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.edit-profile-content {
    flex: 1;
    overflow-y: auto;
}

.edit-banner-preview {
    height: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-banner-btn {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.edit-banner-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.edit-avatar-wrapper {
    display: flex;
    justify-content: center;
    margin-top: -40px;
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
}

.edit-avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border: 4px solid var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    overflow: hidden;
}

.edit-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.edit-profile-form {
    padding: 0 20px 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.edit-profile-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-color);
}

/* Reply Context - Parent Note Preview */
.reply-context {
    margin-bottom: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    border-left: 3px solid var(--accent-color);
    overflow: hidden;
}

.reply-context-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-hover);
}

.reply-icon {
    font-size: 0.85rem;
}

.reply-label {
    font-weight: 500;
}

.reply-context-content {
    padding: 10px 12px;
}

.loading-inline {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.parent-not-found {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.parent-note-preview {
    display: flex;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.parent-note-preview:hover {
    background: var(--bg-hover);
}

.parent-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
    overflow: hidden;
}

.parent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.parent-info {
    flex: 1;
    min-width: 0;
}

.parent-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.parent-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 4px 0 0;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Note Detail Modal */
.note-detail-modal {
    background: var(--bg-primary);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.note-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.note-detail-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.note-detail-content {
    padding: 16px;
    overflow-y: auto;
}

.note-detail-content .note-card {
    border: none;
    padding: 0;
}

/* Reply Context in Compose Modal */
.replying-to-display {
    display: none;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-left: 12px;
}


/* Ensure Compose Modal is above other modals (especially Profile Modal) */
#composeModal {
    z-index: 2000;
}

/* Repost Header */
.repost-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.repost-header svg {
    color: var(--success-color);
    /* Green for repost */
}