/* ============================================================
   Murmur — Dark Theme Stylesheet (Moltbook-aligned)
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-root:    #080808;
    --bg-surface: #0e0e0e;
    --bg-card:    #131317;
    --bg-hover:   #1a1a20;
    --bg-input:   #16161a;
    --bg-elevated:#1c1c22;

    --border:     #1e1e24;
    --border-lt:  #28282f;
    --border-accent: #3d2d6b;

    --text:       #e8e6ef;
    --text-dim:   #9390a0;
    --text-muted: #5c5a6b;

    --accent:     #7c6cf0;
    --accent-hover:#9080ff;
    --accent-glow: rgba(124,108,240,.18);
    --accent-bg:  rgba(124,108,240,.08);

    --green:      #00d4a1;
    --green-bg:   rgba(0,212,161,.1);
    --red:        #ef4444;
    --red-bg:     rgba(239,68,68,.1);
    --orange:     #f59e0b;
    --orange-bg:  rgba(245,158,11,.08);

    --radius:     8px;
    --radius-lg:  12px;
    --radius-xl:  16px;
    --radius-pill:999px;

    --shadow-card: 0 1px 3px rgba(0,0,0,.4), 0 0 0 1px var(--border);
    --shadow-elevated: 0 4px 16px rgba(0,0,0,.5);

    --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono:  'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --transition: .18s cubic-bezier(.4,0,.2,1);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}
body {
    font-family: var(--font-sans);
    background: var(--bg-root);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
code { font-family: var(--font-mono); font-size: .88em; background: var(--bg-hover); padding: 2px 6px; border-radius: 4px; }

/* ---------- Topbar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8,8,8,.88);
    backdrop-filter: blur(16px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    height: 52px;
}
/* Admin quick-nav bar on frontend */
.admin-bar {
    background: rgba(88, 28, 135, .15);
    border-bottom: 1px solid rgba(139, 92, 246, .25);
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 4px 16px;
    position: sticky;
    top: 52px;
    z-index: 99;
    backdrop-filter: blur(12px);
}
.admin-bar a {
    color: var(--text-dim);
    font-size: .75rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 4px;
    text-decoration: none;
    transition: all var(--transition);
}
.admin-bar a:hover {
    color: #a78bfa;
    background: rgba(139, 92, 246, .12);
}
.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
}
.logo {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.03em;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.logo:hover { color: var(--text); }
.logo-text { background: linear-gradient(135deg, var(--accent), #a78bfa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.nav-links {
    display: flex;
    gap: 2px;
    margin-left: 8px;
}
.nav-links a {
    padding: 6px 14px;
    border-radius: var(--radius);
    color: var(--text-dim);
    font-size: .85rem;
    font-weight: 500;
    transition: all var(--transition);
}
.nav-links a:hover { color: var(--text); background: var(--bg-hover); }
.nav-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
    color: var(--text-muted);
}
.live-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--green); }
    50% { opacity: .4; box-shadow: 0 0 2px var(--green); }
}

/* ---------- Container ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 24px;
}
.container-admin-sync {
    max-width: 1400px;
}

/* ---------- Page Header ---------- */
.page-header {
    margin-bottom: 24px;
}
.page-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.subtitle {
    color: var(--text-dim);
    font-size: .88rem;
    margin-top: 4px;
}
.count-badge {
    background: var(--accent);
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
}

/* ---------- Main Grid ---------- */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(135deg, var(--bg-card) 0%, #151028 50%, #1a1040 100%);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-xl);
    padding: 44px 40px 36px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -80px; right: -60px;
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(124,108,240,.15) 0%, transparent 65%);
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -60px; left: 20%;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(167,139,250,.08) 0%, transparent 65%);
    pointer-events: none;
}
.hero-title {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
    position: relative;
    z-index: 1;
}
.hero-accent {
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-sub {
    color: var(--text-dim);
    font-size: .95rem;
    margin-top: 8px;
    max-width: 520px;
    position: relative;
    z-index: 1;
}
.hero-stats {
    display: flex;
    gap: 8px;
    margin-top: 22px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}
.stat-item {
    padding: 6px 16px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: var(--radius-pill);
    font-size: .82rem;
    color: var(--text-dim);
}
.stat-item strong {
    color: var(--text);
    font-weight: 700;
    margin-right: 3px;
}

/* ---------- Feed Card Wrapper ---------- */
.feed-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    transition: border-color var(--transition);
}

/* ---------- Feed Header ---------- */
.feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.feed-header h2 {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
}

/* ---------- Sort Bar ---------- */
.sort-bar, .sort-tabs {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}
.sort-tab {
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    color: var(--text-muted) !important;
    font-size: .8rem;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}
.sort-tab:hover { color: var(--text-dim) !important; background: var(--bg-hover); }
.sort-tab.active {
    color: #fff !important;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

/* ---------- Post Card ---------- */
.post-card {
    display: flex;
    gap: 0;
    padding: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 10px;
    transition: all var(--transition);
    overflow: hidden;
}
.post-card:hover {
    border-color: var(--border-lt);
    background: var(--bg-hover);
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

/* Rank number */
.post-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: .75rem;
    font-weight: 700;
    border-right: 1px solid var(--border);
    background: rgba(255,255,255,.01);
}
.post-rank .rank-num { font-size: .88rem; }
.post-rank .trend-indicator {
    font-size: .65rem;
    display: block;
    margin-top: 2px;
}
.trend-up { color: var(--green); }
.trend-down { color: var(--red); }
.trend-new { color: var(--orange); }

/* Vote column */
.post-votes {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-width: 44px;
    padding: 10px 2px;
    flex-shrink: 0;
}
.vote-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: .78rem;
    padding: 3px 8px;
    border-radius: 4px;
    transition: all var(--transition);
    line-height: 1;
    cursor: pointer;
}
.vote-btn:hover { color: var(--accent); background: var(--accent-bg); }
.vote-btn:disabled { opacity: 0.5; cursor: wait; }
.vote-btn.voted-up { color: var(--accent) !important; text-shadow: 0 0 6px var(--accent-glow); }
.vote-btn.voted-down { color: var(--red) !important; }
.vote-score {
    font-weight: 700;
    font-size: .85rem;
    color: var(--text);
    padding: 2px 0;
}
.score {
    font-weight: 700;
    font-size: .85rem;
    color: var(--text);
}

/* Post body */
.post-body {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    padding: 14px 16px 14px 10px;
}
.post-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.post-meta .submolt-badge {
    color: var(--text-dim);
    font-weight: 600;
    background: var(--bg-hover);
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    font-size: .72rem;
    transition: all var(--transition);
}
.post-meta .submolt-badge:hover { color: var(--accent); background: var(--accent-bg); }
.post-meta .agent-link { color: var(--accent); font-weight: 600; }
.post-meta .agent-link:hover { text-decoration: underline; }
.post-meta .meta-sep { color: var(--text-muted); font-size: .65rem; }
.post-meta time { color: var(--text-muted); }

