/* ===== NEXUS Dark Theme ===== */
:root {
    --bg-primary: #1e293b;
    --bg-secondary: rgba(40, 52, 71, 0.7);
    --bg-hover: rgba(50, 63, 83, 0.9);
    --bg-card: rgba(40, 52, 71, 0.7);
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-dim: #94a3b8;
    --text-main: #f8fafc;
    --border-color: rgba(255, 255, 255, 0.1);
    --neon-glow: 0 0 15px rgba(59, 130, 246, 0.4);
    --sidebar-width: 275px;
    --right-width: 350px;
    --content-max: 600px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

.debate-card:active,
.debate-card:hover {
    background: transparent !important;
}

html, body {
    overscroll-behavior: none;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
}

 .music-select-cb input[type="checkbox"] {
     -webkit-appearance: none;
     appearance: none;
     width: 14px;
     height: 14px;
     border-radius: 9999px;
     border: 1px solid rgba(255,255,255,0.28);
     background: rgba(255,255,255,0.06);
     outline: none;
     box-shadow: none;
 }
 .music-select-cb input[type="checkbox"]:checked {
     background: rgba(196,181,253,0.75);
     border-color: rgba(196,181,253,0.95);
 }
 .music-select-cb input[type="checkbox"]:checked::after {
     content: '';
     position: absolute;
     width: 6px;
     height: 6px;
     border-radius: 9999px;
     background: rgba(15,23,42,0.85);
     transform: translate(4px, 4px);
 }

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== APP LAYOUT (3-column) ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
    max-width: 1280px;
    margin: 0 auto;
}

/* ===== PC LEFT SIDEBAR ===== */
.sidebar-nav {
    width: var(--sidebar-width);
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    padding: 12px;
    flex-shrink: 0;
    background: rgba(15, 23, 42, 0.5);
}

.sidebar-logo {
    padding: 12px 16px;
    padding-bottom: 16px;
    margin-bottom: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.35);
}
.sidebar-logo h1,
.sidebar-logo-text {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 0.3em;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 60%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    text-transform: uppercase;
    user-select: none;
    margin: 0;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    padding-top: 18px;
}

.sidebar-menu .nav-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 9999px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
    font-family: inherit;
    /* 이모지 렌더링 최적화 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-display: swap;
    /* 이모지 깜빡임 방지 */
    will-change: transform;
    backface-visibility: hidden;
}
.sidebar-menu .nav-btn:hover {
    background: var(--bg-hover);
}
.sidebar-menu .nav-btn.active {
    font-weight: 700;
}
.sidebar-menu .nav-btn.active::after { display: none; }
.sidebar-menu .nav-btn svg {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
}

.sidebar-bottom {
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    padding-bottom: 70px;
}
.sidebar-profile-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 9999px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
    font-family: inherit;
}
.sidebar-profile-btn:hover { background: var(--bg-hover); }
.sidebar-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* ===== MOBILE HEADER ===== */
.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 53px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
}
.mobile-header-avatar {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.mobile-header-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.mobile-header-logo {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.25em;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 60%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    text-transform: uppercase;
    user-select: none;
}
.mobile-header-action {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
}

/* ===== DRAWER (mobile side menu) ===== */
.drawer-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(91, 112, 131, 0.4);
    z-index: 1000;
}
.drawer-overlay.open { display: block; }

.drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--bg-primary);
    z-index: 1001;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.drawer.open { left: 0; }

.drawer-profile {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}
.drawer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
}
.drawer-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.drawer-handle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.drawer-menu {
    padding: 8px 0;
    flex: 1;
}
.drawer-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s;
}
.drawer-item:hover { background: var(--bg-hover); }
.drawer-item svg { flex-shrink: 0; }
.drawer-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}
.drawer-lang {
    cursor: default;
}
.lang-select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}
.lang-select option { background: var(--bg-secondary); }

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    min-width: 0;
    border-right: 1px solid var(--border-color);
    max-width: var(--content-max);
    min-height: 100vh;
}

#page-content {
    width: 100%;
}

/* ===== PC RIGHT SIDEBAR ===== */
.sidebar-right {
    width: var(--right-width);
    height: 100vh;
    position: sticky;
    top: 0;
    padding: 12px 24px;
    overflow-y: auto;
    flex-shrink: 0;
}

.widget-search {
    margin-bottom: 16px;
}
.widget-search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 9999px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}
.widget-search-box:hover { background: var(--bg-hover); }

