/* AI Knowledge Hub — ZeeBORN Design System */
:root {
    --zb-darkblue: #4e6d9c;
    --zb-blue: #6882ad;
    --zb-middleblue: #C5DEF9;
    --zb-lightblue: #e1ecf7;
    --zb-green: #80ff80;
    --zb-darkgreen: #4DA64D;
    --zb-lightgreen: #cdffcd;
    --zb-orange: #fcb954;
    --zb-red: #ff7777;
    --zb-yellow: #ffff80;
    --zb-gray: #d1d1d1;
    --zb-bg: #ffffff;
    --zb-paper: #f2f0f4;
    --zb-text: #3a3a3a;
    --zb-text-light: #6e6e6e;
    --zb-border: #e1ecf7;
    --zb-card: #ffffff;
    --radius: 10px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
    --zb-darkblue: #7b9fd4;
    --zb-blue: #8aa5cc;
    --zb-middleblue: #2a3f5f;
    --zb-lightblue: #1e2d45;
    --zb-lightgreen: #1a3a1a;
    --zb-darkgreen: #5cc85c;
    --zb-paper: #1a1a2e;
    --zb-bg: #12121f;
    --zb-text: #e0e0e8;
    --zb-text-light: #9a9ab0;
    --zb-border: #2a2a45;
    --zb-card: #1e1e32;
    --zb-yellow: #3a3a20;
    --zb-gray: #3a3a4e;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.4);
}