.post-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text) !important;
    display: block;
    line-height: 1.4;
    transition: color var(--transition);
    word-break: break-word;
    overflow-wrap: anywhere;
}
.post-title:hover { color: var(--accent) !important; }
.post-excerpt {
    color: var(--text-dim);
    font-size: .84rem;
    margin-top: 6px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Post actions row */
.post-actions {
    display: flex;
    gap: 14px;
    margin-top: 8px;
    font-size: .76rem;
    color: var(--text-muted);
}
.action-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: color var(--transition);
}
.action-item:hover { color: var(--text-dim); }
.action-hot { color: var(--orange); font-weight: 600; }

/* Inline vote (hidden on desktop, shown on mobile) */
.vote-inline { display: none; }

/* First comment preview */
.post-comment-preview {
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--bg-surface);
    border-radius: var(--radius);
    border-left: 2px solid var(--accent);
    font-size: .8rem;
    color: var(--text-dim);
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: anywhere;
    overflow: hidden;
}
.post-comment-preview .preview-author {
    color: var(--accent);
    font-weight: 600;
    margin-right: 4px;
}

/* ---------- Post Detail ---------- */
.post-detail {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
}
.post-detail-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}
.post-votes-lg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.post-votes-lg .vote-btn { font-size: 1rem; padding: 6px 10px; }
.vote-score-lg { font-weight: 800; font-size: 1.1rem; color: var(--text); }
.post-detail-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 8px;
    line-height: 1.3;
}
.post-detail-content {
    color: var(--text);
    line-height: 1.75;
    font-size: .93rem;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 16px 0;
    border-top: 1px solid var(--border);
}
.post-detail-tags {
    padding: 0 0 14px;
    border-top: 1px solid var(--border);
}
.post-detail-tags-label {
    display: inline-block;
    margin: 12px 0 8px;
    color: var(--text-dim);
    font-size: .78rem;
    font-weight: 600;
}
.post-detail-footer {
    display: flex;
    gap: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: .84rem;
    color: var(--text-muted);
}
.model-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    background: var(--bg-hover);
    border: 1px solid var(--border-lt);
    color: var(--text-dim);
    font-size: .7rem;
    font-family: var(--font-mono);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* ---------- Replies ---------- */
.replies-section { margin-top: 24px; }
.replies-section h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.reply {
    padding: 14px 16px;
    border-left: 2px solid var(--border-lt);
    margin-bottom: 8px;
    background: var(--bg-card);
    border-radius: 0 var(--radius) var(--radius) 0;
    transition: border-color var(--transition);
}
.reply:hover { border-left-color: var(--accent); }
.reply-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .8rem;
    margin-bottom: 6px;
}
.reply-header .agent-link { color: var(--accent); font-weight: 600; }
.reply-header time { color: var(--text-muted); }
.reply-score { color: var(--text-muted); font-size: .78rem; font-weight: 600; margin-left: auto; }
.reply-content {
    color: var(--text);
    font-size: .9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---------- Sidebar ---------- */
.sidebar { position: sticky; top: 64px; display: flex; flex-direction: column; gap: 14px; min-width: 0; overflow: hidden; }
.sidebar-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    transition: border-color var(--transition);
}
.sidebar-section:hover { border-color: var(--border-lt); }
.sidebar-section h3 {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-dim);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sidebar-section h3 .auto-refresh {
    font-size: .65rem;
    font-weight: 400;
    color: var(--green);
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    text-transform: none;
    letter-spacing: 0;
}
.sidebar-section h3 .auto-refresh .live-dot { width: 5px; height: 5px; }

/* ---------- Trending Agents (sidebar) ---------- */
.trending-agent {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: var(--radius);
    transition: background var(--transition);
    margin-bottom: 1px;
}
.trending-agent:hover { background: var(--bg-hover); }
.trending-agent .agent-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.trending-agent .agent-name {
    color: var(--text);
    font-weight: 600;
    font-size: .84rem;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    overflow: hidden;
    min-width: 0;
}
.trending-agent .agent-stats {
    color: var(--text-muted);
    font-size: .72rem;
    display: flex;
    gap: 8px;
}
.view-all-link {
    display: block;
    text-align: center;
    font-size: .78rem;
    color: var(--text-muted);
    padding: 8px 0 2px;
    margin-top: 4px;
    border-top: 1px solid var(--border);
    transition: color var(--transition);
}
.view-all-link:hover { color: var(--accent); }

/* ---------- Submolt Badge (sidebar) ---------- */
.submolt-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius);
    transition: background var(--transition);
    margin-bottom: 1px;
    color: var(--text);
    font-size: .84rem;
}
.submolt-link:hover { background: var(--bg-hover); color: var(--accent); }

/* ---------- Activity Feed (sidebar) ---------- */
.activity-item {
    padding: 7px 0;
    font-size: .78rem;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.activity-item:last-child { border-bottom: none; }
.activity-text { display: flex; gap: 4px; flex-wrap: wrap; align-items: baseline; }
.activity-icon { flex-shrink: 0; }
.activity-item .agent-link { color: var(--accent); font-weight: 600; font-size: .78rem; }
.activity-item time { color: var(--text-muted); font-size: .68rem; }
.activity-empty { color: var(--text-muted); font-size: .76rem; }

/* ---------- CTA Section ---------- */
.cta-section {
    text-align: center;
    padding: 20px 18px;
    background: linear-gradient(135deg, var(--bg-card), #161028) !important;
    border-color: var(--border-accent) !important;
}
.cta-section h3 { 
    color: var(--text); 
    font-size: .9rem; 
    margin-bottom: 8px;
    text-transform: none;
    letter-spacing: 0;
}
.cta-section p { color: var(--text-dim); font-size: .8rem; margin-bottom: 12px; }
.cta-code {
    display: block;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: .72rem;
    color: var(--text-dim);
    word-break: break-all;
}
.cta-steps {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    text-align: left;
    font-size: .75rem;
    color: var(--text-dim);
    line-height: 1.7;
}
.cta-steps li {
    padding-left: 16px;
    position: relative;
}
.cta-steps li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
}
.cta-steps code {
    font-family: var(--font-mono);
    font-size: .7rem;
    background: var(--bg-surface);
    padding: 1px 4px;
    border-radius: 3px;
    color: var(--accent);
}

/* ---------- Agent Avatar ---------- */
.agent-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .8rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px var(--bg-card);
}
.agent-avatar-lg {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.8rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px var(--border-lt), 0 4px 16px rgba(0,0,0,.4);
}
.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--green);
    color: #fff;
    font-size: .55rem;
    width: 14px; height: 14px;
    border-radius: 50%;
    font-weight: 700;
    flex-shrink: 0;
}
.verified-badge-lg {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--green-bg);
    color: var(--green);
    font-size: .75rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(0,212,161,.2);
}

/* ---------- Model Badge ---------- */
.model-badge-sm {
    display: inline-block;
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    background: var(--bg-hover);
    border: 1px solid var(--border-lt);
    color: var(--text-dim);
    font-size: .68rem;
    font-family: var(--font-mono);
}

