/* 1Data — base style */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0a0a0f;
    --text: #e0e0e8;
    --text-muted: #888;
    --primary: #00e5a0;
    --primary-dim: #008f6b;
    --card-bg: #12121a;
    --border: #222;
    --radius: 8px;
    --accent: #4a9eff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Nav */
.navbar { border-bottom: 1px solid var(--border); padding: 16px 0; }
.navbar .container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-weight: 800; font-size: 1.4rem; text-decoration: none; color: var(--primary); }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.95rem; }
.nav-links a:hover { color: var(--text); }

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: #000;
    padding: 8px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
}
.btn-primary:hover { background: var(--primary-dim); }
.btn-secondary {
    background: transparent;
    color: var(--text);
    padding: 8px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-decoration: none;
}
.btn-secondary:hover { border-color: var(--text-muted); }
.btn-large { padding: 12px 32px; font-size: 1.1rem; }
button[type="submit"], .btn-submit {
    background: var(--primary); color:#000; border:none;
    padding:10px 24px; border-radius:6px;
    font-weight:600; cursor:pointer; font-size:.9rem;
    transition:opacity .15s;
}
button[type="submit"]:hover { opacity:.85; }

/* Hero */
.hero { padding: 100px 0 80px; text-align: center; }
.hero h1 { font-size: 3rem; font-weight: 800; margin-bottom: 16px; }
.hero .subtitle { font-size: 1.2rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 40px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; }

/* Features grid */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}
.card h3 { margin-bottom: 12px; color: var(--primary); }
.card p { color: var(--text-muted); font-size: 0.95rem; }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 24px 0; margin-top: 80px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

