/* the fonts, from static/fonts/ on this site, so no visitor request goes to Google; loaded here so that every page, also one built earlier, gets them from this file: Inter for text, STIX Two Text for "Bottled", JetBrains Mono for numbers, code and traces */
@import url("fonts/fonts.css");

/* The page sits on the paper's prompt cream, with figures that run wider. Colours are the paper's figure palette (scripts/paper_plots.py), darkened: near-black and grey carry the page, a deep plum takes the place of the magenta. */
:root {
  --c-bottled: #6E3569;      /* STAI magenta #AC53A8, darkened to plum: the bottled arm */
  --c-bottled-deep: #4A2747; /* darker still: the bottled half of the cost block */
  --c-gap: #E3D8DE;          /* greyed tint of the plum: the gap up to zero-shot */
  --c-ahead: #D9820F;        /* STAI orange #FF9F19, darkened: bottled beats zero-shot */
  --c-zero-shot: #222322;    /* STAI near-black: the zero-shot arm */

  --bg: #FAF6F0;             /* paper prompt cream */
  --bg-raised: #F1ECE4;
  --text: #222322;           /* STAI near-black */
  --text-muted: #5F5B55;     /* towards STAI dark grey #3F3F3E */
  --rule: #DED7CC;

  --font-text: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-bench: "STIX Two Text", "Times New Roman", Times, serif;  /* only for "Bottled" in small caps, the paper's \textsc{Bottled} */
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;

  --prose-width: none;      /* full width: text and figures span the window, less the page gutters */
  --figure-width: none;
}


/* page */
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-text); font-size: 18px; line-height: 1.6; }
main { padding: 0 16px 4rem; }
@media (min-width: 700px) { body > main { width: 90%; margin: 0 auto; box-sizing: border-box; } }  /* the landing and task pages' content: 90% of the window, centred; on a phone the full width less the gutters; run pages keep their own layout (their main sits inside .run-layout) */
a { color: var(--c-bottled); }
section { margin: 4.5rem auto 0; }
.prose { max-width: var(--prose-width); margin-left: auto; margin-right: auto; }
h2 { font-size: 1.6rem; font-weight: 600; margin: 0 0 0.8rem; }
.section-number { color: var(--c-bottled); font-family: var(--font-mono); font-size: 1rem; margin-right: 0.6rem; vertical-align: 0.15em; }
.bottled-word { color: var(--c-bottled); font-weight: 600; }
.zero-shot-word { font-weight: 600; }
.number { font-family: var(--font-mono); font-size: 0.85rem; text-align: right; font-variant-numeric: tabular-nums; }
.caption, figcaption { color: var(--text-muted); font-size: 0.9rem; font-style: italic; }

/* 0. top bar on the main page: the name at the left, the links at the right */
.site-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem; padding: 0.6rem clamp(16px, 3vw, 2.5rem); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid transparent; transition: border-color 0.2s, box-shadow 0.2s; }
.site-bar.scrolled { border-bottom-color: var(--rule); box-shadow: 0 4px 14px rgba(34, 35, 34, 0.06); }  /* static/site_bar.js adds .scrolled once the page has scrolled */
.site-bar-name { font-size: 1.25rem; color: var(--text); text-decoration: none; }
.site-bar-links { margin-left: auto; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.site-bar-link { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.9rem; border: 1px solid var(--rule); border-radius: 999px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text); text-decoration: none; background: var(--bg-raised); transition: border-color 0.15s, background 0.15s; }
.site-bar-link:hover { border-color: var(--c-bottled); color: var(--c-bottled); }
.site-bar-link svg { width: 1em; height: 1em; flex: none; }