[data-theme="dark"] .topbar {
    background: #0d0d1a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

[data-theme="dark"] .welcome-card {
    background: linear-gradient(135deg, #1a2744, #2a3f5f);
}

[data-theme="dark"] .login-card { background: var(--zb-card); }

[data-theme="dark"] .article-content blockquote {
    background: #2a2a1e;
}

[data-theme="dark"] .difficulty-1 { background: #1a3a1a; color: #7adf7a; }
[data-theme="dark"] .difficulty-2 { background: #3a2a10; color: var(--zb-orange); }
[data-theme="dark"] .difficulty-3 { background: #3a1a1a; color: #ff9999; }

[data-theme="dark"] .topic-card.topic-complete {
    background: linear-gradient(135deg, #1a2e1a 0%, #1a3a1a 100%);
}

[data-theme="dark"] .resource-highlight {
    background: linear-gradient(135deg, var(--zb-card) 90%, #2a2a1e 100%);
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: var(--zb-bg);
    color: var(--zb-text);
    border-color: var(--zb-border);
}

[data-theme="dark"] .note-card { background: #2a2a1e; color: var(--zb-text); }

/* ===== TOOLBAR CONTROLS (lang + dark mode) ===== */
.topbar-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}

.lang-toggle {
    display: flex;
    gap: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.lang-toggle a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 6px;
    transition: all 0.2s;
}

.lang-toggle a.lang-active {
    color: #fff;
    background: rgba(255,255,255,0.2);
}

.lang-toggle a:hover { color: #fff; }

.theme-toggle {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}

.theme-toggle:hover {
    color: #fff;
    background: rgba(255,255,255,0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--zb-paper);
    color: var(--zb-text);
    line-height: 1.6;
    -webkit-tap-highlight-color: transparent;
}

/* ===== TOPBAR ===== */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: var(--zb-darkblue);
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.topbar-brand {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    margin-right: 24px;
    white-space: nowrap;
}

.topbar-nav {
    display: flex;
    gap: 4px;
    flex: 1;
}

.nav-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.nav-user {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    padding: 8px 12px;
    margin-left: auto;
}
.nav-logout { }

.badge {
    background: var(--zb-red);
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 0.75rem;
    font-weight: 700;
    position: absolute;
    top: 2px;
    right: -2px;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    border-radius: 2px;
}

/* ===== CONTENT ===== */
.content {
    max-width: 1100px;
    margin: 72px auto 24px;
    padding: 0 16px;
}

.content-noauth {
    margin-top: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* ===== LOGIN ===== */
.login-container {
    width: 100%;
    max-width: 380px;
    padding: 16px;
}

.login-card {
    background: var(--zb-card);
    border-radius: var(--radius);
    padding: 40px 32px;
    box-shadow: var(--shadow);
    text-align: center;
}

.login-icon { font-size: 3rem; margin-bottom: 8px; }

.login-card h1 {
    font-size: 1.5rem;
    color: var(--zb-darkblue);
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--zb-text-light);
    margin-bottom: 24px;
    font-size: 0.9rem;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--zb-text-light);
}

input[type="text"], input[type="password"], input[type="url"],
input[type="email"], textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--zb-border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--zb-card);
    color: var(--zb-text);
    transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--zb-darkblue);
    box-shadow: 0 0 0 3px rgba(78,109,156,0.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary { background: var(--zb-darkblue); color: #fff; }
.btn-primary:hover { background: #3d5a85; }
.btn-secondary { background: var(--zb-lightblue); color: var(--zb-darkblue); }
.btn-secondary:hover { background: var(--zb-middleblue); }
.btn-success { background: var(--zb-darkgreen); color: #fff; }
.btn-danger { background: var(--zb-red); color: #fff; }
.btn-danger:hover { background: #e05555; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; }
.btn-icon {
    background: none; border: none; cursor: pointer;
    font-size: 1.3rem; padding: 4px; color: var(--zb-orange);
}

/* ===== CARDS ===== */
.card {
    background: var(--zb-card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 1.1rem;
    color: var(--zb-darkblue);
    margin-bottom: 12px;
}

.card h3 {
    font-size: 1rem;
    color: var(--zb-darkblue);
    margin-bottom: 8px;
}

/* ===== ALERTS ===== */
.alert {
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-error { background: #ffe0e0; color: #c00; }

/* ===== DASHBOARD ===== */
.welcome-card {
    background: linear-gradient(135deg, var(--zb-darkblue), var(--zb-blue));
    color: #fff;
    border-radius: var(--radius);
    padding: 28px 24px;
    margin-bottom: 20px;
}

.welcome-card h1 { font-size: 1.6rem; margin-bottom: 4px; }
.welcome-date { opacity: 0.8; font-size: 0.9rem; }
.welcome-text { margin-top: 8px; opacity: 0.9; }

.quick-ask-card { margin-bottom: 20px; }

.quick-ask-form .input-row {
    display: flex;
    gap: 8px;
}

.input-full { flex: 1; }

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--zb-card);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card a { text-decoration: none; color: inherit; }
.stat-number { font-size: 2rem; font-weight: 700; color: var(--zb-darkblue); }
.stat-label { font-size: 0.8rem; color: var(--zb-text-light); margin-top: 2px; }
.stat-news .stat-number { color: var(--zb-orange); }

.section-title {
    font-size: 1.2rem;
    color: var(--zb-darkblue);
    margin: 24px 0 12px;
}

/* ===== TOPICS GRID ===== */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.topics-grid-large {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.topic-card {
    background: var(--zb-card);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    color: var(--zb-text);
    box-shadow: var(--shadow);
    transition: all 0.25s ease;
    border-top: 5px solid var(--zb-darkblue);
    border-left: none;
    display: flex;
    flex-direction: column;
    min-height: 140px;
}

.topic-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    transform: translateY(-4px);
}

.topic-card-large {
    padding: 28px;
    min-height: 180px;
}

.topic-icon { font-size: 2rem; margin-bottom: 8px; }
.topic-icon-large { font-size: 3rem; margin-bottom: 12px; }
.topic-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 4px; }
.topic-title-large { font-weight: 700; font-size: 1.2rem; margin-bottom: 6px; }
.topic-description { font-size: 0.85rem; color: var(--zb-text-light); line-height: 1.4; margin-bottom: 8px; flex: 1; }
.topic-subtitle { font-size: 0.8rem; color: var(--zb-text-light); margin-bottom: 8px; }
.topic-article-count { font-size: 0.8rem; color: var(--zb-text-light); margin-bottom: 6px; }

.topic-progress { margin-top: auto; }
.progress-bar {
    height: 8px;
    background: var(--zb-paper);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-fill {
    height: 100%;
    background: var(--zb-darkgreen);
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-text { font-size: 0.8rem; color: var(--zb-text-light); font-weight: 500; }

/* Topic complete */
.topic-card.topic-complete {
    background: linear-gradient(135deg, #f0fff0 0%, var(--zb-lightgreen) 100%);
    border-top-color: var(--zb-darkgreen) !important;
}
.topic-card.topic-complete .progress-text {
    color: var(--zb-darkgreen);
    font-weight: 700;
}

/* Topic colors */
.topic-llm-fundamentals { border-top-color: #6C5CE7; }
.topic-prompting { border-top-color: var(--zb-orange); }
.topic-api-integration { border-top-color: var(--zb-darkblue); }
.topic-mcp-server { border-top-color: #00B894; }
.topic-ai-delphi { border-top-color: #E17055; }
.topic-rag-embeddings { border-top-color: #0984E3; }
.topic-agent-frameworks { border-top-color: #6C5CE7; }
.topic-ethics-privacy { border-top-color: #D63031; }
.topic-html-css { border-top-color: #E44D26; }
.topic-technical-documentation { border-top-color: #2ECC71; }
.topic-python-basics { border-top-color: #3776AB; }

/* ===== ARTICLES ===== */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.article-card {
    background: var(--zb-card);
    border-radius: var(--radius);
    padding: 16px;
    text-decoration: none;
    color: var(--zb-text);
    box-shadow: var(--shadow);
    transition: all 0.2s;
    display: block;
}

.article-card:hover { box-shadow: var(--shadow-hover); }
.article-card.article-read {
    background: var(--zb-lightgreen);
    border-left: 4px solid var(--zb-darkgreen);
}

.article-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.difficulty {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.difficulty-1 { background: var(--zb-lightgreen); color: #2d6a2d; }
.difficulty-2 { background: var(--zb-orange); color: #fff; }
.difficulty-3 { background: var(--zb-red); color: #fff; }

.article-topic { font-size: 0.8rem; color: var(--zb-text-light); }
.article-title { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.article-summary { font-size: 0.9rem; color: var(--zb-text-light); line-height: 1.5; }

.article-tags { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }

.tag {
    background: var(--zb-lightblue);
    color: var(--zb-darkblue);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.read-badge {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--zb-darkgreen);
    font-weight: 600;
}

.bookmark-icon { color: var(--zb-orange); font-size: 1.1rem; }

/* ===== ARTICLE VIEW ===== */
.article-view { max-width: 800px; }

.back-link {
    display: inline-block;
    color: var(--zb-darkblue);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.back-link:hover { text-decoration: underline; }

.article-header h1 { font-size: 1.5rem; margin-bottom: 8px; }

.article-meta-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.summary-card {
    background: var(--zb-lightblue);
    border-left: 4px solid var(--zb-darkblue);
}

.summary-card p { font-size: 1rem; line-height: 1.6; }

.takeaways-card { background: #f0faf0; border-left: 4px solid var(--zb-darkgreen); }
.takeaways-card ul { padding-left: 20px; }
.takeaways-card li { margin-bottom: 4px; }

.article-content {
    background: var(--zb-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    line-height: 1.7;
}

.article-content h1, .article-content h2, .article-content h3 {
    color: var(--zb-darkblue);
    margin-top: 24px;
    margin-bottom: 12px;
}

.article-content h2 { font-size: 1.3rem; }
.article-content h3 { font-size: 1.1rem; }

.article-content pre {
    background: #1e1e2e;
    color: #cdd6f4;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    font-size: 0.85rem;
    margin: 16px 0;
}

.article-content code {
    background: var(--zb-paper);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.article-content pre code {
    background: none;
    padding: 0;
}

.article-content blockquote {
    border-left: 4px solid var(--zb-orange);
    padding: 8px 16px;
    margin: 12px 0;
    background: #fffbf0;
    border-radius: 0 8px 8px 0;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.article-content th, .article-content td {
    border: 1px solid var(--zb-border);
    padding: 8px 12px;
    text-align: left;
}

.article-content th { background: var(--zb-lightblue); font-weight: 600; }

.related-section { margin: 24px 0; }
.related-list { display: flex; flex-direction: column; gap: 6px; }

.related-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--zb-card);
    border-radius: 8px;
    text-decoration: none;
    color: var(--zb-text);
    box-shadow: var(--shadow);
    font-size: 0.9rem;
}

.related-card:hover { box-shadow: var(--shadow-hover); }

.notes-section { margin: 24px 0; }
.note-card {
    background: var(--zb-yellow);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
}

.note-date { font-size: 0.75rem; color: var(--zb-text-light); }
.note-ref { color: var(--zb-darkblue); font-weight: 600; text-decoration: none; }

.note-form {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-top: 12px;
}

.note-form textarea { flex: 1; }

/* ===== NEWS ===== */
.filter-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--zb-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.filter-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    flex: 1;
}

.filter-form select { width: auto; min-width: 140px; }
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    cursor: pointer;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.news-card {
    background: var(--zb-card);
    border-radius: var(--radius);
    padding: 14px 16px;
    text-decoration: none;
    color: var(--zb-text);
    box-shadow: var(--shadow);
    transition: all 0.2s;
    display: block;
}

.news-card:hover { box-shadow: var(--shadow-hover); }
.news-card.news-unread { border-left: 4px solid var(--zb-orange); }

.news-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 4px;
    font-size: 0.8rem;
}

.news-source { color: var(--zb-darkblue); font-weight: 600; }
.news-relevance { color: var(--zb-orange); }
.news-category { background: var(--zb-lightblue); padding: 1px 6px; border-radius: 4px; }
.news-date { color: var(--zb-text-light); }
.news-title { font-weight: 700; margin-bottom: 4px; }
.news-summary { font-size: 0.9rem; color: var(--zb-text-light); line-height: 1.5; }

.raw-content {
    white-space: pre-wrap;
    font-size: 0.9rem;
    max-height: 400px;
    overflow-y: auto;
    background: var(--zb-paper);
    padding: 16px;
    border-radius: 8px;
}

/* ===== CHAT ===== */
.chat-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 16px;
    height: calc(100vh - 88px);
}

.chat-sidebar {
    background: var(--zb-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--zb-border);
}

.chat-sidebar-header h2 { font-size: 1rem; color: var(--zb-darkblue); margin: 0; }

.conv-list { flex: 1; overflow-y: auto; }

.conv-item {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--zb-text);
    border-bottom: 1px solid var(--zb-paper);
    transition: background 0.2s;
}

.conv-item:hover { background: var(--zb-paper); }
.conv-item.conv-active { background: var(--zb-lightblue); }
.conv-title { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { font-size: 0.75rem; color: var(--zb-text-light); }

.chat-main {
    background: var(--zb-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--zb-border);
}

.chat-header h2 { font-size: 1rem; color: var(--zb-darkblue); margin: 0; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.chat-welcome {
    text-align: center;
    padding: 40px;
    color: var(--zb-text-light);
}

.chat-hint { font-size: 0.85rem; margin-top: 8px; }

.chat-msg {
    margin-bottom: 16px;
    max-width: 85%;
}

.chat-user {
    margin-left: auto;
    text-align: right;
}

.chat-user .msg-content {
    background: var(--zb-darkblue);
    color: #fff;
    border-radius: 12px 12px 0 12px;
    padding: 10px 14px;
    display: inline-block;
    text-align: left;
}

.chat-assistant .msg-content {
    background: var(--zb-paper);
    border-radius: 12px 12px 12px 0;
    padding: 10px 14px;
    display: inline-block;
    white-space: pre-wrap;
}

.msg-role {
    font-size: 0.75rem;
    color: var(--zb-text-light);
    margin-bottom: 2px;
    font-weight: 600;
}

.chat-input-form {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--zb-border);
    background: var(--zb-paper);
}

.chat-input-form textarea {
    flex: 1;
    resize: none;
    border: 1px solid var(--zb-border);
}

.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--zb-text-light);
}

/* ===== SETTINGS ===== */
.settings-table {
    width: 100%;
    border-collapse: collapse;
}

.settings-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--zb-paper);
}

.settings-table td:first-child {
    font-weight: 600;
    color: var(--zb-text-light);
    width: 200px;
}

.feeds-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.feeds-table th, .feeds-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--zb-paper);
    text-align: left;
}

.feeds-table th { font-size: 0.8rem; color: var(--zb-text-light); }
.feed-inactive { opacity: 0.5; }

.add-feed-form { margin-top: 12px; }

.actions-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--zb-text-light);
}

.link-more {
    display: inline-block;
    margin-top: 12px;
    color: var(--zb-darkblue);
    text-decoration: none;
    font-weight: 600;
}

.link-more:hover { text-decoration: underline; }

/* ===== SUBTOPICS ===== */
.subtopics {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

a.subtopic-badge {
    background: var(--zb-lightblue);
    color: var(--zb-darkblue);
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

a.subtopic-badge:hover {
    background: var(--zb-darkblue);
    color: #fff;
}

.subtopic-header {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--zb-darkblue);
    padding: 8px 0 4px;
    margin-top: 8px;
    border-bottom: 2px solid var(--zb-lightblue);
}

/* ===== DIGEST ===== */
.digest-card { border-left: 4px solid var(--zb-orange); }
.digest-content { line-height: 1.6; }
.digest-content h3 { color: var(--zb-darkblue); margin-top: 16px; }

/* ===== PAGE HEADER ===== */
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 1.5rem; color: var(--zb-darkblue); }
.page-header p { color: var(--zb-text-light); }

/* ===== RESOURCES ===== */
.resource-category {
    margin-bottom: 32px;
}

.resource-category-title {
    font-size: 1.3rem;
    color: var(--zb-darkblue);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.resource-category-icon { font-size: 1.4rem; }
.resource-category-desc {
    color: var(--zb-text-light);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.resource-card {
    background: var(--zb-card);
    border-radius: var(--radius);
    padding: 16px;
    text-decoration: none;
    color: var(--zb-text);
    box-shadow: var(--shadow);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    position: relative;
    border-left: 4px solid var(--zb-border);
}

.resource-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.resource-highlight {
    border-left-color: var(--zb-orange);
    background: linear-gradient(135deg, #fff 90%, #fffbf0 100%);
}

.resource-star {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--zb-orange);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.resource-card-header {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.resource-duration {
    font-size: 0.75rem;
    color: var(--zb-text-light);
    background: var(--zb-paper);
    padding: 2px 6px;
    border-radius: 4px;
}

.resource-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--zb-darkblue);
}

.resource-desc {
    font-size: 0.85rem;
    color: var(--zb-text-light);
    line-height: 1.5;
    flex: 1;
    margin-bottom: 8px;
}

.resource-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.resource-link {
    font-size: 0.85rem;
    color: var(--zb-darkblue);
    font-weight: 600;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    .topbar-nav {
        display: none;
        position: fixed;
        top: 56px;
        left: 0; right: 0;
        background: var(--zb-darkblue);
        flex-direction: column;
        padding: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }

    [data-theme="dark"] .topbar-nav { background: #0d0d1a; }

    .topbar-nav.open { display: flex; }
    .nav-logout { margin-left: 0; }
    .hamburger { display: block; }

    .topbar-controls { margin-left: 0; margin-right: 8px; }

    .content { margin-top: 64px; }

    .stats-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .stat-number { font-size: 1.5rem; }

    .topics-grid, .topics-grid-large {
        grid-template-columns: 1fr;
    }

    .form-row { grid-template-columns: 1fr; }

    .chat-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .chat-sidebar {
        max-height: 200px;
    }

    .chat-main {
        min-height: 60vh;
    }

    .chat-msg { max-width: 95%; }

    .filter-form { flex-direction: column; }
    .filter-form select { width: 100%; }

    .article-meta-bar { flex-direction: column; align-items: flex-start; }

    .feeds-table { font-size: 0.8rem; }
    .feeds-table th:nth-child(4),
    .feeds-table td:nth-child(4) { display: none; }

    .resource-grid { grid-template-columns: 1fr; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .topics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1025px) {
    .topics-grid-large { grid-template-columns: repeat(4, 1fr); }
}
