/* /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-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 0.65rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

body.topic-page-active .topic-page-breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
}

body.topic-page-active .topic-page-breadcrumbs a:hover {
    color: #0d6e4f;
    text-decoration: underline;
}

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-intro {
    margin: 0 0 1rem;
    font-size: 0.98rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

body.topic-page-active .topic-page-intent {
    margin: -0.35rem 0 0.85rem;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-tertiary);
}

body.topic-page-active .topic-page-takeaways__list {
    margin: 0;
    padding-left: 1.15rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.55;
}

body.topic-page-active .topic-page-takeaways__list li {
    margin-bottom: 0.55rem;
}

body.topic-page-active .topic-page-takeaways__list li:last-child {
    margin-bottom: 0;
}

body.topic-page-active .topic-page-tldr {
    margin: 0.25rem 0 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    background: var(--bg-primary, #fff);
}

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

body.topic-page-active .topic-page-tldr__list {
    margin: 0;
    padding-left: 1.15rem;
    color: var(--text-primary);
    font-size: 0.92rem;
    line-height: 1.5;
}

body.topic-page-active .topic-page-tldr__list li {
    margin-bottom: 0.45rem;
}

body.topic-page-active .topic-page-tldr__list li:last-child {
    margin-bottom: 0;
}

body.topic-page-active .topic-page-outlets {
    margin: 0 0 0.75rem;
    font-size: 0.82rem;
    color: var(--text-tertiary);
    line-height: 1.45;
}

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-page-ad {
    margin: 1.25rem 0 0.5rem;
}

body.topic-page-active .topic-page-ad .nukta-ad-slot,
body.topic-page-active .topic-page-ad .nukta-adsense,
body.topic-page-active .topic-page-ad .nukta-adscod-inline {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
}

/* Leaderboard / wide Nukta Ads banner (plc_ai_discover 728×90) */
body.topic-page-active .topic-page-ad .nukta-ad-slot[data-unit="discover-display"],
body.topic-page-active .topic-page-ad .nukta-adsense--topic-banner,
body.topic-page-active .topic-page-ad .nukta-adsense--discover {
    max-width: none;
    width: 100%;
    margin: 0 0 0.5rem;
}

body.topic-page-active .topic-page-ad .nukta-ad-slot[data-unit="discover-display"] .nukta-ads-slot,
body.topic-page-active .topic-page-ad .nukta-ads-slot--discover {
    max-width: 100%;
}

body.topic-page-active .topic-page-texts .topic-source-cards {
    gap: 0.85rem;
}

body.topic-page-active .topic-page-texts .topic-source-card {
    padding: 1rem 1.1rem;
    background: var(--bg-primary, #fff);
}

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

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;
    }
}