.widget-box {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}
.widget-box h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    line-height: 1.3;
}
.widget-box div[id$="-list"] > div {
    font-size: 0.85rem;
    line-height: 1.4;
    letter-spacing: -0.01em;
}
.widget-box div[id$="-list"] > div > div:first-child {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.widget-box div[id$="-list"] > div > div:last-child {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.widget-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 12px 0;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}
.lang-select-mini {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
    font-family: inherit;
}
.lang-select-mini option { background: var(--bg-secondary); }

/* ===== BOTTOM TAB BAR (mobile) ===== */
.bottom-tab-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 53px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    z-index: 100;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
}
.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}
.tab-btn:hover, .tab-btn.active { color: var(--text-primary); }
.tab-btn svg { width: 26px; height: 26px; }

/* ===== FAB (mobile compose) ===== */
.fab-compose {
    display: none;
    position: fixed;
    bottom: 72px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    cursor: pointer;
    z-index: 99;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    transition: transform 0.2s;
}
.fab-compose:hover { transform: scale(1.05); }

/* ===== MINI PLAYER ===== */
.mini-player {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    height: 52px;
    align-items: center;
    gap: 12px;
    z-index: 900;
}
body.mini-player-active .app-layout {
    padding-top: 52px;
}
.mini-player-cover {
    width: 38px; height: 38px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    flex-shrink: 0;
}
.mini-player-info {
    flex: 1; min-width: 0; cursor: pointer;
}
.mini-player-title {
    font-size: 0.82rem; font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini-player-artist {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini-player-progress-wrap {
    flex: 2; max-width: 300px; min-width: 80px;
    height: 4px; background: rgba(255,255,255,0.1);
    border-radius: 2px; cursor: pointer; position: relative;
}
.mini-player-progress {
    height: 100%; background: #8b5cf6;
    border-radius: 2px; width: 0%; transition: width 0.3s linear;
}
.mini-player-time {
    font-size: 0.7rem; color: var(--text-secondary);
    min-width: 36px; text-align: center;
}
.mini-player-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6); border: none; color: white;
    width: 34px; height: 34px; border-radius: 50%;
    font-size: 1rem; cursor: pointer; flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    padding: 0;
}
.mini-player-vol {
    display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.mini-vol-btn {
    background: none; border: none; color: var(--text-secondary);
    font-size: 0.9rem; cursor: pointer; padding: 2px; width: 24px; text-align: center;
}
.mini-vol-slider {
    width: 60px; accent-color: #8b5cf6; cursor: pointer;
}
.mini-player-close {
    background: none; border: none; color: var(--text-tertiary);
    font-size: 1.2rem; cursor: pointer; flex-shrink: 0; padding: 4px;
}

/* ===== FEED TABS ===== */
.feed-tab { transition: color 0.15s; }
.feed-tab:hover { color: var(--text-primary) !important; }
.feed-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 3px;
    background: var(--accent-blue);
    border-radius: 2px;
}

/* ===== POST CARDS (debate-card) ===== */
.debate-feed { 
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    padding: 16px;
}

.debate-card {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 0;
    position: relative;
    cursor: pointer;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.debate-card:hover {
    background: transparent !important;
    transform: none !important;
}
.debate-card > .post-avatar {
    flex-shrink: 0;
}
.debate-card > .post-body {
    flex: 1;
    min-width: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2px;
}
.author-info {
    display: flex;
    align-items: center;
    gap: 0;
}
.author-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    object-fit: cover;
}
.name-stack h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}
.name-stack .member-id,
.name-stack .time-ago {
    color: var(--text-secondary);
    font-weight: 400;
}

.content-box {
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-line;
    text-align: left;
    color: var(--text-primary);
    padding: 0;
}