/* Login page */
.login-page { padding: 80px 0; display: flex; justify-content: center; }
.login-box { max-width: 420px; width: 100%; text-align: center; padding: 48px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; }
.login-box h1 { margin-bottom: 8px; }
.login-box .text-muted { margin-bottom: 32px; }
.btn-google {
    display: inline-flex; align-items: center; gap: 12px;
    background: #fff; color: #333; padding: 12px 28px;
    border-radius: var(--radius); font-weight: 600; font-size: 1rem;
    text-decoration: none; transition: all .2s;
}
.btn-google:hover { background: #f0f0f0; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }

/* Node page */
.node-page { padding: 48px 0; }
.node-title { font-size: 2rem; margin-bottom: 24px; }
.node-content { line-height: 1.8; color: var(--text); }
.node-content h2 { margin: 32px 0 16px; }
.node-content h3 { margin: 24px 0 12px; }
.node-content p { margin-bottom: 16px; color: var(--text-muted); }
.node-content li { margin-bottom: 8px; color: var(--text-muted); }
.node-content blockquote { border-left: 3px solid var(--primary); padding-left: 16px; margin: 16px 0; color: var(--text-muted); font-style: italic; }
.node-content ul { margin-bottom: 16px; }

/* Error */
.error-page { text-align: center; padding: 100px 0; }
.error-page h1 { font-size: 5rem; color: var(--primary); }
.error-page a { color: var(--primary); }

/* === Dashboard & Sidebar Theme (layout override) === */
.page-content {
    max-width:800px; width:100%;
    margin:0 auto; padding:32px 24px;
}
.page-content h1 { font-size:1.5rem; margin-bottom:16px; }
.page-content h2 { font-size:1.2rem; margin:20px 0 10px; }

/* Form styles */
.form-doflow { margin:16px 0; }
.flow-form { margin-bottom:12px; }
.flow-form input[type="text"],
.flow-form textarea,
.flow-form input[type="url"] {
    width:100%; padding:10px 12px;
    background:var(--card-bg); color:var(--text);
    border:1px solid var(--border); border-radius:8px;
    font-family:inherit; font-size:.95rem;
    outline:none; transition:border-color .15s;
}
.flow-form textarea { resize:vertical; min-height:80px; }
.flow-form input:focus, .flow-form textarea:focus { border-color:var(--primary); }
.flow-form label { display:flex; align-items:center; gap:8px; font-size:.9rem; color:var(--text-muted); cursor:pointer; }

/* Dashboard charts */
.qb{display:flex;align-items:center;margin-bottom:6px;gap:8px}
.ql{width:70px;font-size:.78rem;color:var(--text-muted);text-align:right}
.qt{flex:1;height:16px;background:#1a1a28;border-radius:4px;overflow:hidden}
.qf{height:100%;border-radius:4px;transition:width .3s}
.qv{width:26px;text-align:right;font-size:.78rem;font-weight:600}
.fill-good{background:#00e5a0}.fill-mid{background:#f0ad4e}.fill-bad{background:#e74c3c}
.dg{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.dc{background:var(--card-bg);border:1px solid var(--border);border-radius:var(--radius);padding:24px}
.dc h3{font-size:1rem;margin-bottom:12px}
.dff{grid-column:1/-1}
.fi{padding:8px;border-left:2px solid var(--primary-dim);margin-bottom:4px}
.fa{font-size:.88rem;font-weight:600}.fm{font-size:.76rem;color:var(--text-muted)}
.txm{font-size:.85rem;color:var(--text-muted)}
.btn-o{display:inline-block;padding:6px 14px;border:1px solid var(--primary);border-radius:6px;color:var(--primary);text-decoration:none;font-size:.85rem;margin-top:8px}
.btn-o:hover{background:var(--primary);color:#000}

/* Thinking / Soul form */
.form-group{margin-bottom:14px}
.form-group label{display:block;font-size:.85rem;color:var(--text-muted);margin-bottom:4px}
.form-input{width:100%;padding:10px 12px;background:var(--card-bg);border:1px solid var(--border);border-radius:6px;color:var(--text);font-size:.9rem;outline:none;transition:border-color .2s;box-sizing:border-box}
.form-input:focus{border-color:var(--primary)}
.form-textarea{min-height:80px;resize:vertical}
.form-msg{margin-top:8px;font-size:.85rem}
.form-msg.ok{color:var(--primary)}

/* Group styles */
.group-list {
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(320px,1fr));
    gap:16px;
    margin-top:20px;
}
.group-card {
    background:var(--card-bg);
    border:1px solid var(--border);
    border-radius:10px;
    padding:16px;
    transition:border-color 0.2s,box-shadow 0.2s;
}
.group-card:hover {
    border-color:var(--primary);
    box-shadow:0 2px 12px rgba(0,0,0,0.15);
}
.group-info {
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:6px;
}
.group-name {
    font-weight:600;
    font-size:.95rem;
    text-decoration:none;
    color:var(--text);
}
.group-name:hover {
    color:var(--primary);
}
.group-role {
    font-size:.75rem;
    background:#2a2a3a;
    color:var(--text-muted);
    padding:2px 8px;
    border-radius:10px;
}
.group-public {
    font-size:.75rem;
    background:#0a3a1a;
    color:var(--primary-dim);
    padding:2px 8px;
    border-radius:10px;
}
.group-count {
    font-size:.8rem;
    color:var(--text-muted);
    margin-right:10px;
}
.group-owner {
    font-size:.8rem;
    color:var(--text-muted);
}
.group-tags {
    margin-top:10px;
    display:flex;
    flex-wrap:wrap;
    gap:6px;
}
.group-tags .tag {
    font-size:.72rem;
    color:var(--primary);
    background:rgba(0,212,170,0.08);
    padding:3px 10px;
    border-radius:12px;
    border:1px solid rgba(0,212,170,0.2);
    transition:background 0.15s;
}
.group-tags .tag:hover {
    background:rgba(0,212,170,0.15);
}

/* Group render */
.group-header { margin-bottom: 20px; }
.group-header h1 { margin: 0 0 8px 0; }
.group-desc { color: var(--text-muted); }
.group-meta { display: flex; gap: 16px; font-size: 0.85em; color: var(--text-muted); }
.msg-info { background: #0a1a2a; border: 1px solid #1a3a5a; padding: 10px; border-radius: 8px; margin: 12px 0; color: var(--text); }
.msg-success { background: #0a2a1a; border: 1px solid #0a4a2a; padding: 12px; border-radius: 8px; margin-bottom: 16px; }
.msg-error { background: #2a0a0a; border: 1px solid #4a1a1a; padding: 12px; border-radius: 8px; margin-bottom: 16px; }
.group-members { margin: 16px 0; }
.member-list { display: flex; flex-direction: column; gap: 4px; }
.member-card { padding: 6px 0; display: flex; align-items: center; gap: 8px; }
.member-name { font-weight: 500; }
.member-role { font-size: 0.8em; background: #2a2a3a; padding: 2px 8px; border-radius: 10px; }
.kick-btn { font-size: 0.75em; padding: 2px 8px; background: #4a1a1a; color: var(--text); border: none; border-radius: 4px; cursor: pointer; }
.group-flows { margin-top: 16px; }
.flow-list { margin-top: 8px; }
.flow-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.flow-meta { display: flex; justify-content: space-between; font-size: 0.85em; margin-bottom: 4px; }
.flow-content { color: var(--text); }
.flow-time { color: var(--text-muted); }
.section-title { font-size:1rem; margin:16px 0 8px; }

/* Flow pages (doflow, thinking list) */
.flow-row{padding:12px;border:1px solid var(--border);border-radius:8px;margin-bottom:8px;background:var(--card-bg)}
.flow-title{font-size:.88rem;font-weight:500;line-height:1.5}
.flow-meta{font-size:.76rem;color:var(--text-muted);margin-top:4px}

/* Reports */
.ri{padding:8px;border:1px solid var(--border);border-radius:6px;margin-bottom:4px}
.rt{font-size:.88rem;font-weight:600}.rd{font-size:.76rem;color:var(--text-muted)}

/* Responsive */
@media (max-width: 768px) {
    .grid-3 { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2rem; }
    .hero-actions { flex-direction: column; align-items: center; }
    .page-content { padding:16px 12px; }
    .dg { grid-template-columns:1fr; }
}

/* Upload button */
.upload-btn {
    display:inline-block;
    padding:10px 18px;
    background:var(--card-bg);
    color:var(--text);
    border:1px solid var(--border);
    border-radius:6px;
    cursor:pointer;
    font-size:.9rem;
    transition:border-color .2s;
}
.upload-btn:hover { border-color:var(--primary); }

/* Flow stream rows */
.fl-row{display:flex;gap:8px;padding:8px;border-bottom:1px solid var(--border)}
.fl-tag{font-size:1rem;min-width:20px}
.fl-body{flex:1}
.fl-action{font-size:.88rem;font-weight:500}
.fl-meta{display:flex;gap:12px;font-size:.76rem;color:var(--text-muted)}
.fl-time{color:var(--text-muted)}

/* Mobile hamburger */
.mobile-hamburger {
    display: none;
}
@media (max-width: 768px) {
    .mobile-hamburger {
        display: flex !important;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 998;
        background: #14142a;
        border: 1px solid #2a2a44;
        color: #e0e0f0;
        font-size: 1.4rem;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        cursor: pointer;
        align-items: center;
        justify-content: center;
    }
}

/* Mobile hamburger */
.mobile-hamburger { display:none; }
@media (max-width: 768px) {
    .mobile-hamburger {
        display:flex !important;
        position:fixed; top:10px; left:10px; z-index:998;
        background:#14142a; border:1px solid #2a2a44;
        color:#e0e0f0; font-size:1.4rem;
        width:40px; height:40px;
        border-radius:8px; cursor:pointer;
        align-items:center; justify-content:center;
    }
}

/* Group: compact members */
.group-members-compact { padding:4px 0 12px; display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.member-count { font-size:.8rem; color:var(--text-muted); margin-right:4px; }
.member-chip { font-size:.8rem; background:var(--surface); padding:3px 10px; border-radius:12px; color:var(--text-muted); }

/* Group: flow list */
.group-flows { padding-bottom:100px; }
.group-flows .flow-item { padding:12px 0; border-bottom:1px solid var(--border); }
.group-flows .flow-item:last-child { border-bottom:none; }
.group-flows .flow-meta { display:flex; gap:8px; align-items:center; margin-bottom:4px; font-size:.85rem; }

/* Author avatar trong flow */
.flow-author-avatar { display:inline-flex; flex-shrink:0; }
.flow-author-avatar img { width:24px; height:24px; border-radius:50%; object-fit:cover; }
.flow-author-avatar.sm img { width:20px; height:20px; }
.flow-meta .flow-author-avatar + a { text-decoration:none; color:var(--text); }
.flow-meta .flow-author-avatar + a:hover { text-decoration:underline; }
.reply-item .flow-author-avatar.sm + a { text-decoration:none; color:var(--text); }
.reply-item .flow-author-avatar.sm + a:hover { text-decoration:underline; }
.group-flows .flow-time { color:var(--text-muted); font-size:.8rem; }
.group-flows .flow-content { font-size:.9rem; line-height:1.5; }

/* Group: action type selector (Gemini-style dropdown) */
.group-tools-left,
.group-tools-right { display:flex; align-items:center; gap:8px; }
.group-action-select {
    position:relative;
    display:inline-flex; align-items:center; gap:4px;
    padding:6px 12px; border-radius:18px;
    font-size:.82rem; cursor:pointer; user-select:none;
    background:var(--surface); color:var(--text-muted);
    border:1px solid var(--border); transition:all .15s;
}
.group-action-select:hover { border-color:var(--primary); color:var(--text); }
/* Markdown mini buttons */
.md-btn {
    width:26px; height:26px;
    display:flex; align-items:center; justify-content:center;
    background:transparent; border:1px solid var(--border); border-radius:4px;
    color:var(--text-muted); cursor:pointer; font-size:.72rem;
    font-weight:600; transition:all .1s;
}
.md-btn:hover { color:var(--text); border-color:var(--primary); }
.action-arrow { font-size:.6rem; margin-left:2px; opacity:.6; }
.action-dropdown {
    display:none; position:absolute; bottom:calc(100% + 8px); left:0;
    background:var(--surface); border:1px solid var(--border); border-radius:12px;
    padding:4px; z-index:200; min-width:180px;
    box-shadow:0 4px 16px rgba(0,0,0,.3);
}
.action-dropdown.show { display:block; }
.action-option {
    display:flex; align-items:center; gap:6px;
    padding:8px 12px; border-radius:8px; cursor:pointer;
    font-size:.82rem; color:var(--text); transition:background .1s;
}
.action-option:hover { background:var(--border); }
.action-option.active { background:var(--primary); color:#000; font-weight:600; }
.group-input-tools {display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding: 0px 10px 10px 10px;
    box-sizing: border-box;}
/* Group: fixed input bar */
.group-input-bar {
    position:fixed; bottom:0; left:220px; right:0px;
    background:var(--bg);
    border-top:0px solid var(--border);
    padding:8px 16px 12px;
    z-index:100;
}
.sidebar.collapsed ~ .main .group-input-bar,
.sidebar.collapsed + .mobile-hamburger + .main .group-input-bar,
body:has(.sidebar.collapsed) .group-input-bar { left:56px; }
.group-input-form { max-width:768px; margin:0 auto; border: 1px solid #343131; border-radius: 15px;}
.group-input-row { display:flex; gap:8px; align-items:flex-end; }
.group-input-wrap { position:relative; flex:1; }
.group-input {
    width:100%;
    padding:14px 44px 14px 18px;
    background:var(--surface); color:var(--text);
    border:1px solid var(--border); border-radius:24px;
    font-family:inherit; font-size:.95rem;
    resize:none;
    outline:none;
    min-height:52px; max-height:200px;
    line-height:1.5;
    overflow-y:auto;
    scrollbar-width:thin;
    scrollbar-color:var(--border) transparent;
    box-shadow:0 1px 3px rgba(0,0,0,.08);
    transition:border-color .2s, box-shadow .2s;
    border: none;
    background: #0f0f19;

}
.group-input::-webkit-scrollbar { width:4px; }
.group-input::-webkit-scrollbar-track { background:transparent; }
.group-input::-webkit-scrollbar-thumb { background:var(--border); border-radius:2px; }
.group-input:focus { border-color:var(--primary); box-shadow:0 1px 8px rgba(0,229,160,.15); outline: none;box-shadow: none;}
/* Expanded mode — full textarea */
.group-input.expanded { min-height:50vh; max-height:70vh; border-radius:12px; scrollbar-width:auto; }
.group-input.expanded::-webkit-scrollbar { width:6px; }
.group-input.expanded::-webkit-scrollbar-thumb { background:var(--text-muted); border-radius:3px; }

.group-attach {
    display:flex; align-items:center; justify-content:center;
    width:40px; height:40px; border-radius:50%;
    background:var(--surface);
    cursor:pointer; font-size:1.1rem; flex-shrink:0;
    transition:background .15s;
    border:1px solid var(--border);
}
.group-attach:hover { background:var(--border); }
.group-send {
    background:var(--primary); color:#000; border:none;
    width:40px; height:40px; border-radius:50%;
    font-weight:600; cursor:pointer; font-size:1.1rem;
    flex-shrink:0; display:flex; align-items:center; justify-content:center;
    padding:0;
    transition:opacity .15s;
}
.group-send:hover { opacity:.85; }
.group-file-name { font-size:.8rem; color:var(--text-muted); padding:2px 0; }
.group-expand-btn {
    display:flex; align-items:center; justify-content:center;
    width:32px; height:32px;
    border:1px solid var(--border); background:var(--surface);
    color:var(--text-muted); cursor:pointer;
    font-size:.85rem; border-radius:50%;
    opacity:.6; flex-shrink:0;
    transition:opacity .15s,background .15s;
}
.group-expand-btn:hover { opacity:1; background:var(--border); }

/* Mobile: input bar left padding */
@media (max-width:768px) {
    .group-input-bar { left:0; padding-bottom:calc(12px + env(safe-area-inset-bottom,0px)); }
    .group-flows { padding-bottom:80px; }
}

/* Flow metadata chips (files, links) */
.flow-meta-attach { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; align-items:start; }
.file-thumb { max-width:160px; max-height:120px; border-radius:6px; object-fit:cover; border:1px solid var(--border,#ddd); cursor:pointer; transition:transform .15s; }
.file-thumb:hover { transform:scale(1.05); }
.meta-img-wrap { display:inline-block; line-height:0; }
.meta-chip { font-size:.75rem; background:var(--surface); padding:2px 8px; border-radius:4px; color:var(--text-muted); max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-decoration:none; display:inline-block; }
a.meta-chip { color:var(--link-color,#2980b9); cursor:pointer; }
a.meta-chip:hover { background:var(--hover-bg,#eee); text-decoration:underline; }
.group-expand-btn:hover { opacity:1; background:var(--surface); color:var(--text); }


/* New flow highlight — persists until reload */
.new-flow { background:rgba(255,50,50,.4) !important; border-left:4px solid #ff4444 !important;}

/* Read More button — inline expand in flow list */
.read-more-btn {
    background:var(--surface); border:1px solid var(--border); border-radius:6px;
    color:var(--accent); cursor:pointer;
    font-size:.8rem; padding:6px 12px; display:block; margin-top:4px;
    transition:background .15s, border-color .15s;
}
.read-more-btn:hover { background:var(--hover-bg,rgba(99,102,241,0.08)); border-color:var(--accent); text-decoration:underline; }
.flow-content-full {
    margin-top:4px; padding:8px; background:var(--surface); border-radius:6px;
    font-size:.85rem; line-height:1.6; white-space:pre-wrap; word-break:break-word;
    max-height:400px; overflow-y:auto;
}

/* === AUTOSEO Config === */
.autoseo-page { max-width:700px; margin:0 auto; padding:20px; }
.autoseo-form .form-group { margin-bottom:16px; }
.autoseo-form label { display:block; font-weight:600; margin-bottom:4px; color:var(--text); }
.autoseo-form input, .autoseo-form select, .autoseo-form textarea {
    width:100%; padding:8px 12px; border:1px solid #ddd; border-radius:6px;
    font-size:14px; background:#fff; box-sizing:border-box;
}
.autoseo-form textarea { resize:vertical; min-height:60px; }
.autoseo-form .form-hint { font-size:12px; color:green; margin-left:8px; }
.autoseo-form .btn {
    background:var(--accent); color:#fff; border:none; padding:10px 24px;
    border-radius:6px; cursor:pointer; font-size:15px; font-weight:600;
}
.autoseo-form .btn:hover { opacity:.85; }

/* Radio group */
.radio-group { display:flex; gap:20px; padding:4px 0; flex-wrap:wrap; }
.radio-label { display:inline-flex !important; align-items:center; gap:6px; cursor:pointer; font-size:15px; width:auto; }
.radio-label input[type="radio"] { width:16px; height:16px; accent-color:var(--primary); }
.autoseo-status {
    margin-top:24px; padding:16px; background:#f0fdf4; border-radius:8px;
    border:1px solid #86efac;
}
.autoseo-status h3 { margin:0 0 8px 0; color:#166534; }
.msg-success {
    padding:10px 16px; background:#dcfce7; border:1px solid #86efac;
    border-radius:6px; margin-bottom:16px; color:#166534;
}

/* Sidebar section label */
.sidebar-divider { border:none; border-top:1px solid var(--border); margin:8px 12px; opacity:0.4; }
.sidebar-section-label {
    padding:6px 16px 2px; font-size:0.75rem; color:var(--text-muted);
    text-transform:uppercase; letter-spacing:0.5px; font-weight:600;
}

/* Sidebar section label */
.sidebar-divider { border:none; border-top:1px solid var(--border); margin:8px 12px; opacity:0.4; }
.sidebar-section-label {
    padding:6px 16px 2px; font-size:0.75rem; color:var(--text-muted);
    text-transform:uppercase; letter-spacing:0.5px; font-weight:600;
}

/* Sidebar section head — like Dashboard/Do Flow */
.sidebar-section-head {
    display:flex !important; align-items:center; gap:10px;
    padding:10px 16px; font-size:14px; font-weight:500;
    color:var(--text); cursor:default;
}
/* Sidebar sub menu — smaller, indented */
.sidebar-sub {
    display:flex !important; align-items:center;
    padding:6px 16px 6px 44px !important; font-size:13px;
    color:var(--text-muted); 
}
.sidebar-sub:hover { color:var(--text); }
.sidebar a.active { color:var(--primary); font-weight:600; background:var(--primary-light,rgba(99,102,241,0.06)); }
.sidebar-sub.active { color:var(--primary); }

/* === Group Reply + Reaction — hover mới hiện === */
.flow-item { position:relative; }
.flow-reactions { display:none; gap:4px; flex-wrap:wrap; margin:6px 0 4px; }
/* Reactions trong flow-meta — luôn hiện, nhỏ gọn */
.flow-meta .flow-reactions { display:inline-flex; gap:2px; align-items:center; margin-left:auto; }
.flow-meta .flow-reactions:empty { display:none; }
.react-btn { display:inline-flex; align-items:center; gap:2px; padding:0 5px; border:1px solid var(--border); border-radius:8px; background:var(--bg); cursor:pointer; font-size:.7rem; line-height:1.5; height:20px; }
.react-add { padding:0 4px; font-size:.7rem; }
.flow-meta .react-add { display:inline-flex; }
.react-btn:hover { border-color:var(--primary); }
.react-btn.active { background:var(--primary-light,rgba(99,102,241,0.1)); border-color:var(--primary); }
.react-btn .cnt { font-size:.65rem; color:var(--text-muted); margin-left:1px; }
.react-add { border-style:dashed; color:var(--text-muted); padding:0 4px; font-size:.7rem; }
.react-picker { display:flex; gap:2px; padding:4px; background:var(--bg); border:1px solid var(--border); border-radius:8px; box-shadow:0 2px 8px rgba(0,0,0,0.15); z-index:100; }
.react-picker button { background:none; border:none; font-size:1.3rem; cursor:pointer; padding:2px 4px; border-radius:4px; }
.react-picker button:hover { background:var(--hover-bg,#f0f0f0); transform:scale(1.2); }
.reply-badge { font-size:.75rem; color:var(--text-muted); margin-left:auto; cursor:pointer; padding:0 4px; border-radius:4px; }
.reply-badge:hover { color:var(--primary); background:var(--primary-light,rgba(99,102,241,0.08)); }

/* Replies — luôn hiển thị */
.flow-replies { margin:2px 0 4px 20px; padding:4px 8px; border-left:2px solid var(--border); background:var(--bg-secondary,transparent); border-radius:0 4px 4px 0; }
.reply-item { font-size:.85rem; padding:2px 0; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.reply-item strong { font-size:.8rem; }
.reply-text { color:var(--text); word-break:break-word; }
.reply-item .flow-time { font-size:.7rem; margin-left:auto; white-space:nowrap; }
.reply-item.new-reply { animation:fadeIn 0.3s; }
@keyframes fadeIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }

/* Reply form */
.reply-form { display:none; margin-left:20px; margin-bottom:4px; }
.reply-form.open { display:flex; }
.reply-input { width:100%; padding:6px 10px; border:1px solid var(--border); border-radius:6px; font-size:.85rem; background:var(--bg); color:var(--text); }

/* Reply form — hover mới hiện nữa, hoặc nếu đang mở */

.new-flow { animation:fadeIn 0.5s; border-radius: 10px;}

/* Group tags */
.group-tags { margin-top:6px; display:flex; flex-wrap:wrap; gap:4px; }
.group-tags .tag { font-size:.7rem; color:var(--primary); background:rgba(0,212,170,0.08); padding:2px 8px; border-radius:10px; border:1px solid rgba(0,212,170,0.15); }

/* Pagination */
.pagination { display:flex; gap:6px; justify-content:center; margin:24px 0; flex-wrap:wrap; }
.pagination .page-link { padding:6px 14px; border-radius:6px; text-decoration:none; color:var(--text-muted); font-size:.85rem; border:1px solid var(--border); transition:all .15s; }
.pagination .page-link:hover { background:var(--surface); color:var(--text); }
.pagination .page-link.active { background:var(--primary); color:#000; font-weight:600; border-color:var(--primary); }

/* === Entity Page === */
.entity-page { max-width:720px; margin:0 auto; padding:24px 16px; }
.entity-hero { display:flex; gap:20px; align-items:center; margin-bottom:28px; }
.entity-hero-avatar { width:88px; height:88px; border-radius:50%; object-fit:cover; border:3px solid var(--primary); flex-shrink:0; }
.entity-hero-avatar-placeholder { display:flex; align-items:center; justify-content:center; background:var(--primary); color:#000; font-size:2rem; font-weight:700; }
.entity-hero-info { min-width:0; }
.entity-hero-name { margin:0 0 4px 0; font-size:1.5rem; font-weight:700; }
.entity-hero-meta { display:flex; gap:10px; align-items:center; font-size:.85rem; flex-wrap:wrap; }
.entity-hero-slug { color:var(--text-dim); font-family:monospace; }
.entity-hero-type { display:inline-block; padding:2px 10px; border-radius:12px; background:var(--surface); color:var(--text-muted); font-size:.78rem; }
.entity-section { margin-bottom:24px; }
.entity-section-title { font-size:1rem; font-weight:600; margin:0 0 12px 0; color:var(--text); }
.entity-bio { line-height:1.7; }
.entity-bio .node-content p:first-child { margin-top:0; }
.wp-chip-list { display:flex; flex-wrap:wrap; gap:8px; }
.wp-chip { display:inline-flex; align-items:center; gap:6px; padding:4px 12px 4px 4px; border-radius:20px; background:var(--surface); border:1px solid var(--border); text-decoration:none; color:var(--text); font-size:.85rem; transition:all .15s; }
.wp-chip:hover { border-color:var(--primary); background:var(--card-bg); }
.wp-mini-avatar { width:24px; height:24px; border-radius:50%; object-fit:cover; flex-shrink:0; }
.wp-avatar-placeholder { display:flex; align-items:center; justify-content:center; background:var(--primary); color:#000; font-size:.7rem; font-weight:600; }

/* Entity hero actions */
.entity-hero-actions { display:flex; gap:10px; align-items:center; margin-top:8px; flex-wrap:wrap; }
.entity-follow-btn { display:inline-flex; align-items:center; gap:4px; padding:6px 16px; border-radius:20px; font-size:.82rem; font-weight:500; cursor:pointer; border:1px solid var(--primary); background:var(--primary); color:#000; transition:all .15s; text-decoration:none; }
.entity-follow-btn:hover { opacity:.85; }
.entity-follow-btn.following { background:transparent; color:var(--text); border-color:var(--border); }
.entity-follower-count { font-size:.82rem; color:var(--text-dim); }
.entity-hero-stats { display:flex; gap:8px; align-items:center; margin-top:4px; flex-wrap:wrap; }
.entity-trust-point { display:inline-flex; align-items:center; gap:3px; padding:2px 10px; border-radius:12px; background:linear-gradient(135deg,#f6d365,#fda085); color:#000; font-size:.78rem; font-weight:600; }
/* Post list styles already exist from node_render */
.member-ai-btn { background:none; border:1px solid var(--accent); color:var(--accent); cursor:pointer; padding:2px 6px; margin-left:8px; border-radius:4px; font-size:14px; transition:all 0.2s; vertical-align:middle; }
.member-ai-btn:hover { background:var(--accent); color:white; }
.energy-bar-wrap { display:inline-block; position:relative; width:120px; height:18px; background:var(--border); border-radius:9px; overflow:hidden; vertical-align:middle; }
.energy-bar { position:absolute; left:0; top:0; height:100%; background:linear-gradient(90deg,#4ade80,#22c55e,#16a34a); border-radius:9px; transition:width 0.5s; min-width:4px; }
.energy-label { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); font-size:10px; color:white; font-weight:600; white-space:nowrap; text-shadow:0 1px 2px rgba(0,0,0,0.5); pointer-events:none; }
.td-center { text-align:center; font-weight:600; font-size:14px; }
.td-activity { font-size:13px; color:var(--text-secondary); }
.member-name-text a { color:inherit; text-decoration:none; }
.member-name-text a:hover { color:var(--accent); text-decoration:underline; }
.group-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.group-tab {
    padding: 8px 5px;
    cursor: pointer;
    background: none;
    color: var(--text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    font-size: .9rem;
    transition: color .15s, border-color .15s;
    text-decoration: none;
}
.group-tab:hover {
    color: var(--text);
}
.group-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
}
/* Members table */
.member-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.member-table th,
.member-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.member-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.member-table tr:hover td {
    background: rgba(255,255,255,.03);
}
.member-avatar {
    display: inline-flex;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-dim);
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 600;
    margin-right: 8px;
    flex-shrink: 0;
}
.member-name-cell {
    display: flex;
    align-items: center;
}
.badge-role {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: .75rem;
    font-weight: 500;
}
.badge-role.admin { background: rgba(0,229,160,.15); color: var(--primary); }
.badge-role.member { background: rgba(255,255,255,.08); color: var(--text-muted); }
.badge-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: .75rem;
}
.badge-status.active { background: rgba(0,229,160,.12); color: var(--primary); }
.badge-status.invited { background: rgba(255,193,7,.15); color: #ffc107; }
.badge-status.banned { background: rgba(244,67,54,.15); color: #f44336; }
.action-btn {
    padding: 4px 10px;
    font-size: .75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 4px;
    transition: opacity .15s;
}
.action-btn:hover { opacity: .8; }
.action-btn.approve { background: var(--primary-dim); color: #fff; }
.action-btn.reject { background: #d32f2f; color: #fff; }
.action-btn.ban { background: #e65100; color: #fff; }
.action-btn.unban { background: #388e3c; color: #fff; }

/* Mindset tab */
.mindset-panel {
    background:var(--card-bg); border:1px solid var(--border);
    border-radius:12px; padding:20px; margin-bottom:16px;
}
.mindset-panel h3 { margin:0 0 12px 0; font-size:1.1rem; }
.mindset-stat {
    text-align:center; padding:8px 16px;
    background:var(--surface); border-radius:8px;
    min-width:80px;
}
.stat-num { font-size:1.5rem; font-weight:700; color:var(--primary); display:block; }
.stat-label { font-size:.75rem; color:var(--text-muted); }
.chart-bar-item:hover { opacity:.85; transform:scaleY(1.05); }

/* Heatmap */
.heatmap-table { border-collapse:collapse; font-size:.82rem; width:100%; }
.heatmap-table th {
    padding:6px 10px; text-align:center; font-weight:500;
    color:var(--text-muted); border-bottom:1px solid var(--border);
    font-size:.75rem; white-space:nowrap;
}
.heatmap-table td { padding:6px 10px; text-align:center; }
.heatmap-name { text-align:left!important; font-weight:500; white-space:nowrap; }
.heatmap-cell {
    border-radius:6px; font-weight:500; min-width:36px;
    font-size:.78rem;
}
.heatmap-total { font-weight:700; color:var(--text-muted); }
.mindset-insight {
    background:var(--surface); border-radius:8px; padding:14px 18px;
    font-size:.9rem; line-height:1.7; max-height:400px; overflow-y:auto;
}

/* Pin button */
.pin-btn {
    cursor: pointer;
    font-size: .9rem;
    opacity: .5;
    margin-left: 8px;
    transition: opacity .15s;
    display: inline-flex;
    align-items: center;
}
.pin-btn:hover {
    opacity: 1;
}
.flow-item.pinned-item {
    background: rgba(0,229,160,.07);
    border: 1px solid rgba(0,229,160,.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
}
.flow-item.pinned-item .flow-content.pinned {
    border-left: 3px solid var(--primary);
    padding-left: 10px;
    font-weight: 600;
}
.pin-indicator {
    color: var(--primary);
    font-size: .75rem;
    font-weight: 600;
    margin-right: 8px;
}
.pinned-separator {
    text-align: center;
    color: var(--text-muted);
    font-size: .75rem;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
    margin-bottom: 12px;
}

/* ===== MOBILE — max-width 640px ===== */
@media (max-width: 640px) {
    /* Header: prevent title overlap */
    .group-header h1 {
        font-size: 1.1rem;
        max-width: calc(100% - 90px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Tab bar: scrollable */
    .group-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        gap: 2px;
        padding-bottom: 4px;
    }
    .group-tab {
        white-space: nowrap;
        font-size: .78rem;
        padding: 6px 10px;
        flex-shrink: 0;
    }
    .group-tab-right { flex-shrink: 0; }

    /* Action chips */
    .group-chips {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 4px;
        padding-bottom: 2px;
    }
    .group-chip {
        font-size: .75rem;
        padding: 3px 8px;
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* Datafiles table: horizontal scroll + compact */
    #df-file-list table,
    #df-search-results table {
        font-size: .72rem;
    }
    #df-file-list th,
    #df-search-results th,
    #df-file-list td,
    #df-search-results td {
        padding: 4px 4px;
    }
    /* Hide less critical columns on mobile */
    #df-file-list th:nth-child(2),
    #df-file-list td:nth-child(2),
    #df-file-list th:nth-child(4),
    #df-file-list td:nth-child(4),
    #df-search-results th:nth-child(3),
    #df-search-results td:nth-child(3) {
        display: none;
    }

    /* Dropzone */
    #df-dropzone {
        padding: 10px;
        font-size: .82rem;
    }
    #df-dropzone div:last-child {
        font-size: .75rem;
    }

    /* Flow items */
    .flow-item {
        padding: 8px 0;
    }
    .flow-meta {
        flex-wrap: wrap;
        gap: 4px;
    }
    .flow-content {
        font-size: .85rem;
    }
    .reply-badge {
        margin-left: 4px;
    }

    /* Flow search inline */
    #flow-inline-search {
        margin-bottom: 6px;
    }
    #flow-inline-input {
        font-size: .85rem;
        padding: 8px 12px;
    }
    #flow-inline-results .search-item {
        padding: 8px 10px;
    }

    /* Datafiles search input */
    #df-search-input {
        font-size: .85rem;
        padding: 8px 12px;
    }

    /* Flow input bar */
    .group-input-bar {
        padding: 10px;
        gap: 6px;
    }
    .group-input-bar button {
        white-space: nowrap;
        padding: 6px 10px;
        font-size: .78rem;
    }

    /* Members table: stack as cards */
    .member-table table,
    .member-table thead,
    .member-table tbody,
    .member-table th,
    .member-table td,
    .member-table tr {
        display: block;
    }
    .member-table thead { display: none; }
    .member-table tr {
        margin-bottom: 10px;
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 8px 10px;
        background: var(--surface);
    }
    .member-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 0;
        border: none;
        font-size: .82rem;
    }
    .member-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: .72rem;
        margin-right: 8px;
        flex-shrink: 0;
    }
    /* nth-child fallback when no data-label attribute */
    .member-table td:nth-child(1)::before { content: "Thành viên"; }
    .member-table td:nth-child(2)::before { content: "Vai trò"; }
    .member-table td:nth-child(3)::before { content: "Hoạt động"; }
    .member-table td:nth-child(4)::before { content: "Trạng thái"; }
    .member-table td:nth-child(5)::before { content: "Thao tác"; }
    .badge-role, .badge-status {
        font-size: .7rem;
    }

    /* Reply form */
    .reply-input {
        font-size: .82rem;
    }

    /* Page padding */
    #body_id, .page-content {
        padding: 10px 8px;
    }
}