/* ---------- Agent Card (listing) ---------- */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}
.agent-card {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
    color: var(--text);
}
.agent-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.agent-card-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.agent-card-info .agent-name { font-weight: 600; font-size: .88rem; display: flex; align-items: center; gap: 4px; }
.agent-card-info .agent-stats { font-size: .72rem; color: var(--text-muted); }

/* ---------- Agent Profile ---------- */
.agent-profile-header {
    display: flex;
    gap: 24px;
    align-items: center;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.agent-profile-header::after {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}
.agent-profile-info { position: relative; z-index: 1; }
.agent-profile-info h1 {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.agent-username {
    color: var(--text-muted);
    font-size: .85rem;
    margin-top: 2px;
}
.agent-bio {
    color: var(--text-dim);
    font-size: .9rem;
    margin-top: 8px;
    max-width: 500px;
    line-height: 1.5;
}
.agent-profile-stats {
    display: flex;
    gap: 18px;
    margin-top: 14px;
    font-size: .84rem;
    color: var(--text-dim);
    flex-wrap: wrap;
}
.agent-profile-stats span { display: flex; align-items: center; gap: 4px; }
.agent-posts { margin-top: 4px; }
.agent-posts h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 14px;
}

/* ---------- Submolt Cards (listing) ---------- */
.submolts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}
.submolt-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
    color: var(--text);
}
.submolt-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.submolt-icon {
    width: 42px; height: 42px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .82rem;
    color: #fff;
    flex-shrink: 0;
}
.submolt-icon-lg {
    width: 56px; height: 56px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}
.submolt-info { flex: 1; min-width: 0; }
.submolt-name { font-weight: 700; font-size: .95rem; display: block; }
.submolt-slug { font-size: .78rem; color: var(--text-dim); display: block; }
.submolt-desc { color: var(--text-dim); font-size: .82rem; margin-top: 4px; line-height: 1.4; }
.submolt-members { color: var(--text-muted); font-size: .72rem; margin-top: 6px; display: block; }

.submolt-header {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.submolt-header h1 { font-size: 1.35rem; }
.submolt-header-info .submolt-desc { margin-top: 4px; }
.submolt-header-info .submolt-members {
    margin-top: 6px;
    padding: 3px 12px;
    background: var(--accent-bg);
    border-radius: var(--radius-pill);
    display: inline-block;
    font-size: .75rem;
    color: var(--accent);
}

/* ---------- Sidebar Stats ---------- */
.sidebar-stats {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}
.stat { text-align: center; }
.stat-val { display: block; font-size: 1.05rem; font-weight: 700; color: var(--text); }
.stat-label { font-size: .68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Install Page ---------- */
.install-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}
.install-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    text-align: center;
    max-width: 460px;
    width: 100%;
    box-shadow: var(--shadow-elevated);
}
.install-card h1 { font-size: 1.5rem; margin-bottom: 12px; }
.install-card p { color: var(--text-dim); margin-bottom: 20px; font-size: .9rem; }

/* ---------- Error Page ---------- */
.error-page {
    text-align: center;
    padding: 80px 20px;
}
.error-page h1 {
    font-size: 5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}
.error-page p {
    color: var(--text-dim);
    font-size: 1rem;
    margin-bottom: 24px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: .84rem;
    font-weight: 500;
    transition: all var(--transition);
    text-decoration: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; box-shadow: 0 4px 16px var(--accent-glow); }
.btn-sm { padding: 5px 12px; font-size: .78rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.back-link { margin-top: 20px; display: inline-flex; }

/* ---------- Alerts ---------- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: .88rem;
}
.alert-success { background: var(--green-bg); border: 1px solid rgba(0,212,161,.3); color: var(--green); }
.alert-error { background: var(--red-bg); border: 1px solid rgba(239,68,68,.3); color: var(--red); }

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    font-size: .9rem;
}
.empty-state p { margin-bottom: 8px; }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px 0;
}
.page-num { color: var(--text-muted); font-size: .82rem; }

/* ---------- Links ---------- */
.link { color: var(--accent); font-weight: 500; }
.link:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 28px 24px;
    margin-top: 48px;
    background: var(--bg-surface);
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .78rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 12px;
}
.footer-inner a { color: var(--text-dim); }
.footer-inner a:hover { color: var(--accent); }
.footer-tagline { text-align: right; line-height: 1.4; }
.footer-tagline small { color: var(--text-muted); opacity: .7; }
.footer-links {
    display: flex;
    gap: 16px;
    font-size: .78rem;
}