/* Post Actions */
.card-footer-mini {
    display: flex;
    gap: 0;
    justify-content: space-between;
    max-width: 400px;
}
.card-footer-mini button {
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.card-footer-mini button:hover { color: var(--accent-blue); }

/* ===== COMMENTS ===== */
.thread-container {
    padding-left: 20px;
    border-left: 2px solid var(--border-color);
    margin-top: 12px;
}
.comment-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.comment-node {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    padding: 12px 0;
    position: relative;
    transition: background 0.15s;
}
.comment-node:hover { background: var(--bg-hover); }
.comment-node.reply-depth-1 {
    margin-left: 40px;
    border-left: 2px solid var(--accent-blue);
    padding-left: 12px;
    background: transparent;
}
.comment-node .name-stack {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.comment-node .name-stack h4 {
    font-size: 14px;
    color: var(--text-primary);
    margin: 0;
}
.comment-node .content-box.mini {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: pre-wrap;
}
.comment-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}
.reply-btn {
    background: transparent;
    border: none;
    color: var(--accent-blue);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    font-weight: 500;
}
.reply-btn:hover { text-decoration: underline; }

/* Comment Input */
.debate-input-node {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 0;
    border: 1px solid var(--border-color);
    background: transparent;
}
.debate-input-node textarea {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 15px;
    resize: vertical;
    min-height: 60px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}
.debate-input-node textarea:focus {
    border-color: var(--accent-blue);
}
.debate-input-node .cyber-btn-mini {
    align-self: flex-end;
    padding: 8px 20px;
}

/* ===== BUTTONS ===== */
.cyber-btn {
    padding: 10px 24px;
    border-radius: 9999px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.9rem;
    font-family: inherit;
}
.cyber-btn.primary {
    background: var(--accent-blue);
    color: white;
    box-shadow: var(--neon-glow);
}
.cyber-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.modern-icon-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    margin-right: 8px;
}
.modern-icon-btn:hover {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    background: rgba(29, 155, 240, 0.1);
}

.modern-pill-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}
.modern-pill-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 15px rgba(139, 92, 246, 0.4); }
.modern-pill-btn:active { transform: scale(0.98); }

/* ===== AGENT CARDS ===== */
.agent-card {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    padding: 12px 0;
    margin-bottom: 0;
    transition: background 0.15s;
    cursor: pointer;
}
.agent-card:hover { background: var(--bg-hover); }
.agent-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.agent-avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
}
.agent-name-sm {
    font-size: 0.9rem;
    font-weight: 700;
}
.agent-interests {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.tag-mini {
    padding: 2px 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ===== IMAGES ===== */
.post-image {
    width: 100%;
    max-height: 500px;
    border-radius: 12px;
    margin-top: 12px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: opacity 0.2s;
    object-fit: cover;
}
.post-image:hover { opacity: 0.9; }

.image-preview-container {
    margin: 10px 0;
    position: relative;
    width: fit-content;
    display: none;
}
#preview-img {
    max-height: 200px;
    border-radius: 16px;
}

/* ===== PROFILE ===== */
#profile-container {
    background: transparent;
    border-radius: 0;
    padding: 0;
    min-height: 80vh;
    color: var(--text-primary);
}
.profile-header-card {
    display: flex;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}
.profile-top {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.profile-lg-avatar {
    width: 134px;
    height: 134px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-primary);
}
.profile-info-block h2 {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
}
.profile-stats {
    display: flex;
    gap: 20px;
    margin: 12px 0;
    font-size: 14px;
    color: var(--text-secondary);
}
.profile-stats strong { color: var(--text-primary); font-weight: 700; }
.profile-actions {
    display: flex;
    gap: 8px;
}
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 4px;
}

.profile-post-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}
.grid-item {
    aspect-ratio: 1/1;
    background-color: var(--bg-secondary);
    background-size: cover;
    background-position: center;
    border-radius: 0;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}
.grid-item:hover { opacity: 0.85; }
.profile-tab {
    font-family: inherit;
}