/* 1. title block: centred, like the paper's first page */
.title-block { text-align: center; padding: 1.4rem 16px 0.3rem; margin: 0 auto; }
.title-block .name { font-size: 1rem; margin: 0 0 0.25rem; }
/* \textsc{Bottled}, the paper's \bench macro */
.bench { font-family: var(--font-bench); font-variant-caps: small-caps; letter-spacing: 0.04em; }
.title-block h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 600; line-height: 1.05; margin: 0 0 0.45rem; }
.title-block .question { font-size: 1.05rem; font-style: italic; color: var(--text-muted); margin: 0; }
#setup { margin-top: 1.6rem; }  /* the first section, close below the title block */
/* authors and affiliations: two lines of names, and the affiliations with numbered plum badges */
.authors { margin: 1.3rem auto 0; }
.author-line { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.15rem 1.6rem; margin: 0; font-size: 1rem; }
.author-line + .author-line { margin-top: 0.2rem; }
.author-line a { color: var(--text); text-decoration: none; background: linear-gradient(var(--c-bottled), var(--c-bottled)) no-repeat 0 100% / 0 2px; padding-bottom: 2px; transition: background-size 0.25s ease, color 0.2s; }
.author-line a:hover { color: var(--c-bottled); background-size: 100% 2px; }
.author-line sup { margin-left: 0.15em; font-family: var(--font-mono); font-size: 0.55em; font-weight: 600; color: var(--c-bottled); }
.affiliations { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem 1.8rem; max-width: 58rem; margin: 0.6rem auto 0; padding: 0; font-size: 0.78rem; color: var(--text-muted); }
.affiliations li { display: inline-flex; align-items: center; gap: 0.5rem; }
.affiliations b { display: inline-grid; place-items: center; flex: none; width: 1.25rem; height: 1.25rem; border-radius: 50%; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; color: #fff; background: var(--c-bottled); }

/* 2. the two costs: dark half for zero-shot, magenta half for bottled */
.two-costs { display: grid; grid-template-columns: 1fr 1fr; max-width: var(--figure-width); margin: 0 auto; padding: 0 16px; }
.cost-side { padding: 2.2rem 2rem; }
.cost-side.zero-shot { background: var(--c-zero-shot); color: var(--bg); border-radius: 8px 0 0 8px; }
.cost-side.bottled { background: var(--c-bottled-deep); color: #F4EEF3; border-radius: 0 8px 8px 0; }
.cost-label { margin: 0; font-size: 1.05rem; font-style: italic; opacity: 0.85; }
.cost-range { margin: 0.4rem 0 0.2rem; font-family: var(--font-mono); font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 600; letter-spacing: -0.02em; }
.cost-unit { margin: 0; font-size: 0.9rem; opacity: 0.75; }
@media (max-width: 640px) {
  .two-costs { grid-template-columns: 1fr; }
  .cost-side.zero-shot { border-radius: 8px 8px 0 0; }
  .cost-side.bottled { border-radius: 0 0 8px 8px; }
}

/* 3. setup figure: the schematic, the full width of the window less the 16px page gutters */
.schematic { margin: 2rem 0 0; padding: 0 1.5rem; }
.schematic img { display: block; width: 100%; height: auto; border-radius: 8px; }
.schematic svg { display: block; width: 100%; height: auto; border-radius: 8px; }
.schematic figcaption { margin-top: 0.8rem; }

/* 4. results */
#results { max-width: var(--figure-width); }
.views { overflow-x: auto; margin-top: 1.6rem; }
/* tabs: the radio buttons are hidden; their labels are the tabs, and each checked one shows its panel */
.views input { position: absolute; opacity: 0; pointer-events: none; }
.views label { display: inline-block; font-family: var(--font-mono); font-size: 0.85rem; padding: 0.4rem 0.9rem; margin-right: 0.3rem; cursor: pointer; color: var(--text-muted); border-bottom: 2px solid transparent; }
.views input:checked + label { color: var(--text); border-bottom-color: var(--c-bottled); }
.views input:focus-visible + label { outline: 2px solid var(--c-bottled); }
.panel { display: none; margin-top: 1rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
/* the bar plot and the cost plot side by side; one above the other on a narrow screen */
.plot-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.plot-pair figure { margin: 0; }
@media (max-width: 900px) { .plot-pair { grid-template-columns: 1fr; } }
/* the figures from build_figures.py, inline: capped so their 7 pt text shows at about 14 px; their text takes the page serif in place of the STIXGeneral that matplotlib measured it in */
.plot-pair svg { display: block; width: 100%; max-width: 620px; height: auto; margin: 0 auto; }
.plot-pair svg text { font-family: var(--font-text) !important; }
#view-all:checked ~ #panel-all,
#view-mave:checked ~ #panel-mave,
#view-esci:checked ~ #panel-esci,
#view-raid:checked ~ #panel-raid { display: block; }


/* 4b. task links: one card per task under the result figures, each a link to its detailed results page */
.task-links { margin-top: 2.5rem; padding: 1rem; margin-left: -1rem; margin-right: -1rem; border-radius: 10px; scroll-margin-top: 5rem; }  /* clear of the sticky top bar */
/* after a click on "Detailed results and traces", the row glows plum and fades back over 2.5 s; :target matches the element the URL fragment names */
.task-links:target { animation: highlight-target 2.5s ease-out; }
@keyframes highlight-target {
  0%, 30% { background: color-mix(in srgb, var(--c-bottled) 14%, transparent); box-shadow: 0 0 0 2px var(--c-bottled); }
  100% { background: transparent; box-shadow: 0 0 0 2px transparent; }
}
.task-links-title { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 0.8rem; }
.task-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.task-card { display: flex; flex-direction: column; gap: 0.35rem; padding: 1.1rem 1.25rem; border: 1px solid var(--rule); border-top: 3px solid var(--c-bottled); border-radius: 6px; background: var(--bg-raised); color: var(--text); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.task-card:hover { border-color: var(--c-bottled); transform: translateY(-2px); }
.task-card-name { font-family: var(--font-mono); font-weight: 600; font-size: 1.05rem; color: var(--c-bottled); }
.task-card-job { font-size: 1rem; }
.task-card-meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); }
.contaminated-run { margin: 1rem 0 0; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }
.contaminated-run a { color: var(--c-bottled); }
/* 3. takeaways: numbered list; each item a claim in large type and its evidence below, full width */
.takeaways-lead { margin: 0 0 1.5rem; font-style: italic; color: var(--text-muted); }
.takeaways { list-style: none; counter-reset: takeaway; margin: 0; padding: 0; }
.takeaway { counter-increment: takeaway; display: grid; grid-template-columns: 4rem minmax(0, 1fr); padding: 2.2rem 0; border-top: 1px solid var(--rule); }
.takeaway > * { grid-column: 2; }
.takeaway:last-child { border-bottom: 1px solid var(--rule); }
.takeaway::before { content: counter(takeaway, decimal-leading-zero); grid-column: 1; grid-row: 1; padding-top: 0.75rem; font-family: var(--font-mono); font-size: 1rem; font-weight: 600; letter-spacing: 0.04em; color: var(--c-bottled); }
.takeaway-claim { grid-row: 1; margin: 0 0 0.9rem; font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.takeaway-body { margin: 0; font-size: 1.05rem; }
.takeaway > p { margin: 0; font-size: 1.05rem; }  /* every paragraph of a takeaway, also one without the class, in the same size */
.takeaway > p + p { margin-top: 0.8rem; }
.takeaway code { padding: 0.1em 0.4em; border-radius: 4px; font-family: var(--font-mono); font-size: 0.85em; background: var(--bg-raised); border: 1px solid var(--rule); }  /* inline code in a takeaway, e.g. the proxy's message */
.takeaway-table { display: block; max-width: 100%; overflow-x: auto; justify-self: start; margin-top: 1rem; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.85rem; }
.takeaway-table th { padding: 0.35rem 1.5rem 0.35rem 0; text-align: left; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--rule); }
.takeaway-table td { padding: 0.35rem 1.5rem 0.35rem 0; font-variant-numeric: tabular-nums; }
.takeaway-table .num { text-align: right; }
.takeaway-table .metric { color: var(--text-muted); font-size: 0.75rem; }
.takeaway-table .bottled-low { color: var(--c-bottled); font-weight: 600; }
.takeaway-table .what { font-family: var(--font-text); font-size: 0.95rem; min-width: 16rem; max-width: 34rem; }  /* min-width: on a narrow window the table scrolls sideways; the remarks do not shrink to a word per line */
.takeaway-table td { vertical-align: top; }
.takeaway-table td:has(.kept-bar) { white-space: nowrap; }
.kept-bar { display: inline-block; width: 6rem; height: 0.55rem; margin-right: 0.6rem; vertical-align: 0.05em; border-radius: 999px; background: var(--c-gap); overflow: hidden; }
.kept-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--c-bottled); }
.takeaway-table tfoot td { padding-top: 0.15rem; }
.takeaway-table .note { font-family: var(--font-text); font-style: italic; font-size: 0.9rem; color: var(--c-bottled); white-space: nowrap; }
.takeaway-table .group-label td { padding-top: 1rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-bottled); border-bottom: 1px solid var(--rule); }
.trace-pills { display: flex; gap: 0.9rem; }
.trace-pills .run-link { margin-right: 0; }
.exhibit { margin-top: 1rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg-raised); }
.exhibit summary { padding: 0.6rem 1rem; cursor: pointer; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }
.exhibit[open] summary { border-bottom: 1px solid var(--rule); }
.exhibit-row { padding: 0.8rem 1rem 0; }
.exhibit-speaker { display: block; margin-bottom: 0.3rem; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.exhibit blockquote { margin: 0; padding-left: 0.9rem; border-left: 2px solid var(--c-bottled); font-style: italic; }
.verdict { margin-left: 0.4rem; padding: 0.05rem 0.45rem; border-radius: 3px; font-size: 0.7rem; letter-spacing: 0.06em; color: #fff; background: var(--c-ahead); }
.exhibit-links { display: flex; gap: 1.5rem; margin: 0; padding: 0.9rem 1rem; font-family: var(--font-mono); font-size: 0.8rem; }
.task-card-arrow { margin-top: 0.4rem; font-family: var(--font-mono); font-size: 0.8rem; color: var(--c-bottled); }

/* 6. citation */
#cite { scroll-margin-top: 5rem; }  /* clear of the sticky top bar */
.cite-lead { margin: 0 0 1rem; color: var(--text-muted); }
.bibtex { width: fit-content; max-width: 100%; overflow: hidden; border: 1px solid var(--rule); border-radius: 12px; background: #FFFFFF; }
.bibtex-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.6rem 0.7rem 0.6rem 1.25rem; background: var(--bg-raised); border-bottom: 1px solid var(--rule); }
.bibtex-format { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.bibtex pre { margin: 0; padding: 1.4rem 1.5rem; font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.75; color: var(--text); overflow-x: auto; }  /* one line per field; the card is as wide as the longest field, and scrolls on a narrow screen */
.bib-type { color: var(--c-bottled); font-weight: 600; }
.bib-key { color: var(--c-bottled); }
.bib-field { color: var(--text-muted); }
.bib-url { color: var(--c-bottled); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--c-bottled) 35%, transparent); text-underline-offset: 3px; }
.bib-url:hover { text-decoration-color: var(--c-bottled); }
.copy { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.95rem; border: none; border-radius: 8px; font-family: var(--font-text); font-size: 0.85rem; font-weight: 600; cursor: pointer; color: #FFFFFF; background: var(--c-bottled); transition: background 0.14s ease-out, transform 0.14s ease-out; }
.copy svg { width: 1em; height: 1em; }
.copy:hover { background: var(--c-bottled-deep); }
.copy:active { transform: scale(0.97); }
.copy:focus-visible { outline: 2px solid var(--c-bottled); outline-offset: 2px; }
.copy.copied { background: var(--c-bottled-deep); }

/* task pages (templates/task.html) */
/* 1. title */
.task-header { padding: 2.5rem 16px 1.5rem; }
.back-link { font-family: var(--font-text); font-size: 1rem; color: var(--text-muted); text-decoration: none; }
.back-link:hover { color: var(--c-bottled); }
.task-header h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 600; margin: 1.2rem 0 0.3rem; }
.task-job { font-size: 1.2rem; font-style: italic; color: var(--text-muted); margin: 0 0 0.4rem; }
.task-facts { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* 2. run table: a zero-shot group and two bottled groups, each group separated by a rule */
.run-table-section { margin-top: 1.5rem; }
.run-table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg-raised); }
.run-table { width: 100%; border-collapse: collapse; font-size: 0.98rem; white-space: nowrap; }
.run-table th, .run-table td { padding: 0.6rem 1rem; text-align: right; }
.run-table .model-column { text-align: left; }
.run-table thead th { font-weight: 400; color: var(--text-muted); }
.run-table .group-row th { font-family: var(--font-text); font-size: 1rem; font-weight: 600; color: var(--text); padding-top: 0.9rem; }
.run-table .group-row .model-column { vertical-align: bottom; }
.run-table .group { text-align: center; border-left: 1px solid var(--rule); }
.run-table .bottled-group { color: var(--c-bottled); }
.run-table .column-row th { font-family: var(--font-mono); font-size: 0.75rem; border-bottom: 1px solid var(--rule); }
.run-table .column-row th:nth-child(3n) { border-left: 1px solid var(--rule); }   /* the first column of each group: 1st, 3rd and 6th of this row, which has no model cell */
.run-table .column-row th:first-child { border-left: 1px solid var(--rule); }
.run-table tbody tr + tr td { border-top: 1px solid color-mix(in srgb, var(--rule) 60%, transparent); }
.run-table tbody tr:hover td { background: color-mix(in srgb, var(--c-bottled) 5%, transparent); }
.run-table td.model-column { font-weight: 600; }
.run-table .score, .run-table .cost { font-family: var(--font-mono); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.run-table .cost { color: var(--text-muted); }
.run-table td:nth-child(2), .run-table .group-start { border-left: 1px solid var(--rule); }
.run-table .bottled-score { color: var(--c-bottled); font-weight: 600; }
.run-table .trace { text-align: left; }
.run-link { display: inline-flex; align-items: center; gap: 0.35rem; margin-right: 0.9rem; padding-bottom: 1px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--c-bottled); text-decoration: none; background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px; transition: background-size 0.2s ease, color 0.2s; }
.run-link:last-child { margin-right: 0; }
.run-link:hover { color: var(--c-bottled-deep); background-size: 100% 1px; }
.run-link svg { width: 0.95em; height: 0.95em; flex: none; opacity: 0.75; }
.verdict-tag { display: inline-flex; align-items: center; gap: 0.3rem; margin-left: 0.4rem; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); }
.verdict-tag::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--text-muted); }
.verdict-clean::before { background: #4E8A5B; }
.verdict-contaminated::before { background: var(--c-ahead); }
.page-notes { display: flex; gap: 0.9rem; align-items: flex-start; margin: 0 0 2.2rem; padding: 1rem 1.25rem; border-radius: 10px; background: color-mix(in srgb, var(--c-bottled) 6%, var(--bg)); border: 1px solid color-mix(in srgb, var(--c-bottled) 18%, transparent); }
.page-notes-icon { width: 1.15rem; height: 1.15rem; flex: none; margin-top: 0.2rem; color: var(--c-bottled); }
.page-notes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; font-size: 0.95rem; line-height: 1.55; }
.page-notes b { color: var(--c-bottled); font-weight: 600; }
.page-notes .verdict-tag { margin-left: 0; }

