/* /topics/{id|slug} — full-width detail + document-style chat bar at bottom */

body.topic-page-active .chat-container.topic-page-container {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

body.topic-page-active .topic-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    flex: 1;
    min-height: 0;
    height: 100%;
    margin: 0;
    background: var(--bg-main);
    position: relative;
}

body.topic-page-active .topic-page-detail--with-chat {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem 1.25rem calc(120px + 1.5rem);
    max-width: 820px;
    margin: 0 auto;
    width: 100%;
    background: var(--bg-main);
    color: var(--text-primary);
}

body.topic-page-active .topic-page-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

body.topic-page-active .topic-page-back:hover {
    color: var(--text-primary);
}

body.topic-page-active .topic-page-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

body.topic-page-active .topic-page-title {
    font-family: var(--font-ui);
    font-size: clamp(1.25rem, 2.5vw, 1.65rem);
    line-height: 1.25;
    margin: 0 0 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

body.topic-page-active .topic-page-sources {
    margin-bottom: 1rem;
}

body.topic-page-active .topic-page-section {
    margin-top: 1.5rem;
}

body.topic-page-active .topic-page-section h2 {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin: 0 0 0.75rem;
    font-weight: 700;
}

body.topic-page-active .topic-text-pair {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-light, #ebebeb);
}

body.topic-page-active .topic-text-pair:last-child {
    border-bottom: none;
}

body.topic-page-active .topic-page-text-item {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

body.topic-page-active .topic-text-source-link {
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0d6e4f;
    text-decoration: none;
}

body.topic-page-active .topic-text-source-link:hover {
    text-decoration: underline;
}

body.topic-page-active .topic-page-muted {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

body.topic-page-active .topic-page-suggestions--in-chat {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.5rem;
}

body.topic-page-active .topic-page-chip {
    font-size: 0.78rem;
}

body.topic-page-active .topic-magic-bar-container {
    /* inherits .doc-magic-bar-container from document_magic_chat.css */
}

body.topic-page-active .topic-title-link {
    color: inherit;
    text-decoration: none;
}

body.topic-page-active .topic-title-link:hover {
    color: #0d6e4f;
}

body.topic-page-active .topic-page--error {
    padding: 2rem 1.5rem;
    max-width: 640px;
    margin: 0 auto;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    body.topic-page-active .topic-page-detail--with-chat {
        padding: 0.75rem 1rem calc(110px + 1rem);
        max-width: none;
    }
}