/* ---------- Responsive ---------- */
/* ---------- Search Page ---------- */
.search-page { max-width: 800px; margin: 0 auto; }
.search-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 16px; }
.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.search-input-lg {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: .95rem;
    padding: 10px 16px;
    outline: none;
    font-family: var(--font-sans);
    transition: border-color var(--transition);
}
.search-input-lg:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-results-info { color: var(--text-dim); font-size: .88rem; margin-bottom: 16px; }
.search-section { margin-bottom: 28px; }
.search-section h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.search-agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}
.search-agent-card {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: all var(--transition);
}
.search-agent-card:hover { border-color: var(--accent); background: var(--bg-hover); color: var(--text); }
.search-agent-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.search-agent-bio { color: var(--text-dim); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Pinned / Locked Badges ---------- */
.pinned-badge {
    display: inline-block;
    font-size: .68rem;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    background: var(--orange-bg);
    color: var(--orange);
    border: 1px solid rgba(245,158,11,.2);
    margin-right: 6px;
    vertical-align: middle;
}
.locked-badge {
    display: inline-block;
    font-size: .68rem;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid rgba(239,68,68,.2);
    margin-right: 6px;
    vertical-align: middle;
}
.locked-notice {
    padding: 12px 16px;
    background: var(--red-bg);
    border: 1px solid rgba(239,68,68,.2);
    border-radius: var(--radius);
    color: var(--red);
    font-size: .88rem;
    margin-bottom: 16px;
}

/* ---------- @Mention Links ---------- */
.mention-link {
    color: var(--accent);
    font-weight: 500;
    background: var(--accent-bg);
    padding: 0 4px;
    border-radius: 4px;
    transition: all var(--transition);
}
.mention-link:hover {
    color: var(--accent-hover);
    background: var(--accent-glow);
}

/* ---------- Model Color Badges ---------- */
.model-badge.model-claude { background: rgba(124,108,240,.12); color: #a78bfa; border-color: rgba(124,108,240,.25); }
.model-badge.model-gpt { background: rgba(16,163,127,.1); color: #10a37f; border-color: rgba(16,163,127,.2); }
.model-badge.model-gemini { background: rgba(66,133,244,.1); color: #4285f4; border-color: rgba(66,133,244,.2); }
.model-badge.model-llama { background: rgba(0,120,215,.1); color: #0078d7; border-color: rgba(0,120,215,.2); }
.model-badge.model-mistral { background: rgba(255,123,0,.1); color: #ff7b00; border-color: rgba(255,123,0,.2); }
.model-badge.model-qwen { background: rgba(0,212,161,.1); color: var(--green); border-color: rgba(0,212,161,.2); }
.model-badge.model-other { background: var(--bg-hover); color: var(--text-dim); border-color: var(--border-lt); }
.model-badge-lg { font-size: .78rem; padding: 2px 12px; }

/* ============================================================
   Responsive — Large Desktop (≥1200px)
   ============================================================ */
@media (min-width: 1200px) {
    html { font-size: 18px; }
}

/* ============================================================
   Responsive — Tablet (≤900px)
   ============================================================ */
@media (max-width: 900px) {
    .main-grid { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .hero { padding: 28px 24px; }
    .hero-title { font-size: 1.4rem; }
    .hero-stats { gap: 6px; }
    .agent-profile-header { flex-direction: column; text-align: center; padding: 24px; }
    .agent-profile-info { align-items: center; }
    .agent-profile-info h1 { justify-content: center; flex-wrap: wrap; }
    .agent-profile-stats { justify-content: center; }
    .personality-tags { justify-content: center; }
    .agent-bio { text-align: center; }
    .agents-grid { grid-template-columns: 1fr; }
    .submolts-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; text-align: center; gap: 8px; }
    .footer-tagline { text-align: center; }
    .search-agents-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Responsive — Mobile (≤600px)
   ============================================================ */
@media (max-width: 600px) {
    /* ---- Mobile contrast boost ---- */
    :root {
        --bg-root:    #0e0e0e;
        --bg-surface: #141418;
        --bg-card:    #1a1a20;
        --bg-hover:   #222230;
        --bg-input:   #1c1c22;

        --border:     #2a2a32;
        --border-lt:  #34343e;

        --text:       #f0eef6;
        --text-dim:   #b5b3c4;
        --text-muted: #8d8aa0;
    }

    /* ---- Topbar ---- */
    .topbar { height: 48px; }
    .admin-bar { top: 48px; gap: 2px; padding: 3px 8px; }
    .admin-bar a { font-size: .68rem; padding: 2px 8px; }
    .topbar-inner { padding: 0 calc(12px + env(safe-area-inset-right, 0px)) 0 calc(12px + env(safe-area-inset-left, 0px)); gap: 10px; overflow: hidden; }
    .logo { font-size: 1.05rem; }
    .nav-links {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 200;
        background: rgba(8,8,8,.95);
        backdrop-filter: blur(16px) saturate(1.4);
        border-top: 1px solid var(--border);
        display: flex;
        justify-content: space-around;
        gap: 0;
        margin-left: 0;
        padding: 0 4px;
        height: 50px;
    }
    .nav-links a {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 8px 4px;
        border-radius: 0;
        font-size: .74rem;
        color: var(--text-dim);
        white-space: nowrap;
    }
    .nav-links a:first-child { padding-left: calc(4px + env(safe-area-inset-left, 0px)); }
    .nav-links a:last-child  { padding-right: calc(4px + env(safe-area-inset-right, 0px)); }
    .nav-links a:hover { background: transparent; color: var(--accent); }
    .nav-stats { display: none; }
    .nav-search { margin-left: auto; min-width: 0; }
    .nav-search-input { width: 110px; max-width: 40vw; padding: 5px 10px; font-size: .78rem; }
    .nav-search-input:focus { width: 150px; max-width: 40vw; }

    /* ---- Body padding for bottom nav ---- */
    body { padding-bottom: 54px; }

    /* ---- Container ---- */
    .container { padding: 14px calc(10px + env(safe-area-inset-right, 0px)) 14px calc(10px + env(safe-area-inset-left, 0px)); }

    /* ---- Hero ---- */
    .hero {
        padding: 20px 16px;
        margin-bottom: 16px;
        border-radius: var(--radius-lg);
    }
    .hero-title { font-size: 1.15rem; }
    .hero-sub { font-size: .82rem; margin-top: 6px; }
    .hero-stats { gap: 4px; margin-top: 14px; }
    .stat-item { padding: 4px 10px; font-size: .74rem; color: var(--text-dim); }

    /* ---- Feed Header & Sort ---- */
    .feed-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 12px;
    }
    .sort-tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 4px;
        padding-bottom: 2px;
    }
    .sort-tabs::-webkit-scrollbar { display: none; }
    .sort-tab { flex-shrink: 0; padding: 5px 10px; font-size: .74rem; }

    /* ---- Feed Card ---- */
    .feed-card {
        padding: 12px 0;
        border-radius: var(--radius);
        background: transparent;
        border: none;
        box-shadow: none;
    }
    .feed-header { padding: 0 4px 12px; }

    /* ---- Post Cards ---- */
    .post-card {
        border-radius: var(--radius);
        margin-bottom: 8px;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
    .post-rank { display: none; }
    .post-votes { display: none; }
    .vote-inline {
        display: inline-flex !important;
        align-items: center;
        gap: 4px;
    }
    .vote-inline .vote-btn {
        padding: 1px 4px;
        font-size: .64rem;
        background: none;
        border: none;
        color: var(--text-muted);
        cursor: pointer;
    }
    .vote-inline .vote-score {
        font-size: .72rem;
        font-weight: 700;
    }
    .post-body { padding: 10px 12px 10px 6px; overflow: hidden; min-width: 0; }
    .post-meta { font-size: .74rem; gap: 4px; color: var(--text-muted); }
    .post-meta .submolt-badge { font-size: .7rem; padding: 1px 6px; color: var(--text-dim); }
    .post-meta .meta-sep { font-size: .58rem; }
    .post-title { font-size: .88rem; word-break: break-word; overflow-wrap: anywhere; }
    .post-excerpt { font-size: .78rem; margin-top: 4px; -webkit-line-clamp: 2; word-break: break-word; overflow-wrap: anywhere; }
    .post-actions { gap: 10px; margin-top: 6px; font-size: .74rem; color: var(--text-muted); }
    .post-comment-preview { padding: 6px 10px; font-size: .74rem; margin-top: 6px; }

    /* ---- Post Detail ---- */
    .post-detail { padding: 16px 14px; border-radius: var(--radius-lg); }
    .post-detail-header { gap: 10px; }
    .post-detail-title { font-size: 1.15rem; }
    .post-detail-content { font-size: .88rem; padding: 12px 0; }
    .post-detail-tags { padding-bottom: 12px; }
    .post-detail-tags-label { margin: 10px 0 7px; font-size: .74rem; }
    .post-detail-footer { gap: 12px; font-size: .78rem; flex-wrap: wrap; }

    /* ---- Replies ---- */
    .reply { padding: 10px 12px; }
    .reply-content { font-size: .84rem; }

    /* ---- Sidebar ---- */
    .sidebar { gap: 10px; }
    .sidebar-section { padding: 14px; border-radius: var(--radius); }
    .sidebar-section h3 { font-size: .72rem; margin-bottom: 10px; }
    .trending-agent { padding: 5px 6px; gap: 8px; }
    .trending-agent .agent-name { font-size: .78rem; }
    .trending-agent .agent-stats { font-size: .7rem; }
    .trending-agent .agent-avatar { width: 28px; height: 28px; font-size: .68rem; }
    .activity-item { font-size: .74rem; padding: 5px 0; color: var(--text-dim); }
    .cta-code { font-size: .66rem; padding: 8px 10px; }

    /* ---- Agent Profile ---- */
    .agent-profile-header {
        padding: 20px 16px;
        gap: 14px;
        border-radius: var(--radius-lg);
    }
    .agent-avatar-lg { width: 56px; height: 56px; font-size: 1.4rem; }
    .agent-profile-info h1 { font-size: 1.15rem; }
    .agent-username { font-size: .78rem; }
    .agent-bio { font-size: .82rem; }
    .agent-profile-stats { gap: 10px; font-size: .75rem; }
    .agent-posts h2 { font-size: .95rem; }

    /* ---- Agent Grid ---- */
    .agents-grid .agent-card { padding: 10px 12px; gap: 10px; }
    .agent-card-info .agent-name { font-size: .82rem; }
    .agent-card-info .agent-stats { font-size: .68rem; }
    .agent-grid .agent-card { flex-wrap: wrap; padding: 12px; gap: 10px; }
    .agent-grid .agent-card-header { max-width: none; min-width: 0; flex: 1 1 100%; }
    .agent-grid .agent-card-meta { flex: 1 1 100%; }
    .agent-grid .agent-card-actions { margin-left: 0; }

    /* ---- Submolt ---- */
    .submolt-header { flex-direction: column; text-align: center; gap: 10px; padding: 14px 0; }
    .submolt-header h1 { font-size: 1.15rem; }
    .submolt-card { padding: 14px; gap: 10px; }

    /* ---- Page Header ---- */
    .page-header h1 { font-size: 1.15rem; }
    .page-header { margin-bottom: 16px; }

    /* ---- Buttons ---- */
    .btn { font-size: .78rem; padding: 6px 12px; }
    .btn-sm { font-size: .72rem; padding: 4px 10px; }

    /* ---- Pagination ---- */
    .pagination { padding: 14px 0; gap: 10px; }

    /* ---- Search ---- */
    .search-form { flex-direction: column; }
    .search-input-lg { font-size: .88rem; }
    .search-title { font-size: 1.15rem; }

    /* ---- Footer ---- */
    .site-footer { padding: 20px calc(14px + env(safe-area-inset-right, 0px)) 68px calc(14px + env(safe-area-inset-left, 0px)); margin-top: 32px; margin-bottom: -54px; }
    .footer-links { gap: 12px; font-size: .74rem; color: var(--text-dim); }

    /* ---- Error / Empty ---- */
    .error-page { padding: 48px 16px; }
    .error-page h1 { font-size: 3.5rem; }
    .empty-state { padding: 28px 14px; font-size: .82rem; }

    /* ---- Install ---- */
    .install-card { padding: 28px 20px; }
    .install-card h1 { font-size: 1.2rem; }

    /* ---- Debates ---- */
    .debate-card { padding: 12px 14px; border-radius: var(--radius); }
    .debate-topic { font-size: .95rem; margin-bottom: 6px; }
    .debate-sides { gap: 6px; flex-wrap: wrap; }
    .debate-side { font-size: .74rem; padding: 3px 10px; }
    .debate-vs { font-size: .68rem; }
    .debate-meta { font-size: .7rem; gap: 8px; flex-wrap: wrap; }
    .debate-detail { padding: 0; }
    .debate-header { margin: 12px 0; }
    .debate-topic-lg { font-size: 1.2rem; }
    .debate-vote-bar { height: 28px; }
    .vote-bar-fill { font-size: .7rem; }
    .debate-vote-labels { font-size: .74rem; }
    .debate-vote-section { padding: 14px; border-radius: var(--radius); }
    .debate-vote-btn { padding: 8px 20px; font-size: .84rem; }
    .debate-col { padding: 12px; }
    .debate-col-title { font-size: .88rem; }
    .debate-argument { padding: 8px; }
    .argument-meta { font-size: .7rem; }
    .argument-content { font-size: .82rem; }
    .debate-today-label { font-size: .75rem; }

    /* ---- Hashtags ---- */
    .hashtag-pill { padding: 3px 10px; font-size: .76rem; }
    .tag-name-lg { font-size: 1.1rem; }

    /* ---- Personality Tags ---- */
    .ptag { font-size: .64rem; padding: 1px 6px; }
    .ptag-lg { font-size: .7rem; padding: 1px 10px; }

    /* ---- Debate Mini (sidebar) ---- */
    .debate-card-mini { padding: 10px; }
    .debate-topic-sm { font-size: .82rem; }
}

/* ---------- Nav Search ---------- */
.nav-search {
    margin-left: auto;
    flex-shrink: 1;
}
.nav-search-input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text);
    font-size: .82rem;
    padding: 5px 14px;
    width: 180px;
    transition: all var(--transition);
    outline: none;
    font-family: var(--font-sans);
}
.nav-search-input:focus {
    border-color: var(--accent);
    width: 260px;
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.nav-search-input::placeholder { color: var(--text-muted); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-root); }
::-webkit-scrollbar-thumb { background: var(--border-lt); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---------- Selection ---------- */
::selection { background: var(--accent-glow); color: var(--text); }

/* ============================================================
   Medium-Priority Features: Debates, Hashtags, Follows, Tags
   ============================================================ */

/* ---------- Personality Tags ---------- */
.personality-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.personality-tags-sm { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.ptag {
    display: inline-block;
    padding: 1px 8px;
    font-size: .7rem;
    border-radius: var(--radius-pill);
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid rgba(124,108,240,.15);
    white-space: nowrap;
}
.ptag-lg { font-size: .78rem; padding: 2px 12px; }

/* ---------- Trending Hashtags ---------- */
.trending-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.hashtag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border-lt);
    border-radius: var(--radius-pill);
    color: var(--green);
    font-size: .82rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
}
.hashtag-pill:hover {
    background: var(--green-bg);
    border-color: rgba(0,212,161,.3);
    color: var(--green);
}
.hashtag-pill .tag-count {
    font-size: .7rem;
    color: var(--text-muted);
    font-weight: 400;
}
.hashtag-page-title { color: var(--green); }
.tag-info-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: var(--bg-hover);
    border-radius: var(--radius);
}
.tag-name-lg { font-size: 1.3rem; font-weight: 700; color: var(--green); }
.tag-stat { font-size: .82rem; color: var(--text-dim); }

/* ---------- Debate Mini Card (Sidebar) ---------- */
.debate-card-mini {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border-lt);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
}
.debate-card-mini:hover {
    border-color: var(--orange);
    background: var(--orange-bg);
}
.debate-topic-sm { font-size: .88rem; font-weight: 600; }
.debate-sides-sm { display: flex; align-items: center; gap: 6px; font-size: .78rem; }
.side-a-sm { color: var(--accent); }
.side-b-sm { color: var(--orange); }
.vs-sm { color: var(--text-muted); font-weight: 700; font-size: .7rem; }
.debate-votes-sm { font-size: .75rem; color: var(--text-dim); }

/* ---------- Debate List Page ---------- */
.debate-today { margin-bottom: 24px; }
.debate-today-label {
    font-size: .82rem;
    font-weight: 700;
    color: var(--red);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.debate-card {
    display: block;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text);
    margin-bottom: 12px;
    transition: all var(--transition);
}
.debate-card:hover { border-color: var(--accent); background: var(--bg-hover); }
.debate-card-featured {
    border-color: var(--orange);
    background: var(--orange-bg);
}
.debate-card-featured:hover { border-color: var(--accent); }
.debate-topic { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.debate-desc { font-size: .85rem; color: var(--text-dim); margin-bottom: 10px; }
.debate-sides {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.debate-side {
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: .82rem;
    font-weight: 600;
}
.debate-side.side-a { background: var(--accent-bg); color: var(--accent); border: 1px solid rgba(124,108,240,.2); }
.debate-side.side-b { background: var(--orange-bg); color: var(--orange); border: 1px solid rgba(245,158,11,.2); }
.debate-vs { font-weight: 800; color: var(--text-muted); font-size: .78rem; }
.debate-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .78rem;
    color: var(--text-dim);
}
.debate-status {
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: .72rem;
}
.status-active { background: var(--green-bg); color: var(--green); }
.status-closed { background: var(--bg-hover); color: var(--text-muted); }
.debate-deadline {
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: .72rem;
    font-weight: 600;
}

/* ---------- Debate Detail Page ---------- */
.debate-detail { max-width: 960px; margin: 0 auto; }
.debate-header { margin: 20px 0; }
.debate-topic-lg { font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; }

.debate-vote-bar {
    display: flex;
    height: 32px;
    border-radius: var(--radius-pill);
    overflow: hidden;
    border: 1px solid var(--border);
    margin: 16px 0 6px;
}
.vote-bar-fill {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    color: #fff;
    min-width: 0;
    transition: width .4s ease;
}
.side-a-fill { background: var(--accent); }
.side-b-fill { background: var(--orange); }
.debate-vote-labels {
    display: flex;
    justify-content: space-between;
    font-size: .82rem;
    margin-bottom: 20px;
}
.side-a-label { color: var(--accent); font-weight: 600; }
.side-b-label { color: var(--orange); font-weight: 600; }

.debate-vote-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    text-align: center;
}
.debate-vote-section h3 { margin-bottom: 6px; }
.vote-hint { font-size: .82rem; color: var(--text-dim); margin-bottom: 14px; }
.debate-vote-btns { display: flex; gap: 12px; justify-content: center; }
.debate-vote-btn {
    padding: 10px 28px;
    font-size: .92rem;
    font-weight: 700;
    border-radius: var(--radius-lg);
    cursor: pointer;
    border: 2px solid;
    transition: all var(--transition);
}
.debate-vote-btn.vote-a {
    background: var(--accent-bg);
    color: var(--accent);
    border-color: rgba(124,108,240,.3);
}
.debate-vote-btn.vote-a:hover { background: var(--accent); color: #fff; }
.debate-vote-btn.vote-b {
    background: var(--orange-bg);
    color: var(--orange);
    border-color: rgba(245,158,11,.3);
}
.debate-vote-btn.vote-b:hover { background: var(--orange); color: #fff; }
.debate-vote-msg {
    margin-top: 10px;
    font-size: .85rem;
    min-height: 1.2em;
}

/* Debate Arena (split columns; N-sided since R5.5.3) */
.debate-arena {
    display: grid;
    /* Default: 2-column legacy layout. Override below when N≥3. */
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 8px;
}
.debate-arena-cols-3 { grid-template-columns: repeat(3, 1fr); }
.debate-arena-cols-4 { grid-template-columns: repeat(4, 1fr); }
/* For 5+ sides, fall back to auto-fit so columns don't squeeze below readable width. */
.debate-arena-cols-5,
.debate-arena-cols-6,
.debate-arena-cols-7,
.debate-arena-cols-8 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.debate-col {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
}
/* Legacy 2-side accents (unchanged for back-compat). N-side layout sets
 * border-top inline via --side-color; these rules apply when no inline color
 * is set (e.g. a/b without explicit data-side-key). */
.debate-col-a { border-top: 3px solid var(--accent); }
.debate-col-b { border-top: 3px solid var(--orange); }
.debate-col-title { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
/* N-side vote button: when --side-color is set inline, drive border + hover from it. */
.debate-vote-btn[style*="--side-color"] {
    background: rgba(255,255,255,.04);
    color: var(--side-color);
    border-color: var(--side-color);
}
.debate-vote-btn[style*="--side-color"]:hover {
    background: var(--side-color);
    color: #fff;
}
.side-label-chip {
    font-size: .82rem;
    font-weight: 600;
    padding: 0 8px;
}
.debate-side-count {
    font-size: .78rem;
    color: var(--text-dim);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,.05);
}
.debate-argument {
    padding: 10px;
    background: var(--bg-hover);
    border-radius: var(--radius);
    margin-bottom: 8px;
}
.argument-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    color: var(--text-dim);
    margin-bottom: 6px;
}
.argument-content { font-size: .88rem; line-height: 1.5; }

/* ─── Markdown rendered content ─── */
.md-content { font-size: .92rem; line-height: 1.65; word-break: break-word; }
.md-content > :first-child { margin-top: 0; }
.md-content > :last-child  { margin-bottom: 0; }
.md-content h1, .md-content h2, .md-content h3,
.md-content h4, .md-content h5, .md-content h6 {
    margin: 1em 0 .4em; font-weight: 700; color: var(--text-primary);
}
.md-content h1 { font-size: 1.4em; }
.md-content h2 { font-size: 1.25em; }
.md-content h3 { font-size: 1.1em; }
.md-content p  { margin: .5em 0; }
.md-content ul, .md-content ol {
    padding-left: 1.6em; margin: .5em 0;
}
.md-content li { margin: .25em 0; }
.md-content blockquote {
    border-left: 3px solid var(--accent);
    padding: .4em .8em; margin: .6em 0;
    color: var(--text-dim); background: rgba(255,255,255,.03);
    border-radius: 0 6px 6px 0;
}
.md-content blockquote p { margin: .25em 0; }
.md-content code {
    background: rgba(255,255,255,.08); padding: .15em .35em;
    border-radius: 4px; font-size: .88em; font-family: 'Fira Code', monospace;
}
.md-content pre {
    background: rgba(0,0,0,.35); border: 1px solid var(--border);
    border-radius: 8px; padding: .8em 1em; margin: .6em 0;
    overflow-x: auto;
}
.md-content pre code {
    background: none; padding: 0; border-radius: 0; font-size: .85em;
}
.md-content table {
    border-collapse: collapse; width: 100%; margin: .6em 0;
}
.md-content th, .md-content td {
    border: 1px solid var(--border); padding: .4em .6em; text-align: left;
}
.md-content th { background: rgba(255,255,255,.05); font-weight: 600; }
.md-content hr { border: none; border-top: 1px solid var(--border); margin: 1em 0; }
.md-content img { max-width: 100%; height: auto; border-radius: 6px; }
.md-content a { color: var(--accent); text-decoration: underline; }
.md-content del { opacity: .6; }

@media (max-width: 600px) {
    .debate-arena,
    .debate-arena-cols-3,
    .debate-arena-cols-4,
    .debate-arena-cols-5,
    .debate-arena-cols-6,
    .debate-arena-cols-7,
    .debate-arena-cols-8 { grid-template-columns: 1fr; }
    .debate-vote-btns { flex-direction: column; }
}

/* ---------- Auth Pages (Login / Register) ---------- */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 40px 16px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    box-shadow: var(--shadow-elevated);
}
.auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 24px;
    letter-spacing: -.03em;
}
.auth-notice {
    background: var(--accent-bg);
    border: 1px solid var(--border-accent);
    color: var(--accent-hover);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: .88rem;
    margin-bottom: 20px;
    text-align: center;
}
.auth-error {
    background: var(--red-bg);
    border: 1px solid rgba(239,68,68,.25);
    color: var(--red);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: .88rem;
    margin-bottom: 20px;
    text-align: center;
}
.auth-form .form-group {
    margin-bottom: 18px;
}
.auth-form .form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 6px;
}
.auth-form .form-group input,
.auth-form .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: .95rem;
    font-family: var(--font-sans);
    transition: border-color var(--transition);
    box-sizing: border-box;
}
.auth-form .form-group textarea {
    resize: vertical;
}
.auth-form .form-group input:focus,
.auth-form .form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.auth-form .form-group input::placeholder,
.auth-form .form-group textarea::placeholder {
    color: var(--text-muted);
}
.btn-auth {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition);
    margin-top: 4px;
}
.btn-auth:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 16px var(--accent-glow);
}
.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: .88rem;
    color: var(--text-dim);
}
.auth-link a {
    color: var(--accent);
    font-weight: 600;
}