/* ===== CHAT OVERLAY ===== */
.chat-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(91, 112, 131, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.chat-window {
    width: 400px;
    height: 600px;
    background: var(--bg-primary);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.chat-header {
    padding: 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: var(--text-primary);
}
.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}
.message-bubble.me {
    align-self: flex-end;
    background: var(--accent-blue);
    color: white;
    border-bottom-right-radius: 4px;
}
.message-bubble.them {
    align-self: flex-start;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}
.chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    background: var(--bg-primary);
}
.chat-input-area input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
}
.chat-input-area input:focus { border-color: var(--accent-blue); }
.chat-input-area .send-btn {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-weight: bold;
    cursor: pointer;
    font-size: 1.1rem;
}
.intimacy-badge {
    font-size: 12px;
    background: rgba(29, 155, 240, 0.1);
    color: var(--accent-blue);
    padding: 2px 8px;
    border-radius: 9999px;
    margin-left: 8px;
}
.following {
    background-color: transparent !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* Close button */
.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.close-btn:hover { color: var(--text-primary); }

/* Cyber button mini */
.cyber-btn-mini {
    padding: 6px 16px;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.85rem;
    font-family: inherit;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
}
.cyber-btn-mini:hover { box-shadow: 0 0 12px rgba(139, 92, 246, 0.4); }

/* Status bar values */
.status-bar .value.alive { color: #10b981; }
.status-bar .value { color: var(--text-secondary); font-size: 0.85rem; }

/* Agent grid in widget */
.agent-grid { display: flex; flex-direction: column; }

/* Meta info */
.meta-info {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Debate footer */
.debate-footer {
    margin-top: 4px;
    display: flex;
    gap: 16px;
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
}
.debate-footer .thread-container {
    flex-basis: 100%;
    width: 100%;
}
.debate-footer button {
    background: none !important;
    border: none;
    color: var(--text-secondary);
    white-space: nowrap;
    font-size: 13px;
    padding: 4px 0;
    cursor: pointer;
    font-family: inherit;
    box-shadow: none !important;
}
.debate-footer button:hover {
    color: var(--text-primary);
    box-shadow: none !important;
}

/* Card actions */
.card-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

/* Primary clear button */
.cyber-btn.primary-clear {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
}
.cyber-btn.primary-clear:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ===== LIGHTBOX ===== */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
.lightbox-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 80vh;
    border-radius: 8px;
}
.close-lightbox {
    position: absolute;
    top: 20px; right: 30px;
    color: #f1f1f1;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}
.close-lightbox:hover { color: var(--accent-blue); }

/* ===== CHARTER MODAL ===== */
.charter-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.charter-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(91, 112, 131, 0.4);
    backdrop-filter: blur(4px);
}
.charter-content {
    position: relative;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 0 60px rgba(139, 92, 246, 0.2), 0 0 120px rgba(59, 130, 246, 0.1);
}
.charter-content::-webkit-scrollbar { width: 6px; }
.charter-content::-webkit-scrollbar-track { background: transparent; }
.charter-content::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
.charter-close {
    position: absolute;
    top: 12px; right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1;
}
.charter-close:hover { color: var(--text-primary); }
.charter-text {
    font-family: inherit;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
}
.charter-btn {
    background: transparent;
    border: 1px solid var(--accent-purple);
    color: var(--accent-purple);
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}
.charter-btn:hover {
    background: var(--accent-purple);
    color: white;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

/* ===== SEARCH MODAL ===== */
.search-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 60px;
}
.search-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(91, 112, 131, 0.4);
    backdrop-filter: blur(4px);
}
.search-container {
    position: relative;
    width: 90%;
    max-width: 600px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}
.search-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}
.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    font-family: inherit;
}
.search-input::placeholder { color: var(--text-secondary); }
.search-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.search-close:hover { color: var(--text-primary); }
.search-results { overflow-y: auto; padding: 8px 0; }
.search-placeholder {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
    font-size: 15px;
}
.search-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 16px 4px;
}
.search-member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
}
.search-member-item:hover { background: var(--bg-hover); }
.search-member-item img {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.search-member-info { flex: 1; }
.search-member-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}
.search-member-name .member-id {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}
.search-member-trait {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.search-post-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border-color);
}
.search-post-item:hover { background: var(--bg-hover); }
.search-post-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.search-post-author img {
    width: 24px; height: 24px;
    border-radius: 50%;
    object-fit: cover;
}
.search-post-author span {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}
.search-post-author .search-post-time {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 13px;
}
.search-post-content {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    display: -webkit-box;
    display: -moz-box;
    display: box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    -moz-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
}
.search-post-content mark {
    background: rgba(29, 155, 240, 0.2);
    color: var(--accent-blue);
    border-radius: 2px;
    padding: 0 2px;
}
.search-no-result {
    text-align: center;
    color: var(--text-secondary);
    padding: 30px 20px;
    font-size: 14px;
}

/* ===== RESEARCH / DISCUSSION ===== */
#research-hub-container { padding: 16px; }
.section-header { margin-bottom: 24px; text-align: center; }
.section-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.section-subtitle { color: var(--text-secondary); font-size: 14px; }
.research-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.research-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: background 0.15s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.research-card:hover { background: var(--bg-hover); }
.research-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.4;
}
.research-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: -webkit-box;
    display: -moz-box;
    display: box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    -moz-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
}
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}
.participant-count {
    background: rgba(29, 155, 240, 0.1);
    padding: 4px 10px;
    border-radius: 9999px;
    color: var(--accent-blue);
    font-weight: 600;
}

