/* Shared styles that Tailwind utilities don't cover well: rendered markdown, chips, badges, drawer. */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:opsz,wght@6..72,400;6..72,600&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root { --paper:#f5f1e8; --paper-deep:#ece6d8; --edge:#d9d1bf; --ink:#1d1b17; --ink-soft:#4a463e; --ink-faint:#7a7466; --accent:#c4471d; }
html { background: var(--paper); color: var(--ink); }
body { font-family: "IBM Plex Sans", system-ui, sans-serif; line-height: 1.55; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Source chip: one per cited id; opens the source drawer. */
.src-chip { font: 500 0.72rem/1 "IBM Plex Mono", monospace; padding: 0.18rem 0.35rem; border: 1px solid var(--edge); border-radius: 3px; background: #fffdf8; color: var(--ink-soft); cursor: pointer; white-space: nowrap; vertical-align: 0.08em; }
.src-chip:hover { border-color: var(--ink-soft); color: var(--ink); }
.src-chip.missing { border-style: dashed; color: #a33; }

/* Claim label badge: colour marks real state; the word is always shown. */
.lbl { font: 600 0.66rem/1 "IBM Plex Sans", sans-serif; letter-spacing: 0.02em; padding: 0.2rem 0.4rem; border-radius: 3px; vertical-align: 0.1em; white-space: nowrap; }
.lbl-stated { background: #dde7f1; color: #1f4e79; }
.lbl-observed { background: #dcebdc; color: #2f6b3a; }
.lbl-inferred { background: #f4e6c4; color: #8a5a00; }
.reasoning { color: var(--ink-faint); font-size: 0.9em; font-style: italic; }

/* Rendered synthesis markdown */
.md { max-width: 78ch; }
.md h1 { font-family: Newsreader, Georgia, serif; font-size: 2.1rem; line-height: 1.15; margin: 0 0 1rem; font-weight: 600; }
.md h2 { font-family: Newsreader, Georgia, serif; font-size: 1.5rem; margin: 2.4rem 0 0.8rem; font-weight: 600; padding-top: 0.6rem; border-top: 1px solid var(--edge); }
.md h3 { font-family: Newsreader, Georgia, serif; font-size: 1.18rem; margin: 1.6rem 0 0.5rem; font-weight: 600; }
.md h4 { font-weight: 600; margin: 1.2rem 0 0.4rem; }
.md p { margin: 0.6rem 0; }
.md ul, .md ol { margin: 0.5rem 0 0.9rem 1.2rem; }
.md ul { list-style: disc; } .md ol { list-style: decimal; }
.md li { margin: 0.35rem 0; padding-left: 0.2rem; }
.md code { font-family: "IBM Plex Mono", monospace; font-size: 0.85em; background: var(--paper-deep); padding: 0.05rem 0.25rem; border-radius: 3px; }
.md pre { background: #fffdf8; border: 1px solid var(--edge); padding: 0.8rem; overflow-x: auto; border-radius: 4px; font-size: 0.82rem; }
.md pre code { background: none; padding: 0; }
.md blockquote { border-left: 3px solid var(--edge); padding-left: 0.9rem; color: var(--ink-soft); margin: 0.8rem 0; }
.md table { border-collapse: collapse; width: 100%; font-size: 0.88rem; margin: 0.8rem 0 1.2rem; display: block; overflow-x: auto; }
.md th, .md td { border-bottom: 1px solid var(--edge); padding: 0.4rem 0.5rem; text-align: left; vertical-align: top; }
.md th { font-weight: 600; background: var(--paper-deep); }
.md a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.md li.claim-hidden, .md tr.claim-hidden { display: none; }

/* Source drawer */
#src-drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(440px, 100%); background: #fffdf8; border-left: 1px solid var(--edge); transform: translateX(100%); transition: transform 0.22s ease; z-index: 60; overflow-y: auto; }
#src-drawer.open { transform: translateX(0); box-shadow: -12px 0 30px rgba(29, 27, 23, 0.12); }