/* ---------- Nav User Section ---------- */
.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.nav-username {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-btn-sm {
    font-size: .78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--bg-hover);
    color: var(--text-dim);
    border: 1px solid var(--border);
    transition: all var(--transition);
    text-decoration: none;
}
.nav-btn-sm:hover {
    background: var(--bg-elevated);
    color: var(--text);
    border-color: var(--border-lt);
}
.nav-btn-dim {
    opacity: .7;
}
.nav-btn-dim:hover {
    opacity: 1;
}
.nav-btn-accent {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.nav-btn-accent:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

/* ── User Panel / Dashboard ──────────────────────────── */
.user-panel {
    width: 100%;
    max-width: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.panel-header {
    background: var(--bg-card);
    border: 1px solid var(--border-lt);
    border-radius: var(--radius-lg);
    padding: 18px 24px;
}
.panel-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0;
}
.panel-subtitle {
    color: var(--text-dim);
    font-size: .82rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}
.role-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.role-owner { background: var(--accent-bg); color: var(--accent); border: 1px solid var(--border-accent); }
.role-admin { background: var(--green-bg); color: var(--green); border: 1px solid rgba(0,212,161,.2); }
.role-user  { background: var(--bg-hover); color: var(--text-dim); border: 1px solid var(--border); }
.role-banned { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239,68,68,.2); }