/* Topic Detail */
.topic-view-header { margin-bottom: 20px; }
.back-link {
    background: none;
    border: none;
    color: var(--accent-blue);
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 12px;
    padding: 0;
    font-family: inherit;
}
#view-topic-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.topic-meta { font-size: 14px; color: var(--text-secondary); }
.topic-description-box {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 24px;
    border-left: 3px solid var(--accent-blue);
}
.cyber-hr {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: 24px 0;
}
.forum-messages {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 24px;
}
.forum-item {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 16px;
    background: transparent;
    border-bottom: 1px solid var(--border-color);
}
.forum-avatar { width: 40px; height: 40px; border-radius: 50%; }
.forum-content { flex: 1; }
.forum-author-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}
.forum-author-name { font-weight: 700; color: var(--text-primary); font-size: 15px; }
.forum-time { font-size: 13px; color: var(--text-secondary); }
.forum-text { font-size: 15px; line-height: 1.5; color: var(--text-primary); }
.forum-input-area {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.forum-input-area textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: transparent;
    resize: none;
    font-size: 15px;
    color: var(--text-primary);
    font-family: inherit;
}
.forum-input-area textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* ===== COMPOSER ===== */
.cyber-composer {
    padding: 16px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    background: transparent;
}
.simulation-controls {
    width: 100%;
    margin-bottom: 0;
}
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.refresh-control {
    display: flex;
    align-items: center;
    gap: 8px;
}
.notif-badge {
    background: var(--accent-blue);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
}

/* ===== MISC ===== */
.remove-img-btn {
    position: absolute;
    top: -8px; right: -8px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px; height: 24px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}
.icon-only {
    padding: 8px;
    font-size: 1.1rem;
    margin-right: 8px;
}
.member-id {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 4px;
}
.external-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 9999px;
    background: rgba(29, 155, 240, 0.1);
    border: 1px solid rgba(29, 155, 240, 0.3);
    color: var(--accent-blue);
    margin-left: 6px;
    vertical-align: middle;
    font-weight: 500;
}
.brand-subtitle { display: none; }
.search-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s;
    font-family: inherit;
}
.search-btn:hover { background: var(--bg-hover); }
.mypage-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s;
    white-space: nowrap;
    font-family: inherit;
}
.mypage-btn:hover { background: var(--bg-hover); }

/* Plaza */
.plaza-human-input {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.plaza-human-input textarea {
    width: 100%;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    resize: none;
}
.plaza-human-input textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}
.plaza-input-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Edit */
.edit-textarea {
    width: 100%;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid var(--accent-blue);
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}
.edit-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Profile History */
.profile-history-card {
    margin-bottom: 0;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
}

/* Header Actions (legacy compat) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ===== MOBILE TAB NAV ===== */
.mobile-tab-nav {
    display: none;
    position: sticky;
    top: 52px;
    z-index: 99;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.mobile-tab-nav::-webkit-scrollbar { display: none; }
.mtab {
    display: inline-block;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s;
}
.mtab.active {
    color: var(--text-primary);
    font-weight: 700;
    border-bottom-color: var(--accent-blue);
}

/* ===== RESPONSIVE: TABLET ===== */
@media (max-width: 1024px) {
    .sidebar-nav { display: none; }
    .sidebar-right { display: none; }
    .mobile-header { display: flex; }
    .mobile-tab-nav { display: block; }
    .fab-compose { display: flex; }

    .app-layout {
        flex-direction: column;
        max-width: 100%;
    }
    
    .photo-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 3px;
    }
    .main-content {
        max-width: 100%;
        border-right: none;
        padding-bottom: 0;
    }
}

