* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font);
  min-height: 100dvh; display: flex; flex-direction: column;
  overflow-wrap: anywhere;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
a { color: var(--accent); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- the top bar ------------------------------------------------------- */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  padding-top: max(8px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.brand .logo { height: 28px; width: auto; max-width: 160px; object-fit: contain; flex: none; }
.brand .name { font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ghost { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--ink-2); }
.ghost:hover { background: var(--surface-2); }
.ghost.new { display: inline-flex; align-items: center; gap: 6px; }
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: none; color: var(--ink-2); flex: none;
}
.icon-btn:hover { background: var(--surface-2); }
@media (max-width: 760px) { .meter { display: none; } }
@media (max-width: 480px) {
  .ghost.new .label { display: none; }
  .ghost.new { width: 34px; height: 34px; padding: 0; justify-content: center; }
}

/* --- the conversation --------------------------------------------------- */
main { flex: 1; width: 100%; max-width: var(--measure); margin: 0 auto; padding: 24px 16px 8px; }
.banner { border-radius: var(--radius-s); padding: 10px 14px; margin-bottom: 16px; background: var(--warn-soft); color: var(--warn); }
.empty { padding: 12vh 0 24px; text-align: center; }
.welcome-logo { display: block; margin: 0 auto 18px; height: 72px; width: auto; max-width: 70%; object-fit: contain; }
.empty h1 { font-size: clamp(22px, 4vw, 30px); font-weight: 600; letter-spacing: -0.02em; margin: 0 0 20px; }
.starters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; color: var(--ink-2);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.turns { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 28px; }
.turn .q {
  margin-left: auto; max-width: 85%; width: fit-content; background: var(--accent-soft);
  padding: 10px 14px; border-radius: var(--radius) var(--radius) 4px var(--radius); white-space: pre-wrap;
}
.turn .a { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.stage { color: var(--ink-3); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.stage::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
@media (prefers-reduced-motion: reduce) { .stage::before { animation: none; } }
.foot { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.err { background: var(--bad-soft); color: var(--bad); border-radius: var(--radius-s); padding: 10px 14px; }

/* --- blocks (each renderer adds its own class on .block) ------------------ */
.block { min-width: 0; }
.block > .btitle { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px; }
.block > .bcap { font-size: 13px; color: var(--ink-3); margin: 6px 0 0; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4 { line-height: 1.3; letter-spacing: -0.01em; margin: 1.2em 0 .4em; }
.md h2 { font-size: 20px; } .md h3 { font-size: 17px; } .md h4 { font-size: 15px; }
.md code { font: 13px var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.md pre { background: var(--surface-2); padding: 12px 14px; border-radius: var(--radius-s); overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 0; padding-left: 14px; border-left: 3px solid var(--line); color: var(--ink-2); }
.notice { border-radius: var(--radius-s); padding: 8px 12px; font-size: 14px; background: var(--surface-2); color: var(--ink-2); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.pending { border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--ink-2); font-size: 14px; }
.pending .kind { font: 12px var(--mono); color: var(--ink-3); }
.pending details { margin-top: 6px; }
.pending pre { font: 12px var(--mono); max-height: 240px; overflow: auto; background: var(--surface-2); padding: 8px; border-radius: 6px; white-space: pre-wrap; }
.unsafe { font-size: 12px; color: var(--warn); margin-top: 4px; }

/* --- the composer ---------------------------------------------------------- */
.composer {
  position: sticky; bottom: 0; width: 100%; max-width: var(--measure); margin: 0 auto;
  padding: 10px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
  background: linear-gradient(to top, var(--bg) 75%, transparent);
}
/* 16px on the box: a phone zooms the page into any smaller field it focuses */
.composer textarea {
  resize: none; font: inherit; font-size: 16px; color: inherit; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 11px 14px; max-height: 40dvh; line-height: 1.45;
}
.composer textarea:focus { border-color: var(--accent); outline: none; }
.composer button {
  align-self: end; width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
}
.composer button:disabled { opacity: .45; cursor: default; }
.disclaimer { grid-column: 1 / -1; margin: 0; text-align: center; font-size: 12px; color: var(--ink-3); }

/* --- block content ---------------------------------------------------------- */
:lang(zh), :lang(ja), :lang(ko) { word-break: auto-phrase; line-break: strict; }
/* Han characters are shared by Chinese, Japanese and Korean but drawn differently in each:
   a block that says its language gets that language's font first. */
:lang(ja) { font-family: "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", "Noto Sans CJK JP", "Chat Noto Sans JP", var(--font); }
:lang(ko) { font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", "Chat Noto Sans KR", var(--font); }
:lang(zh), :lang(zh-Hans), :lang(zh-CN) { font-family: "PingFang SC", "Microsoft YaHei UI", "Noto Sans SC", "Noto Sans CJK SC", "Chat Noto Sans SC", var(--font); }
:lang(zh-Hant), :lang(zh-TW), :lang(zh-HK) { font-family: "PingFang TC", "Microsoft JhengHei UI", "Noto Sans TC", "Noto Sans CJK TC", "Chat Noto Sans TC", var(--font); }
.missing {
  border: 1px dashed var(--line); border-radius: var(--radius-s); padding: 14px; color: var(--ink-3);
  font-size: 14px; background: var(--surface-2);
}
figure { margin: 0; }
figcaption.bcap { margin-top: 6px; }

/* images */
.img-open, .thumb-open { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--radius-s); }
.img img {
  display: block; max-width: 100%; height: auto; max-height: min(70vh, 720px); margin: 0 auto;
  border-radius: var(--radius-s); background: var(--surface-2);
}
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.gallery img.thumb { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-s); background: var(--surface-2); }
.gallery .missing { aspect-ratio: 4 / 3; display: grid; place-items: center; text-align: center; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100dvh; width: 100vw; height: 100dvh; }
.lightbox::backdrop { background: rgb(0 0 0 / .86); }
.lightbox figure { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 56px 24px; }
.lightbox img { max-width: 100%; max-height: calc(100dvh - 120px); object-fit: contain; border-radius: 6px; }
.lightbox figcaption { color: #eee; font-size: 14px; margin-top: 10px; text-align: center; display: flex; gap: 12px; }
.lb-count { color: #aaa; font-variant-numeric: tabular-nums; }
.lb-nav, .lb-close {
  position: fixed; border: 0; background: rgb(255 255 255 / .12); color: #fff; border-radius: 50%;
  width: 44px; height: 44px; font-size: 26px; line-height: 1;
}
.lb-nav:hover, .lb-close:hover { background: rgb(255 255 255 / .24); }
.lb-prev { left: 8px; top: 50%; } .lb-next { right: 8px; top: 50%; } .lb-close { right: 8px; top: 8px; }

/* video */
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-s); overflow: hidden; }
.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* svg and diagrams */
figure.svg, figure.mermaid { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; overflow-x: auto; }
figure.svg svg { display: block; width: 100%; height: auto; max-height: 70vh; }
figure.mermaid svg { display: block; margin: 0 auto; height: auto; }
figure.mermaid .loading { color: var(--ink-3); font-size: 13px; }
pre.src { font: 12px var(--mono); background: var(--surface-2); padding: 8px; border-radius: 6px; white-space: pre-wrap; }

/* tables */
.tscroll { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; }
table.data th, table.data td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
/* each cell orders its own text by its script, but aligns with the table */
table.data td { unicode-bidi: plaintext; }
table.data:dir(ltr) td:not(.num) { text-align: left; }
table.data:dir(rtl) td:not(.num) { text-align: right; }
table.data th { position: sticky; top: 0; background: var(--surface-2); font-weight: 600; z-index: 1; }
table.data th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; }
table.data th button:focus-visible { outline: 2px solid var(--accent); }
table.data th[aria-sort="ascending"] button::after { content: "▲"; font-size: 10px; }
table.data th[aria-sort="descending"] button::after { content: "▼"; font-size: 10px; }
table.data .num { text-align: end; font-variant-numeric: tabular-nums; }
table.data tbody tr:last-child td { border-bottom: 0; }
.ttools { display: flex; gap: 14px; justify-content: flex-end; margin-top: 4px; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font-size: 13px; }

/* links */
.linkcard {
  display: grid; gap: 2px; text-decoration: none; color: inherit; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
}
.linkcard:hover { border-color: var(--accent); }
.linkcard .lt { color: var(--accent); font-weight: 600; }
.linkcard .lh, .linkcard .ln { color: var(--ink-3); font-size: 13px; }

/* charts */
figure.chart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 10px; }
figure.chart .plot { width: 100%; min-height: 60px; }
figure.chart .plot svg { max-width: 100%; height: auto; }
.vega-bindings { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.vega-bind { display: flex; align-items: center; gap: 6px; }
.vega-bind label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vega-bind-name { color: var(--ink-2); }
.vega-bind input[type="range"] { width: min(220px, 60vw); accent-color: var(--accent); }
.vega-bind select { font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.vega-bind input[type="checkbox"] { accent-color: var(--accent); }
.vega-bind span:last-child:not(.vega-bind-name) { font-variant-numeric: tabular-nums; color: var(--ink-3); min-width: 3.5em; }
.chart-data { margin-top: 8px; font-size: 13px; }
.chart-data summary { color: var(--accent); cursor: pointer; width: fit-content; }
.chart-data .table { margin-top: 8px; }

/* code apps */
.app { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.app-bar { display: flex; gap: 10px; align-items: center; padding: 8px 12px; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.app-tag { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--accent); background: var(--accent-soft); padding: 2px 6px; border-radius: 4px; }
/* transparent, and in the page's colour scheme, so an app that declares `color-scheme: light dark` follows the theme */
.app iframe { display: block; width: 100%; border: 0; background: transparent; color-scheme: inherit; }
.app-code { border-top: 1px solid var(--line); padding: 6px 12px; font-size: 13px; }
.app-code summary { color: var(--accent); cursor: pointer; width: fit-content; }
.app-code pre { font: 12px var(--mono); max-height: 320px; overflow: auto; background: var(--surface-2); padding: 8px; border-radius: 6px; }

/* --- smart layout ------------------------------------------------------------ */
.blocks { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.lay { min-width: 0; }
.lay-stack, .lay-hero { display: flex; flex-direction: column; gap: 14px; }
.lay-columns { display: grid; gap: 14px; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); align-items: start; }
.lay-columns[data-n="3"] { --n: 3; } .lay-columns[data-n="4"] { --n: 4; }
.lay-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-items: start; }
.lay-sidebar { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.lay-hero > :first-child { font-size: 1.02em; }
.lay-title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0; }
@media (max-width: 640px) {
  .lay-columns, .lay-sidebar { grid-template-columns: minmax(0, 1fr); }
}
.lay-tablist { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.lay-tablist [role="tab"] {
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 12px; color: var(--ink-2);
  font-size: 14px; margin-bottom: -1px;
}
.lay-tablist [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.lay-collapse { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.lay-collapse > summary { padding: 10px 14px; cursor: pointer; color: var(--ink-2); font-size: 14px; }
.lay-collapse[open] > summary { border-bottom: 1px solid var(--line); }
.lay-collapse > .lay-stack { padding: 12px 14px; }
.lay-carousel { position: relative; }
.lay-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.lay-slide { flex: 0 0 min(80%, 420px); scroll-snap-align: start; }
.lay-arrows { display: flex; justify-content: flex-end; gap: 6px; margin-top: 4px; }
.lay-arrows button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 18px; line-height: 1; }
.lay-switch { align-self: flex-end; margin-top: -6px; }
.dim { color: var(--ink-3); font-size: 13px; }

/* --- the canvas ------------------------------------------------------------------ */
.canvas-card { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--surface); padding: 12px 16px; }
.canvas-card p { margin: 0 0 10px; }
.canvas-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.canvas-open-btn { border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); padding: 6px 14px; font-size: 14px; }
.canvas {
  position: fixed; z-index: 20; top: 0; right: 0; bottom: 0; width: min(50vw, 760px);
  background: var(--bg); border-left: 1px solid var(--line); display: flex; flex-direction: column;
  box-shadow: -8px 0 24px rgb(0 0 0 / .08);
}
.canvas[hidden] { display: none; }
.canvas-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.canvas-head h2 { flex: 1; margin: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.canvas-body { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 960px) {
  body.canvas-open main, body.canvas-open .composer, body.canvas-open .top { margin-right: min(50vw, 760px); max-width: none; }
  body.canvas-open main, body.canvas-open .composer { width: auto; margin-left: 0; }
}
@media (max-width: 959px) {
  .canvas { width: 100vw; border-left: 0; box-shadow: none; }
  .canvas-head { padding-top: max(10px, env(safe-area-inset-top)); }
  .canvas-body { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}
body.no-scroll { overflow: hidden; }

/* --- the display panel --------------------------------------------------------- */
dialog.panel {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
  padding: 0; width: min(360px, calc(100vw - 32px)); margin: 60px 16px auto auto;
  box-shadow: 0 12px 40px rgb(0 0 0 / .18);
}
dialog.panel::backdrop { background: rgb(0 0 0 / .2); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 15px; }
.panel-body { padding: 8px 16px 16px; display: grid; gap: 14px; }
.panel-body fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
.panel-body legend { font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; padding: 6px 0; }
.opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-s); cursor: pointer; }
.opt:hover { background: var(--surface-2); }
.opt input { accent-color: var(--accent); margin: 0; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); flex: none;
  background: conic-gradient(var(--sw-accent) 0 50%, var(--sw-bg) 0); }
.swatch[data-scheme="paper"] { --sw-accent: #2f5bd3; --sw-bg: #f7f7f5; }
.swatch[data-scheme="slate"] { --sw-accent: #3358c4; --sw-bg: #f4f6f9; }
.swatch[data-scheme="forest"] { --sw-accent: #1f6f43; --sw-bg: #f6f6f1; }
.swatch[data-scheme="plum"] { --sw-accent: #6a3fb5; --sw-bg: #f8f6f9; }
.swatch[data-scheme="contrast"] { --sw-accent: #000000; --sw-bg: #ffffff; }
.opt-scheme[data-value=""] .swatch { display: none; }
@media (max-width: 480px) {
  dialog.panel { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: var(--radius) var(--radius) 0 0;
    padding-bottom: env(safe-area-inset-bottom); }
}

/* --- a source: the card a citation shows on hover; the side panel it opens on click ------- */
.cite-card {
  position: fixed; z-index: 30; max-width: min(420px, calc(100vw - 32px)); max-height: 260px; overflow: hidden;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface);
  color: var(--ink); box-shadow: 0 10px 30px rgb(0 0 0 / .18); font-size: 13px; pointer-events: none;
}
.cite-card blockquote { margin: 0 0 6px; }
.source-nav { display: flex; gap: 6px; align-items: center; }
.source-nav .dim { font-size: 12px; }

/* --- touch: every control at least 44px to the finger ------------------------------ */
@media (pointer: coarse) {
  .chip { padding: 10px 16px; }
  .icon-btn, .ghost.new { min-width: 44px; min-height: 44px; }
  .linkish, .chart-data summary, .app-code summary, .lay-collapse > summary { min-height: 44px; display: inline-flex; align-items: center; }
  .lay-tablist [role="tab"] { min-height: 44px; }
  .lay-arrows button { width: 44px; height: 44px; }
  .composer button { width: 48px; height: 48px; }
  .opt { min-height: 44px; }
}

/* --- artifacts on the canvas ------------------------------------------------------ */
.canvas-head { flex-wrap: wrap; row-gap: 8px; }
.canvas-tools { flex-basis: 100%; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.canvas-tools:empty { display: none; }
.canvas-tools select {
  font: inherit; font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px; max-width: min(100%, 360px);
}
.canvas-foot { border-top: 1px solid var(--line); padding: 10px 16px max(12px, env(safe-area-inset-bottom)); background: var(--bg); }
.composer-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.composer-form textarea {
  font: inherit; font-size: 16px; color: inherit; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 9px 12px; resize: vertical; min-height: 44px;
}
.composer-form .dim { grid-column: 1 / -1; }
.canvas-open-btn:disabled { opacity: .5; cursor: default; }
.answer-actions { display: flex; gap: 16px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.answer-actions .include-all { margin-right: auto; color: var(--ink-2); font-size: 13px; }
.share-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; font-size: 13px; margin-top: 6px; }
.share-line .share-url { flex: 1 1 260px; min-width: 0; font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: inherit; }

/* INCLUDED SOURCES (2026-10-25): a ticked citation's source inside the answer, under the part that cites it */
a.included { background: var(--accent-soft); border-radius: 4px; padding: 0 2px; }
figure.xclude { margin: 8px 0 12px; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; }
figure.xclude > figcaption { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
figure.xclude section.block { margin: 4px 0; }
.include-one { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; margin-left: 12px; }

/* ABOUT, left of the display button */
.about-btn { font-size: 13px; }
.about-panel .about-name { margin: 4px 0 0; font-size: 17px; }
.about-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 13px; }
.about-facts dt { color: var(--ink-2); }
.about-facts dd { margin: 0; }
.editor { display: flex; flex-direction: column; gap: 12px; }
.edit-row { border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); padding: 10px 12px; display: grid; gap: 8px; }
.edit-kind { font: 12px var(--mono); color: var(--ink-3); }
.edit-row textarea { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px; width: 100%; resize: vertical; }
.edit-row textarea.code { font: 12.5px var(--mono); }
.share-panel { border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); padding: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.share-panel p { margin: 0; flex-basis: 100%; font-size: 14px; color: var(--ink-2); }
.share-panel input { flex: 1; min-width: 0; font: 13px var(--mono); padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); }

/* --- a shared artifact, read-only, as the whole page ------------------------------------ */
body.shared-view .composer, body.shared-view #new, body.shared-view .meter { display: none; }
article.shared { display: flex; flex-direction: column; gap: 14px; }
article.shared h1 { font-size: clamp(22px, 4vw, 30px); letter-spacing: -0.02em; margin: 0; }

/* --- print: the canvas alone when it is open, else the conversation ----------------------- */
@media print {
  .top, .composer, .answer-actions, .lay-switch, .canvas-tools, .canvas-foot, #canvas-close, .lay-arrows { display: none !important; }
  body { background: #fff; color: #000; }
  body.canvas-open main { display: none; }
  .canvas { position: static; width: auto; box-shadow: none; border: 0; }
  .canvas-body { overflow: visible; }
  .lay-collapse { break-inside: avoid; }
  section.block { break-inside: avoid; }
  /* one answer printed (Print under it): its question, its answer and the sources included in it */
  body.print-one main { display: block !important; }
  body.print-one .canvas, body.print-one .empty, body.print-one .turn:not(.printing), body.print-one .share-line,
  body.print-one .foot { display: none !important; }
  figure.xclude { break-inside: avoid; }
}
@media (min-width: 960px) { body.canvas-open .meter { display: none; } }

/* maths (KaTeX): ink-coloured, scrolling sideways when wider than the column */
.math-block { display: block; margin: 0.6em 0; overflow-x: auto; overflow-y: hidden; padding: 2px 0; text-align: center; }
.math.pending, .math.unparsed { font-family: var(--mono); font-size: 0.92em; color: var(--ink-2); }
.math.unparsed { background: var(--surface-2); padding: 0 4px; border-radius: 4px; }
.katex { font-size: 1.08em; color: inherit; }