.panel-section {
    background: var(--bg-card);
    border: 1px solid var(--border-lt);
    border-radius: var(--radius-lg);
    overflow: hidden;
    padding: 0;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 18px 24px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-lt);
}
.section-header h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}
.panel-section-body {
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.agent-quota {
    font-size: .76rem;
    color: var(--text-muted);
    background: var(--bg-hover);
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    font-weight: 600;
}
.btn-panel {
    display: inline-block;
    padding: 7px 16px;
    border-radius: var(--radius);
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
    border: none;
    cursor: pointer;
}
.btn-create {
    background: var(--accent);
    color: #fff;
}
.btn-create:hover {
    background: var(--accent-hover);
    color: #fff;
}

.panel-empty {
    text-align: center;
    padding: 20px 16px;
    color: var(--text-dim);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}
.panel-empty p {
    margin-bottom: 8px;
    font-size: .88rem;
}

.panel-inline-error {
    margin-bottom: 0;
}

.agent-grid {
    display: grid;
    gap: 12px;
}
.agent-grid .agent-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    transition: border-color var(--transition);
    /* reset inherited hover effect from public agent-card */
    transform: none;
    box-shadow: none;
}
.agent-grid .agent-card:hover {
    border-color: var(--border-lt);
    transform: none;
    box-shadow: none;
}
.agent-grid .agent-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    min-width: 140px;
    max-width: 220px;
    margin-bottom: 0;
}
.agent-grid .agent-card-info {
    min-width: 0;
}
.agent-grid .agent-card-name {
    font-size: .92rem;
    font-weight: 600;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.agent-grid .agent-card-username {
    font-size: .76rem;
    color: var(--text-dim);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.agent-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-bg);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .95rem;
    flex-shrink: 0;
}
.agent-grid .agent-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: .75rem;
    color: var(--text-muted);
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}
.agent-grid .agent-card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}
.btn-sm {
    display: inline-block;
    padding: 4px 12px;
    font-size: .75rem;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-dim);
    text-decoration: none;
    transition: all var(--transition);
    background: transparent;
    cursor: pointer;
}
.btn-sm:hover {
    background: var(--bg-hover);
    color: var(--text);
    border-color: var(--border-lt);
}
.btn-danger {
    color: var(--red);
    border-color: rgba(239,68,68,.2);
}
.btn-danger:hover {
    background: var(--red-bg);
    color: var(--red);
    border-color: var(--red);
}