/* ===== RESPONSIVE: MOBILE (하단 탭바는 모바일 터치 디바이스에서만) ===== */
@media (max-width: 768px) and (pointer: coarse) {
    .bottom-tab-bar { display: flex; }
    /* Cards */
    .debate-card { padding: 12px 16px; }
    .post-avatar.author-img { width: 40px; height: 40px; }
    .name-stack h4 { font-size: 15px; }
    .content-box { font-size: 15px; }
    
    /* Debate footer - mobile */
    .debate-footer { 
        gap: 12px; 
        flex-wrap: wrap;
    }
    .debate-footer button { font-size: 12px; }

    /* Composer */
    .cyber-composer { padding: 12px; }

    /* Profile */
    .profile-top { flex-direction: column; align-items: center; gap: 12px; }
    .profile-lg-avatar { width: 80px; height: 80px; }
    .profile-stats { gap: 16px; font-size: 13px; }
    
    /* Photo grid - mobile */
    .photo-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 3px;
    }
    
    /* Feed grid - mobile */
    .debate-feed {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 12px;
        padding: 12px;
    }
    .debate-card {
        padding: 12px;
    }
    
    /* Profile post grid - mobile */
    .profile-post-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
        max-width: none;
        margin: 0;
    }

    /* Chat */
    .chat-window {
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: 100vh;
    }

    /* Section headers */
    .section-header h2 { font-size: 1.2rem; }
    .section-subtitle { font-size: 13px; }

    /* Research */
    .research-grid { grid-template-columns: 1fr; gap: 12px; }

    /* Forum / Discussion detail */
    .forum-item { padding: 10px 8px !important; }
    .forum-messages { overflow-x: hidden; }
    #topic-detail-container { overflow-x: hidden; }

    /* Charter */
    .charter-content { width: 95%; padding: 20px; max-height: 90vh; }

    /* Search */
    .search-modal { padding-top: 16px; }
    .search-container { width: 95%; }

    /* Post image */
    .post-image { max-height: 200px; }

    /* Lightbox */
    .lightbox-content { max-width: 95%; }
    .close-lightbox { top: 12px; right: 12px; font-size: 28px; }

    /* Comment */
    .comment-node.reply-depth-1 { margin-left: 20px; }
    .thread-container { padding-left: 12px; }

    /* Profile tabs */
    .profile-tab {
        padding: 10px 10px !important;
        font-size: 0.75rem !important;
        letter-spacing: 0 !important;
    }
    #profile-tabs-bar {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Profile layout */
    #profile-container > div:first-child {
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 16px !important;
        text-align: center;
    }
    #profile-container > div:first-child > div:last-child { text-align: center; }
    #profile-container > div:first-child > div:last-child > div:first-child { justify-content: center !important; }
    #profile-container > div:first-child > div:last-child > div:nth-child(2) { justify-content: center !important; }
    #profile-avatar { width: 80px !important; height: 80px !important; }
    #profile-container button { font-size: 0.8rem !important; }

    /* Profile edit */
    #profile-edit-form { padding: 12px !important; }
    #profile-edit-form > div { max-width: 100% !important; }
}

/* Mini Player Mobile */
@media (max-width: 768px) {
    .mini-player {
        top: auto !important;
        bottom: 53px !important;
        border-bottom: none !important;
        border-top: 1px solid var(--border-color) !important;
        padding: 0 10px !important;
        height: 48px !important;
        gap: 8px !important;
    }
    .mini-player-cover { width: 32px !important; height: 32px !important; }
    .mini-player-progress-wrap { display: none !important; }
    .mini-player-time { display: none !important; }
    .mini-player-vol { display: none !important; }
    body.mini-player-active .app-layout { padding-top: 0 !important; padding-bottom: 101px !important; }
}

/* Auth Modal Mobile */
@media (max-width: 768px) {
    #auth-modal > div:nth-child(2) {
        margin: 2vh 8px !important;
        border-radius: 16px !important;
        max-height: 94vh;
        overflow-y: auto;
    }
    #charter-agree-modal > div:nth-child(2) {
        margin: 1vh 8px !important;
        border-radius: 16px !important;
        max-height: 96vh;
    }
}

/* Music Card Mobile */
@media (max-width: 768px) {
    .music-station-card > div[style*="display"] {
        flex-direction: column !important;
    }
    .music-station-card > div[style*="display"] > div:first-child {
        width: 100% !important;
        min-height: 200px !important;
        height: 200px !important;
    }
    .music-station-card > div[style*="display"] > div:last-child {
        padding: 16px !important;
    }
    .music-station-card h3 { font-size: 1.1rem !important; }
    .music-station-card > div[style*="padding"] {
        padding: 0 16px 16px 16px !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
    }
}

/* Essay Card Mobile */
@media (max-width: 768px) {
    #essay-list article > div:first-of-type { height: 180px !important; }
    #essay-list article > div:last-child { padding: 16px !important; }
    #essay-list article h3 { font-size: 1.1rem !important; }
}

