/* print.css — paper rendering of a conversation.
 *
 * Loaded with media="print", so every rule here is print-only. The goal
 * is the question, the answer, its images, reasoning and sources — and
 * nothing that only makes sense on screen (site chrome, the composer,
 * the action buttons themselves, overlays). Collapsed <details> are
 * opened by conversation-print.js before the print starts. */

@page {
    margin: 15mm;
}

/* Paper is always light, whatever theme the screen is showing: a dark
   palette prints as a wall of ink. These override the active theme's
   tokens for the print rendering only, so every themed rule downstream
   comes out light without needing a print-specific counterpart.
   Deliberately only the tokens that reach paper. */
:root {
    --color-bg: #ffffff;
    --color-surface: #ffffff;
    --color-surface-raised: #ffffff;
    --color-border: #cccccc;
    --color-text: #000000;
    --color-text-muted: #444444;
    --color-muted-soft: #f0f0f0;
    --color-accent: #1a3fa0;
    --color-accent-soft: #f2f4fb;
    --color-accent-faint: #f8f9fc;
    --color-code-bg: #f4f4f6;
    --color-code-text: #111111;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
}

body {
    background: #fff;
    color: #000;
}

/* ---- Screen-only chrome ---- */

.site-header,
.search-followup,
.conversation-actions,
.session-actions,
.back-to-search,
.back-link,
.search-live,
.composer-modal,
.code-publish-modal,
.code-launch-modal,
.image-viewer-modal,
.asset-viewer-modal,
.code-collapse-toggle,
.code-launch-bar,
[data-token-widget],
.context-meter {
    display: none !important;
}

.main-content,
.search-results-page,
.search-results-container,
.session-detail-page {
    margin: 0;
    padding: 0;
    max-width: none;
    width: auto;
}

/* ---- Cards flatten onto the page ---- */

.search-answer,
.conversation-history,
.history-exchange,
.session-assets {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0 0 1rem;
}

.results-query {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.answer-meta {
    color: #444;
    font-size: 0.75rem;
}

/* ---- Long code prints in full ---- */

.code-collapse.is-collapsed pre {
    max-height: none;
    overflow: visible;
}

.code-collapse.is-collapsed::after {
    display: none;
}

pre,
code {
    white-space: pre-wrap;
    word-break: break-word;
}

/* The screen theme prints code white-on-near-black — a page of toner
   for no gain. Same specificity as markdown.css's rule, later cascade. */
.md-content pre {
    background-color: #f7f7f7;
    color: #000;
    border: 1px solid #ccc;
    overflow-x: visible;
}

/* ---- Sources are unclickable on paper, so print the URL ---- */

.source-link {
    color: #000;
    text-decoration: none;
}

.source-url {
    color: #444;
    font-size: 0.75rem;
}

/* ---- Keep related content together ---- */

.search-answer img,
.conversation-image,
.retrieved-image {
    max-width: 100% !important;
    page-break-inside: avoid;
}

h1, h2, h3, summary {
    page-break-after: avoid;
}

pre,
blockquote,
.source-item,
.history-exchange {
    page-break-inside: avoid;
}