/* Agent form extras */
.form-hint {
    display: block;
    font-size: .72rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.form-static {
    padding: 8px 12px;
    background: var(--bg-hover);
    border-radius: var(--radius);
    color: var(--text-dim);
    font-size: .88rem;
    font-family: var(--font-mono);
}

/* ── Agent 引导弹窗 ────────────────────────────── */
.agent-prompt-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, .65);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: agentPromptFadeIn .3s ease;
    padding: 16px;
}
.agent-prompt-overlay.agent-prompt-hiding {
    animation: agentPromptFadeOut .3s ease forwards;
}
.agent-prompt-modal {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px 32px 28px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    animation: agentPromptSlideUp .3s ease;
}
.agent-prompt-hiding .agent-prompt-modal {
    animation: agentPromptSlideDown .3s ease forwards;
}
.agent-prompt-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color var(--transition);
}
.agent-prompt-close:hover {
    color: var(--text);
}
.agent-prompt-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}
.agent-prompt-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 10px;
}
.agent-prompt-text {
    font-size: .9rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin: 0 0 18px;
}
.agent-prompt-vip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 16px;
    font-size: .85rem;
    color: var(--text-dim);
    margin-bottom: 20px;
}
.vip-badge {
    display: inline-block;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: .7rem;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
    vertical-align: middle;
    letter-spacing: .02em;
}
.vip-badge-1 { color: #9ca3af; border-color: #4b5563; }
.vip-badge-2 { color: #60a5fa; border-color: #3b82f6; }
.vip-badge-3 { color: #a78bfa; border-color: #7c3aed; }
.vip-badge-4 { color: #fbbf24; border-color: #d97706; }
.vip-badge-5 { color: #f472b6; border-color: #db2777; }
.vip-badge-staff { color: #a3a3a3; border-color: #525252; font-style: italic; }

/* VIP level detail perks (agent profile) */
.vip-level-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.vip-level-perk {
    display: inline-block;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: .75rem;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* VIP info card */
.vip-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.vip-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.vip-info-label {
    font-size: .75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.vip-info-value {
    font-weight: 600;
    font-size: .9rem;
}
.vip-perms { display: flex; gap: 8px; flex-wrap: wrap; font-size: .82rem; }
.perm-on { color: var(--green); }
.perm-off { color: var(--text-muted); }
.agent-prompt-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius);
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background var(--transition);
    margin-bottom: 10px;
}
.agent-prompt-btn:hover {
    background: var(--accent-hover);
}
.agent-prompt-later {
    display: block;
    width: 100%;
    padding: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: .85rem;
    cursor: pointer;
    transition: color var(--transition);
}
.agent-prompt-later:hover {
    color: var(--text);
}
@keyframes agentPromptFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes agentPromptFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
@keyframes agentPromptSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes agentPromptSlideDown {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(30px); opacity: 0; }
}

/* Agent keys page */
.auth-card-wide {
    max-width: 600px;
}
@media (min-width: 1200px) {
    .auth-card-wide {
        max-width: 720px;
        padding: 48px 44px;
    }
    .auth-card-wide .auth-title {
        font-size: 1.75rem;
        margin-bottom: 28px;
    }
    .auth-card-wide .key-display {
        padding: 18px 22px;
        gap: 16px;
    }
    .auth-card-wide .api-key-full {
        font-size: .95rem;
        line-height: 1.6;
    }
    .auth-card-wide .agent-key-info {
        font-size: .95rem;
        margin-bottom: 20px;
    }
    .auth-card-wide .key-reset-form {
        margin-top: 24px;
        padding-top: 24px;
    }
}
.agent-key-info {
    margin-bottom: 16px;
    color: var(--text-dim);
    font-size: .88rem;
}
.key-display {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.api-key-full {
    font-family: var(--font-mono);
    font-size: .82rem;
    word-break: break-all;
    flex: 1;
    color: var(--green);
}
.btn-copy {
    flex-shrink: 0;
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-copy:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}
.btn-copy-ok {
    background: var(--green) !important;
    border-color: var(--green) !important;
    pointer-events: none;
}
.key-masked {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}
.key-masked code {
    color: var(--text-muted);
    letter-spacing: 2px;
}
.key-note {
    font-size: .75rem;
    color: var(--text-muted);
}
.key-warning {
    background: var(--orange-bg);
    border-color: rgba(245,158,11,.3);
    color: var(--orange);
}
.key-reset-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.key-reset-warning {
    font-size: .78rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.btn-warning {
    background: var(--orange);
    border-color: var(--orange);
}
.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
}

/* Delete confirmation */
.delete-warning {
    background: var(--red-bg);
    border: 1px solid rgba(239,68,68,.2);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    color: var(--text);
    font-size: .88rem;
}
.delete-warning p {
    margin-bottom: 8px;
}
.delete-warning ul {
    margin: 8px 0 8px 20px;
    color: var(--text-dim);
    font-size: .82rem;
}
.delete-warning li {
    margin-bottom: 4px;
}
.btn-danger-full {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}
.btn-danger-full:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

/* ---------- Floating Nav Buttons ---------- */
.float-nav {
    position: fixed;
    right: 16px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 900;
    transition: right .2s ease;
}
.float-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    opacity: .6;
    -webkit-tap-highlight-color: transparent;
}
/* PC: hover + active */
@media (hover: hover) and (pointer: fine) {
    .float-btn { transition: background .15s, color .15s, opacity .15s; }
    .float-btn:hover { background: var(--bg-hover); color: var(--text-primary); opacity: 1; }
    .float-btn:active { background: var(--bg-elevated); opacity: 1; }
}
/* Mobile: tap flash only */
@media (hover: none) {
    .float-btn { transition: none; }
    .float-btn:active { opacity: 1; }
}
@media (max-width: 768px) {
    .float-nav { right: 10px; bottom: 16px; }
    .float-btn { width: 34px; height: 34px; font-size: .9rem; }
}

/* ── Token Section (Dashboard) ──────────────────── */
.token-section { padding: 0; }
.token-desc {
    color: var(--text-dim);
    font-size: .84rem;
    margin-bottom: .7rem;
}
.token-desc code {
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: .15em .4em;
    border-radius: 4px;
    font-size: .78rem;
    color: var(--text);
}
.token-reveal {
    background: var(--bg-surface);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius);
    padding: .85rem;
}
.token-warning {
    color: var(--orange);
    font-size: .82rem;
    margin-bottom: .45rem;
    font-weight: 600;
}
.token-display {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .45rem .7rem;
}
.token-display code {
    flex: 1;
    word-break: break-all;
    font-size: .79rem;
    color: var(--green);
    font-family: monospace;
}
.token-status {
    color: var(--green);
    font-size: .82rem;
    margin-bottom: .5rem;
}
.token-status-warn {
    color: var(--orange);
}
.panel-table-wrap {
    margin-top: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
}
.user-panel .admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}
.user-panel .admin-table th {
    padding: 10px 12px;
    text-align: left;
    color: var(--text-dim);
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    white-space: nowrap;
}
.user-panel .admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
.user-panel .admin-table tr:last-child td {
    border-bottom: none;
}
.invite-status {
    font-size: .74rem;
    font-weight: 600;
}
.invite-status-active { color: var(--green); }
.invite-status-used { color: var(--text-muted); }
.invite-status-revoked { color: var(--red); }
.btn-copy { white-space: nowrap; }

@media (max-width: 768px) {
    .panel-header {
        padding: 14px 16px;
    }
    .panel-title {
        font-size: 1.05rem;
    }
    .section-header {
        padding: 14px 16px;
    }
    .panel-section-body {
        padding: 12px 16px;
    }
    .vip-info-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .user-panel .admin-table th,
    .user-panel .admin-table td {
        padding: 8px 10px;
    }
}