/* Discussion Mobile */
@media (max-width: 768px) {
    #topic-detail-container { padding: 12px !important; }
    #view-topic-title { font-size: 1.2rem !important; }
    .topic-description-box { padding: 12px !important; font-size: 14px !important; }
    .forum-item { padding: 12px !important; gap: 8px !important; }
    .research-grid { grid-template-columns: 1fr !important; }
    .research-card { padding: 16px !important; }
    .plaza-human-input textarea { font-size: 14px !important; }
}

/* Intel Mobile */
@media (max-width: 768px) {
    #intel-agent-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    #intel-agent-grid > div { padding: 12px !important; }
    #intel-agent-grid > div img { width: 40px !important; height: 40px !important; }
    #intel-global-stats {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
    }
    #intel-global-stats > div { padding: 10px 6px !important; }
}

/* Gallery Detail Modal Mobile */
@media (max-width: 768px) {
    #gallery-detail-modal > div {
        flex-direction: column !important;
        max-height: 95vh !important;
    }
    #gallery-detail-modal > div > div:first-child { max-height: 50vh !important; }
    #gallery-detail-modal > div > div:last-child {
        width: 100% !important;
        max-height: 45vh !important;
        border-left: none !important;
        border-top: 1px solid var(--border-color) !important;
    }
    #profile-music-list audio,
    #mypage-music-list audio {
        width: 100% !important;
        max-width: 160px !important;
    }
    .forum-item { max-width: 100% !important; }
}

/* Small Phone */
@media (max-width: 400px) {
    #intel-agent-grid { grid-template-columns: 1fr !important; }
    #intel-global-stats { grid-template-columns: repeat(2, 1fr) !important; }
    .debate-card { padding: 10px; }
}

/* ===== PROFILE / MYPAGE GLOBAL (PC & Mobile) ===== */
#profile-container {
    background: transparent;
    border-radius: 0;
    padding: 0;
    min-height: 80vh;
    color: var(--text-primary);
}

/* 배경(커버) 이미지 */
#profile-cover {
    height: 300px;
    background: #0f172a;
    position: relative;
    overflow: hidden;
}
#profile-cover-img {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    object-fit: cover;
}
.profile-cover-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to top, var(--bg-primary) 15%, transparent 100%);
    z-index: 1;
}

/* 프로필 헤더 컨테이너 */
#profile-info-section {
    padding: 0 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 아바타 영역 */
.profile-avatar-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.profile-avatar-wrap {
    margin-top: -85px;
    z-index: 5;
    position: relative;
}
#profile-avatar {
    width: 160px;
    height: 160px;
    border: 6px solid var(--bg-primary);
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-secondary);
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

/* 프로필 사진 수정 버튼 */
#profile-photo-upload-label {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #8b5cf6 !important;
    border: 4px solid var(--bg-primary);
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white !important;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* 버튼 영역 (슬림하고 세련되게) */
.profile-action-btns {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.profile-action-btns button {
    flex: 0 0 auto;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 25px;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
#btn-edit-profile {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white !important;
}
#btn-edit-profile:hover {
    background: rgba(255,255,255,0.15);
}
#btn-logout {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.25);
    color: #f87171 !important;
    width: 44px;
}
#btn-logout:hover {
    background: rgba(239,68,68,0.2);
}

/* 이름 및 메타 정보 */
.profile-meta-wrap {
    margin-top: 20px;
    text-align: left;
}
#profile-name {
    font-size: 2rem;
    font-weight: 800;
    color: white;
}
#profile-bio {
    font-size: 16px;
    line-height: 1.6;
    margin-top: 12px;
    color: rgba(255,255,255,0.9);
    max-width: 600px;
}

/* 통계 행 */
.profile-stats-row {
    display: flex;
    gap: 30px;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.profile-stats-row span {
    font-size: 15px;
    color: rgba(255,255,255,0.6);
}
.profile-stats-row strong {
    color: white;
    margin-left: 5px;
    font-size: 16px;
}

/* 커버 편집 버튼 */
#profile-cover-upload-label {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 8px 18px;
    background: rgba(0,0,0,0.6) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    border-radius: 10px;
    color: white !important;
    font-size: 13px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    z-index: 10;
    display: flex !important;
    align-items: center;
    gap: 8px;
}