.run-facts { display: flex; flex-wrap: wrap; gap: 0.6rem 2.2rem; margin: 1.4rem 0 0.8rem; }
.run-facts dt { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.run-facts dd { margin: 0.15rem 0 0; font-family: var(--font-mono); font-size: 1.3rem; font-weight: 600; color: var(--c-bottled); }
.run-status { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; }
.run-flag { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 400; padding: 0.2rem 0.6rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--bg-raised); color: var(--text-muted); }

/* run pages (templates/run.html): one block per agent turn */
.turn-list { list-style: none; padding: 0; margin: 0 auto; max-width: 1100px; }
.turn { padding: 1.4rem 0; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 0.7rem; }
.turn-meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); margin: 0; }
.turn-error { font-family: var(--font-mono); font-size: 0.8rem; color: #9b2c2c; margin: 0; padding: 0.4rem 0.7rem; border-left: 3px solid #9b2c2c; background: #f6e7e4; }
.turn-text { margin: 0; font-size: 1.05rem; display: flex; gap: 0.7rem; align-items: baseline; }
.said-label { flex: none; font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-bottled); }
.no-output { font-style: italic; color: #a39a8c; }

/* thinking: folded, with the first line as a preview; open, it reads as prose */
.thinking { border-left: 3px solid var(--c-gap); padding-left: 0.9rem; }
.thinking summary { cursor: pointer; list-style: none; display: flex; gap: 0.7rem; align-items: baseline; }
.thinking summary::-webkit-details-marker { display: none; }
.thinking-label { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-bottled); flex: none; }
.thinking-label::before { content: "▸ "; }
.thinking[open] .thinking-label::before { content: "▾ "; }
.thinking-preview { font-style: italic; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thinking[open] .thinking-preview { display: none; }
.thinking-body { font-style: italic; color: #4a4540; line-height: 1.65; }
.thinking-body p { margin: 0.6rem 0; }

/* bash: a dark terminal window */
.terminal { border-radius: 8px; overflow: hidden; background: #1e1c1a; box-shadow: 0 1px 0 rgba(0,0,0,0.04); }
.terminal-bar { display: flex; align-items: center; gap: 0.8rem; padding: 0.4rem 0.8rem; background: #2b2825; color: #a39a8c; font-family: var(--font-mono); font-size: 0.72rem; }
.terminal-dots { display: flex; gap: 0.35rem; }
.terminal-dots i { width: 0.65rem; height: 0.65rem; border-radius: 50%; }
.terminal-dots i:nth-child(1) { background: #ff5f57; }
.terminal-dots i:nth-child(2) { background: #febc2e; }
.terminal-dots i:nth-child(3) { background: #28c840; }
.terminal-timeout { margin-left: auto; }
.terminal-screen { margin: 0; padding: 0.8rem 1rem; max-height: 28rem; overflow: auto; font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.5; color: #d9d2c5; white-space: pre-wrap; word-break: break-word; }
.terminal-prompt { color: #d9a441; font-weight: 600; }
.terminal-command { color: #f4efe6; font-weight: 600; }
.terminal-output { color: #b9b1a3; }


/* every tool other than bash: a card in two parts, "agent called" on top and "returned" below */
.tool-card { border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: #fff; }
.tool-card-call, .tool-card-result { display: flex; gap: 0.9rem; align-items: flex-start; padding: 0.55rem 0.9rem; }
.tool-card-call { background: var(--bg-raised); border-bottom: 1px solid var(--rule); }
.tool-card-result { border-top: 1px solid var(--rule); }
.tool-card-body + .tool-card-result, .tool-card-call + .tool-card-result { border-top: none; }
.tool-tag { flex: none; width: 6.5rem; padding-top: 0.1rem; font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.tool-card-call .tool-tag { color: var(--c-bottled); }
.tool-signature { font-family: var(--font-mono); font-size: 0.82rem; font-weight: 600; color: var(--text); word-break: break-all; }
.tool-card-body { margin: 0; padding: 0.8rem 1rem 0.8rem 8.3rem; max-height: 26rem; overflow: auto; font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; border-bottom: 1px solid var(--rule); }
.tool-result-text { margin: 0; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.tool-result-fields { display: flex; flex-wrap: wrap; gap: 0.3rem 1.8rem; margin: 0; }
.tool-result-fields dt { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted); }
.tool-result-fields dd { margin: 0; font-family: var(--font-mono); font-size: 0.9rem; font-weight: 600; color: var(--text); }

/* the prompt above the turns */
.prompt-section { max-width: 1100px; margin: 0 auto 2rem; }
.prompt-card { border: 1px solid var(--rule); border-left: 3px solid var(--c-bottled); border-radius: 8px; background: #fff; padding: 1rem 1.3rem; }
.prompt-label { margin: 0 0 0.6rem; font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-bottled); }
.prompt-text { white-space: pre-wrap; word-break: break-word; font-size: 0.98rem; line-height: 1.6; max-height: 32rem; overflow: auto; }
.system-prompt { margin-bottom: 0.7rem; }
.system-prompt summary { cursor: pointer; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }
.system-prompt .prompt-text { margin-top: 0.5rem; padding: 0.8rem 1.1rem; background: var(--bg-raised); border-radius: 6px; font-size: 0.9rem; color: var(--text-muted); }


/* run pages: the explorer as a sidebar at the left, the prompt and the turns at the right */
.run-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.run-layout > main { padding: 1.5rem 2rem 4rem; }
.explorer { position: sticky; top: var(--header-height, 0px); height: calc(100vh - var(--header-height, 0px)); overflow: auto; background: var(--bg-raised); border-right: 1px solid var(--rule); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 12.5px; }
.explorer-head { padding: 0.9rem 0.9rem 0.6rem; border-bottom: 1px solid var(--rule); }
.explorer-title { margin: 0 0 0.3rem; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.explorer-sub { margin: 0; font-size: 0.75rem; line-height: 1.4; color: var(--text-muted); }
.explorer-sub b { color: var(--text); }
.explorer-tree { padding: 0.4rem 0 1.5rem; }
.fs-row { display: flex; align-items: center; gap: 4px; height: 22px; padding: 0 10px 0 calc(6px + var(--depth) * 12px); white-space: nowrap; cursor: default; }
.fs-row:hover { background: color-mix(in srgb, var(--c-bottled) 8%, transparent); }
summary.fs-row { cursor: pointer; list-style: none; }
summary.fs-row::-webkit-details-marker { display: none; }
.fs-chevron, .fs-chevron-space { width: 16px; height: 16px; flex: none; }
.fs-chevron { fill: none; stroke: var(--text-muted); stroke-width: 1.5; transition: transform 0.1s; }
details[open] > summary .fs-chevron { transform: rotate(90deg); }
.fs-icon { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--text-muted); stroke-width: 1.2; stroke-linejoin: round; stroke-linecap: round; }
.fs-icon-folder { fill: #c9a86a; stroke: #c9a86a; fill-opacity: 0.35; }
.fs-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; color: var(--text); }
.fs-meta { margin-left: auto; padding-left: 10px; flex: none; font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.fs-dim .fs-name { opacity: 0.6; }
.fs-children { position: relative; }
.fs-children::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(14px + var(--depth) * 12px); border-left: 1px solid var(--rule); }
.fs-ext-py .fs-icon { stroke: #3572a5; }
.fs-ext-json .fs-icon, .fs-ext-jsonl .fs-icon { stroke: #b8860b; }
.fs-ext-md .fs-icon, .fs-ext-txt .fs-icon { stroke: #6a737d; }
.fs-ext-sh .fs-icon, .fs-ext-log .fs-icon { stroke: #4e9a06; }
.fs-ext-csv .fs-icon { stroke: #2e8b57; }
@media (max-width: 900px) {
  .run-layout { grid-template-columns: minmax(0, 1fr); }
  .explorer { position: static; height: auto; max-height: 45vh; border-right: 0; border-bottom: 1px solid var(--rule); }
}

/* run pages: the file viewer, over the turns, at the right of the explorer */
.fs-file { cursor: pointer; }
.fs-file.selected { background: color-mix(in srgb, var(--c-bottled) 16%, transparent); }
.viewer { position: fixed; top: var(--header-height, 0px); right: 0; bottom: 0; left: 300px; z-index: 5; display: flex; flex-direction: column; background: #fff; border-left: 1px solid var(--rule); box-shadow: -6px 0 18px rgba(0, 0, 0, 0.06); }
.viewer[hidden] { display: none; }
.viewer-bar { display: flex; align-items: center; gap: 1rem; height: 38px; padding: 0 0.6rem 0 1rem; border-bottom: 1px solid var(--rule); background: var(--bg-raised); font-family: var(--font-mono); font-size: 0.78rem; }
.viewer-path { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-meta { color: var(--text-muted); white-space: nowrap; }
.viewer-close { margin-left: auto; border: 0; background: none; font-size: 1.3rem; line-height: 1; width: 28px; height: 28px; border-radius: 5px; color: var(--text-muted); cursor: pointer; }
.viewer-close:hover { background: color-mix(in srgb, var(--c-bottled) 10%, transparent); color: var(--text); }
.viewer-body { flex: 1; overflow: auto; }
.viewer-message { margin: 1.2rem 1rem; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }
.viewer-code { display: flex; min-width: max-content; font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.55; }
.viewer-gutter { margin: 0; padding: 0.8rem 0.8rem 0.8rem 1rem; text-align: right; color: #b9b1a3; user-select: none; background: var(--bg-raised); border-right: 1px solid var(--rule); }
.viewer-text { margin: 0; padding: 0.8rem 1rem; }
.viewer-text code.hljs { padding: 0; background: none; }
@media (max-width: 900px) { .viewer { left: 0; } }

/* run pages: the site bar and the run header together, fixed at the top; static/run.js measures this block as the header */
.page-top { position: sticky; top: 0; z-index: 7; }
.page-top .site-bar, .page-top .site-bar.scrolled { position: static; border-bottom: none; box-shadow: none; padding-bottom: 0.2rem; }  /* one block with the run header: one line, under the run header */
/* run pages: the header, one row across the page, fixed at the top; static/run.js puts its height in --header-height for the explorer and the viewer */
.run-header { position: sticky; top: 0; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 2rem; padding: 0.7rem 1.2rem; background: var(--bg); border-bottom: 1px solid var(--rule); }
.run-header .back-link { font-size: 0.95rem; }
.run-title h1 { margin: 0; font-size: 1.45rem; font-weight: 600; line-height: 1.1; }
.run-title p { margin: 0.1rem 0 0; font-size: 0.9rem; font-style: italic; color: var(--text-muted); }
.run-header .run-facts { margin: 0; gap: 0.4rem 1.6rem; }
.run-header .run-facts dd { font-size: 1.05rem; }
.run-header .run-status { margin-left: auto; }

/* run pages: the config as a JSON tree */
.json-tree { margin-top: 0.5rem; padding: 0.6rem 0.4rem; background: #fff; border: 1px solid var(--rule); border-radius: 6px; font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.7; }
.json-node > .json-node { padding-left: 1.1rem; }  /* each level indents its children */
.json-node > .json-leaf { padding-left: 2.05rem; }  /* and a value, which has no fold arrow, by the arrow's width more, so its key lines up with the keys of the folding entries beside it */
.json-node > summary { cursor: pointer; list-style: none; }
.json-node > summary::-webkit-details-marker { display: none; }
.json-node > summary::before { content: "▸ "; color: var(--text-muted); }
.json-node[open] > summary::before { content: "▾ "; }
.json-tree > .json-leaf { padding-left: 0.95rem; }  /* a top-level value lines up with the keys after a fold arrow */
.json-key { color: var(--c-bottled); }
.json-key::after { content: ": "; color: var(--text-muted); }
.json-count { color: var(--text-muted); }
.json-string { color: #2e7d32; word-break: break-all; }
.json-number { color: #1565c0; }
.json-literal { color: #b26a00; }

/* run pages: each turn's request and response, folded rows that open to a JSON tree */
.turn-objects { display: flex; flex-direction: column; gap: 0.3rem; }
.json-object > summary { cursor: pointer; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }
.json-object > summary::before { content: "{ } "; color: var(--c-bottled); }
.json-object .json-tree { max-height: 32rem; overflow: auto; }
.json-tree .json-string { white-space: pre-wrap; }

/* run pages: the agent's own API calls, a folded group after the turn they follow */
.api-group { padding: 0.6rem 0 0.9rem; border-top: 1px dashed var(--rule); }
.api-group > details > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; align-items: baseline; padding: 0.45rem 0.8rem; border: 1px solid var(--rule); border-left: 3px solid #5f5b55; border-radius: 6px; background: var(--bg-raised); font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }
.api-group > details > summary::-webkit-details-marker { display: none; }
.api-group > details > summary::before { content: "▸"; color: var(--text-muted); }
.api-group > details[open] > summary::before { content: "▾"; }
.api-group-title { font-weight: 600; color: var(--text); }
.api-calls { list-style: none; margin: 0.4rem 0 0 1rem; padding: 0 0 0 0.8rem; border-left: 1px solid var(--rule); max-height: 40rem; overflow: auto; }
.api-call { padding: 0.35rem 0; display: flex; flex-direction: column; gap: 0.2rem; }
.api-call + .api-call { border-top: 1px solid color-mix(in srgb, var(--rule) 60%, transparent); }
.api-call-meta { margin: 0; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text); }

/* run pages: the search in the header; matches in shown text are marked with the CSS Custom Highlight API, a matching API call of the agent's code gets an outline */
.run-search { display: flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.78rem; }
.run-search input { width: 14rem; padding: 0.3rem 0.6rem; border: 1px solid var(--rule); border-radius: 6px; background: #fff; font: inherit; color: var(--text); }
.run-search input:focus { outline: 2px solid color-mix(in srgb, var(--c-bottled) 40%, transparent); border-color: var(--c-bottled); }
.run-search-count { min-width: 4.5rem; color: var(--text-muted); }
.run-search button { width: 1.8rem; height: 1.8rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg-raised); color: var(--text); cursor: pointer; }
.run-search button:hover { border-color: var(--c-bottled); }
::highlight(search) { background-color: #f6e27a; color: inherit; }
::highlight(search-current) { background-color: #ff9f19; color: #000; }
.api-call.search-current { outline: 2px solid #ff9f19; outline-offset: 2px; border-radius: 4px; }

/* footer: the affiliations' logos in colour on a white band the full width of the window, since the logos are made for white; two centred rows; each logo's height is set on its img, from its area */
.site-footer { margin-top: 5rem; padding: 4.5rem 16px 5rem; background: #FFFFFF; }
.logo-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2.4rem 4.5rem; max-width: 1400px; margin: 0 auto; }
.logo-row + .logo-row { margin-top: 3.2rem; }
.logo img { display: block; width: auto; max-width: 100%; }
.footer-license { margin: 3.5rem 0 0; text-align: center; font-size: 0.85rem; color: var(--text-muted); }
.footer-license a { color: var(--text-muted); text-underline-offset: 3px; }
.footer-license a:hover { color: var(--c-bottled); }

/* canary strings at the bottom of every page: small, grey, centred */
.canary { margin: 2.5rem auto 0; max-width: 60rem; text-align: center; font-size: 0.72rem; line-height: 1.5; color: var(--text-muted); opacity: 0.6; overflow-wrap: anywhere; }
.canary p { margin: 0.15rem 0; }
.page-canary { padding: 0 16px 3rem; }

/* 404 page: the code large and faint, the message, links back */
.not-found { max-width: 40rem; margin: 0 auto; padding: 7rem 16px 5rem; text-align: center; }
.not-found-code { margin: 0; font-family: var(--font-mono); font-size: 4.5rem; font-weight: 600; line-height: 1; color: color-mix(in srgb, var(--c-bottled) 30%, transparent); }
.not-found h1 { margin: 1rem 0 1.4rem; font-size: 1.8rem; font-weight: 600; }
.not-found-links { margin: 0; color: var(--text-muted); }

/* narrow windows, also a wide window zoomed in: the top bar shows its links as icons only; the takeaway numbers take less room; the two diagrams keep a readable size and scroll sideways inside their box */
@media (max-width: 700px) {
  .site-bar-label { display: none; }
  .site-bar-link { padding: 0.45rem 0.6rem; }
  .takeaway { grid-template-columns: 2.4rem minmax(0, 1fr); }
  .schematic { overflow-x: auto; padding: 0; }
  .schematic svg { min-width: 680px; }
}