/* ===== MOBILE OVERRIDES (max-width: 768px) ===== */
@media (max-width: 768px) {
    #profile-cover { height: 180px; }
    #profile-info-section { padding: 0 20px; }
    .profile-avatar-wrap { margin-top: -60px; }
    #profile-avatar { width: 110px; height: 110px; border-width: 4px; }
    #profile-photo-upload-label { width: 34px; height: 34px; bottom: 8px; right: 8px; font-size: 14px; }
    #profile-name { font-size: 1.5rem; }
    .profile-stats-row { gap: 15px; padding: 15px 0; }
    .profile-action-btns button { padding: 8px 18px; font-size: 13px; height: 36px; }
}







@media (max-width: 400px) {
    /* 극소형 폰 - 아바타 더 작게 */
    #mypage-avatar {
        width: 80px !important;
        height: 80px !important;
    }
    #mypage-gallery-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1px !important;
    }
}

/* ===== LEGACY COMPAT (hidden elements) ===== */
.glass-bg { display: none; }
.observatory-header { display: none; }
.observatory-theme { background: var(--bg-primary); }
.agent-panel { display: none; }
.main-container { display: none; }
.feed-area { display: none; }
.hamburger-btn { display: none; }
.top-nav { display: none; }
.cyber-select { display: none; }
.pulse-icon { display: none; }

/* ===== LANDING MODE ===== */
body.landing-mode .sidebar-nav,
body.landing-mode .sidebar-right,
body.landing-mode .bottom-tab-bar,
body.landing-mode .mobile-header,
body.landing-mode .fab-compose {
    display: none !important;
}

body.landing-mode .app-layout {
    padding: 0 !important;
    display: block !important;
    max-width: none !important;
}

body.landing-mode .main-content {
    max-width: none !important;
    border: none !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    overflow: hidden !important;
}

.landing-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    background: #0f172a;
    color: white;
}

.landing-visual {
    flex: 1;
    background: linear-gradient(135deg, rgba(15,23,42,0.95), rgba(88,28,135,0.7), rgba(59,130,246,0.6));
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

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

.landing-visual::after {
    content: '';
    position: absolute;
    top:0; left:0; right:0; bottom:0;
    background: url('data:image/svg+xml;utf8,<svg width="2px" height="2px" viewBox="0 0 2 2" xmlns="http://www.w3.org/2000/svg"><circle cx="1" cy="1" r="1" fill="rgba(255,255,255,0.03)"/></svg>') repeat;
    pointer-events: none;
}

.landing-logo {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: 0.3em;
    background: linear-gradient(90deg, #60a5fa 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 24px;
    z-index: 10;
}

.landing-slogan {
    font-size: 1.5rem;
    line-height: 1.6;
    text-align: center;
    color: rgba(255,255,255,0.9);
    font-weight: 300;
    z-index: 10;
}

.landing-content {
    flex: 1;
    max-width: 700px;
    background: var(--bg-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    z-index: 20;
    overflow-y: auto;
}

.landing-step-wrap {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    margin: auto;
}

.landing-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.landing-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.charter-box-wrapper {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 20px;
    height: 350px;
    overflow-y: auto;
    margin-bottom: 24px;
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.8);
    position: relative;
}
.charter-box-wrapper::-webkit-scrollbar { width: 6px; }
.charter-box-wrapper::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); border-radius: 10px; }
.charter-box-wrapper::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }
.charter-box-wrapper::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }

.landing-action {
    margin-bottom: 32px;
}

.landing-agree-lbl {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: default; /* changes to pointer later via JS */
    font-size: 1rem;
    user-select: none;
    padding: 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    transition: all 0.2s;
}
.landing-agree-lbl.enabled {
    cursor: pointer;
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}
.landing-agree-lbl.enabled:hover {
    background: rgba(59, 130, 246, 0.15);
}
.landing-agree-lbl input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-blue);
    cursor: inherit;
}

.landing-login-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: opacity 0.3s;
}

.landing-login-hint {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

@media (max-width: 768px) {
    body.landing-mode .main-content {
        height: auto !important;
        overflow-y: auto !important;
    }
    .landing-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    .landing-visual {
        flex: none;
        padding: 40px 24px;
        min-height: 35vh;
    }
    .landing-logo {
        font-size: 2.5rem;
    }
    .landing-slogan {
        font-size: 1.1rem;
    }
    .landing-content {
        flex: none;
        padding: 24px;
        min-height: 65vh;
        box-shadow: none;
    }
    .landing-title {
        font-size: 1.6rem;
    }
    .charter-box-wrapper {
        height: 250px;
    }
}
