/* Paper: the Verbatus design system. Tokens, type and components are
   documented in docs/design/README.md; change both together. */

@font-face { font-family: "Geist"; src: url("/assets/Geist-Variable-b11a6485.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/assets/GeistMono-Variable-6dd1dc09.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #fafafa;
  --hover: #ededf0;
  --line: #e8e8eb;
  --line-soft: #f0f0f2;
  --field: #dedee3;
  --ink: #111113;
  --text-2: #4a4d55;
  --muted: #63666e;
  --faint: #6b6e76;
  --accent: #2952e3;
  --accent-hover: #1d3db0;
  --accent-soft: #eef2ff;
  --accent-ink: #2445c2;
  --ok: #146c43;
  --ok-soft: #e9f6ef;
  --warn: #8a5a00;
  --warn-soft: #fbf3e2;
  --bad: #a8321f;
  --bad-soft: #fdecea;
  --neutral-soft: #f1f1f3;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --card: #f6f6f8;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* Area colours: the fill and icon ink of a .tile (docs/design/README.md, Area colours). */
  --area-dash: #ebe1d0;
  --area-dash-ink: #5f4b2c;
  --area-chat: #e0d6fb;
  --area-chat-ink: #4b27b8;
  --area-docs: #cbe8f8;
  --area-docs-ink: #075f8c;
  --area-kb: #f0d3f5;
  --area-kb-ink: #84209a;
  --area-obl: #fbd3e3;
  --area-obl-ink: #a3174f;
  --area-parts: #bdebe8;
  --area-parts-ink: #07635f;
  --area-conf: #ffd8bd;
  --area-conf-ink: #96390a;
  --area-mach: #d3dff0;
  --area-mach-ink: #2a4676;
  --area-acct: #e1e3e8;
  --area-acct-ink: #3e414a;
  /* Highlights of quoted text: a yellow marker by default. Reader settings
     can set data-mark-color and data-mark-style on <html>; see the
     "Highlight" section of docs/design/README.md. */
  --mark-rgb: 253 224 71;
  --mark-strength: 0.8;
  --mark-bg: linear-gradient(100deg, rgb(var(--mark-rgb) / 0) 0.5%, rgb(var(--mark-rgb) / calc(0.95 * var(--mark-strength))) 2.5%, rgb(var(--mark-rgb) / calc(0.75 * var(--mark-strength))) 6%, rgb(var(--mark-rgb) / calc(0.65 * var(--mark-strength))) 94%, rgb(var(--mark-rgb) / calc(0.9 * var(--mark-strength))) 97.5%, rgb(var(--mark-rgb) / 0) 99.5%);
  --mark-radius: 3px 7px 4px 8px;
}
:root[data-mark-color="green"] { --mark-rgb: 134 239 172; }
:root[data-mark-color="blue"] { --mark-rgb: 147 197 253; }
:root[data-mark-color="pink"] { --mark-rgb: 249 168 212; }
:root[data-mark-strength="light"] { --mark-strength: 0.55; }
:root[data-mark-strength="strong"] { --mark-strength: 1; }
:root[data-mark-style="flat"] { --mark-bg: rgb(var(--mark-rgb) / calc(0.7 * var(--mark-strength))); --mark-radius: 3px; }
:root[data-mark-style="underline"] { --mark-bg: linear-gradient(transparent 60%, rgb(var(--mark-rgb) / calc(0.9 * var(--mark-strength))) 60% 92%, transparent 92%); --mark-radius: 0; }

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; margin-bottom: 0; overflow-wrap: anywhere; }
h2 { font-size: 15px; font-weight: 600; line-height: 1.4; margin-bottom: 12px; }
h3 { font-size: 14px; font-weight: 600; line-height: 1.45; margin-bottom: 8px; }
.display { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; margin-bottom: 8px; }
.lede { font-size: 14px; color: var(--muted); }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.mono, .digest { font-family: var(--mono); }
.eyebrow { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: absolute; top: -100px; left: 12px; background: var(--bg); padding: 12px; z-index: 10; border-radius: var(--radius); }
.skip-link:focus { top: 12px; }
svg.icon { flex-shrink: 0; }

/* App frame: sidebar and content. */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 232px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 24px; height: 24px; border-radius: 7px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 600; line-height: 1; padding-top: 5px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { height: 44px; padding: 0 8px; border-radius: var(--radius); display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text-2); font-size: 14px; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--bg); box-shadow: 0 0 0 1px var(--line); color: var(--ink); font-weight: 500; }
.nav a .tile { width: 32px; height: 32px; }
.nav a .tile svg { width: 18px; height: 18px; }
.sidebar-section { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sidebar-label { font-size: 12px; color: var(--faint); padding: 0 10px 6px; }
.sidebar-section a { height: 34px; padding: 0 10px; border-radius: var(--radius); display: block; line-height: 34px; text-decoration: none; font-size: 13px; color: var(--text-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sidebar-section a:hover, .sidebar-section a[aria-current="page"] { background: var(--hover); color: var(--ink); }
.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.sidebar-footer > a { height: 32px; padding: 0 10px; border-radius: var(--radius); display: flex; align-items: center; width: 100%; text-decoration: none; font-size: 13px; color: var(--faint); }
.sidebar-footer > a:hover { background: var(--hover); color: var(--ink); }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content.fixed { height: 100vh; height: 100dvh; overflow: hidden; }
.page-header { min-height: 64px; padding: 12px 24px 12px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; border-bottom: 1px solid var(--line-soft); }
.page-header .title { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 9rem; flex-wrap: nowrap; }
.page-header .title > .tile { align-self: center; width: 32px; height: 32px; }
.page-header h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* The icon tile: a circle (the hero a rounded square) holding one stroke icon in its area's colours. */
.tile { width: 36px; height: 36px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--tile-fill, var(--card)); color: var(--tile-ink, var(--text-2)); }
.tile.xs { width: 20px; height: 20px; }
.tile.sm { width: 28px; height: 28px; }
.tile.md { width: 40px; height: 40px; }
.tile.lg { width: 64px; height: 64px; }
.tile.hero { width: 96px; height: 96px; border-radius: 28px; }
.area-dash { --tile-fill: var(--area-dash); --tile-ink: var(--area-dash-ink); }
.area-chat { --tile-fill: var(--area-chat); --tile-ink: var(--area-chat-ink); }
.area-docs { --tile-fill: var(--area-docs); --tile-ink: var(--area-docs-ink); }
.area-kb { --tile-fill: var(--area-kb); --tile-ink: var(--area-kb-ink); }
.area-obl { --tile-fill: var(--area-obl); --tile-ink: var(--area-obl-ink); }
.area-parts { --tile-fill: var(--area-parts); --tile-ink: var(--area-parts-ink); }
.area-conf { --tile-fill: var(--area-conf); --tile-ink: var(--area-conf-ink); }
.area-mach { --tile-fill: var(--area-mach); --tile-ink: var(--area-mach-ink); }
.area-acct { --tile-fill: var(--area-acct); --tile-ink: var(--area-acct-ink); }
.icon-button { width: 40px; height: 40px; flex-shrink: 0; border: 0; border-radius: var(--radius); background: none; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-button:hover { background: var(--hover); color: var(--ink); }
.icon-button.small { width: 32px; height: 32px; }
.nav-scrim { display: none; }
.page-header .title .muted { font-size: 13px; }
@media (max-width: 760px) { .page-header .title .muted { display: none; } }
.page { padding: 28px 32px 48px; width: 100%; max-width: 1200px; }
.page.narrow { max-width: 720px; margin: 0 auto; }
.page.wide { max-width: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.back-link { white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--ink); }
/* Wide screens collapse the sidebar in place; narrower ones open it as a drawer. */
@media (min-width: 1101px) { .app.nav-collapsed .sidebar { display: none; } }
@media (max-width: 1100px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; height: auto; transform: translateX(-100%); visibility: hidden; transition: transform 0.2s ease, visibility 0.2s; box-shadow: 0 8px 24px rgb(17 17 19 / 14%); }
  .app.nav-open .sidebar { transform: none; visibility: visible; }
  .app.nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 30; border: 0; padding: 0; background: rgb(17 17 19 / 24%); }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }
@media (max-width: 760px) {
  .page-header { padding: 10px 12px 10px 8px; }
  .page { padding: 20px 16px 40px; }
  .wide-only { display: none !important; }
}

/* Buttons and fields. */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent); color: #fff; font: inherit; font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; }
.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.button:disabled, .button[aria-disabled="true"] { opacity: 0.45; cursor: default; }
.button.secondary { background: var(--bg); border-color: var(--line); color: var(--ink); }
.button.secondary:hover { background: var(--surface); }
.button.secondary[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-ink); }
.button.large { height: 44px; padding: 0 20px; font-size: 14px; }
.button.small { height: 30px; padding: 0 10px; font-size: 12px; }
.button-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.button-row.spread { justify-content: space-between; }
form.button_to { display: inline; margin: 0; }
label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.text-input, .question-form textarea, select { display: block; width: 100%; height: 40px; padding: 0 12px; font: inherit; font-size: 14px; color: var(--ink); border: 1px solid var(--field); border-radius: var(--radius); background: var(--bg); margin-bottom: 14px; }
select { padding-right: 28px; }
textarea.text-input, .question-form textarea { height: auto; padding: 10px 12px; resize: vertical; }
.field { margin-bottom: 16px; }
.field .text-input { margin-bottom: 0; }
.hint { margin: 6px 0 0; font-size: 12px; color: var(--faint); }
p.field-error { margin: 6px 0 0; font-size: 12px; color: var(--bad); }
.text-input[aria-invalid="true"] { border-color: var(--bad); }
.field-row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.field-row > div { flex: 1; min-width: 120px; }
.field-row { margin-bottom: 14px; }
.field-row .text-input, .field-row select { margin-bottom: 0; }
input[type=file] { display: block; max-width: 100%; font: inherit; font-size: 13px; margin-bottom: 14px; }
input::file-selector-button { height: 32px; padding: 0 12px; border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius); margin-right: 10px; font: inherit; cursor: pointer; }

/* Status. */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--neutral-soft); color: var(--text-2); white-space: nowrap; }
.badge.completed, .badge.ready, .badge.verified, .badge.state-supported { background: var(--ok-soft); color: var(--ok); }
.badge.indexing, .badge.extracting, .badge.converting, .badge.reading, .badge.featuring, .badge.pending, .badge.queued, .badge.searching, .badge.answering { background: var(--accent-soft); color: var(--accent-ink); }
.badge.needs_review, .badge.state-partial, .badge.medium { background: var(--warn-soft); color: var(--warn); }
.badge.failed, .badge.rejected, .badge.state-refused, .badge.high { background: var(--bad-soft); color: var(--bad); }
.badge.withdrawn + .badge.superseded { margin-left: -4px; } /* 6px apart in .file-name's 10px gap */
.badge.outline { background: none; border: 1px solid var(--line); color: var(--text-2); font-weight: 400; }
.badge.outline:has(.tile) { gap: 6px; padding-left: 3px; }
.badge.outline .tile { width: 16px; height: 16px; }
.badge.outline .tile svg { width: 10px; height: 10px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 4px; background: var(--accent); margin-right: 8px; flex-shrink: 0; }
.status-dot.completed, .status-dot.ready { background: var(--ok); }
.status-dot.needs_review { background: #b26a00; }
.status-dot.failed { background: var(--bad); }
.status-dot.duplicate { background: var(--faint); }
/* Feature states: one line per feature of a featuring document (dot, name · word). */
.feature-states { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 13px; }
.feature-states li { display: flex; align-items: center; white-space: nowrap; }
.feature-states .feature-name { color: var(--text-2); }
.feature-states .separator { margin: 0 5px; color: var(--faint); }
.feature-states .feature-state { font-weight: 500; color: var(--text-2); }
.feature-states .feature-state .mono { font-size: 12px; }
.feature-states .feature-state.indexing, .feature-states .feature-state.extracting { color: var(--accent-ink); }
.feature-states .feature-state.ready { color: var(--ok); }
.feature-states .feature-state.needs_review { color: var(--warn); }
.feature-states .feature-state.failed { color: var(--bad); }
/* Waiting: the dot alone, neutral. */
.feature-states .status-dot:not(.indexing, .extracting, .ready, .failed, .needs_review) { background: var(--faint); }
.notice { padding: 12px 14px; margin: 0 0 20px; border-radius: var(--radius); background: var(--ok-soft); color: var(--ok); font-size: 13px; overflow-wrap: anywhere; }
.notice.alert { background: var(--bad-soft); color: var(--bad); }
.notice.dismissible { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.notice.dismissible .icon-button { color: inherit; margin: -8px -8px -8px 0; }
.notice.dismissible .icon-button:hover { background: none; color: inherit; opacity: .7; }
/* Dismiss moves focus to the content (dismiss controller); the whole page needs no outline for it. */
#main:focus { outline: none; }
.progress { height: 4px; border-radius: 2px; background: var(--line-soft); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.progress.indeterminate > span { width: 35%; animation: progress 1.4s ease-in-out infinite; }
@keyframes progress { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) { .progress.indeterminate > span { animation: none; width: 100%; opacity: 0.4; } }

/* Lists, tables and cards. */
.section { margin-bottom: 36px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.section-heading h2, .section-heading h3 { margin-bottom: 0; }
.section-heading > .small { max-width: 460px; }
.section-heading > a.small { color: var(--muted); text-decoration: none; }
.section-heading > a.small:hover { color: var(--accent); }
h2.with-tile { display: flex; align-items: center; gap: 10px; }
.section-heading.with-tile { align-items: center; justify-content: flex-start; gap: 10px; }
.section-heading.with-tile h2 { margin: 0; }
.section-heading.with-tile > .badge, .section-heading.with-tile > .coverage-count, .section-heading.with-tile > .status-link, .section-heading.with-tile > a.small, .section-heading.with-tile > span.small { margin-left: auto; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.rows > li > .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rows a.row-link { display: flex; justify-content: space-between; gap: 12px; flex: 1; text-decoration: none; color: var(--ink); }
.rows a.row-link:hover { color: var(--accent); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th { font-size: 12px; font-weight: 500; color: var(--faint); padding: 0 12px 10px; white-space: nowrap; }
td { padding: 12px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
td.num, th.num { text-align: right; font-family: var(--mono); font-size: 12px; }
.document-link { color: var(--ink); text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.document-link:hover { color: var(--accent); }
.file-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--faint); }
.table-detail { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.card { background: var(--card); border-radius: var(--radius-xl); padding: 16px; }
.empty-state { padding: 40px 24px; text-align: center; color: var(--muted); border: 1px dashed var(--field); border-radius: var(--radius-lg); }
.empty-state p:last-child { margin-bottom: 0; }
.pagination { display: flex; justify-content: space-between; margin-top: 20px; font-size: 13px; }
.plain-list { padding-left: 18px; font-size: 14px; }
dl { margin: 0; }
dt { color: var(--faint); }
dd { margin: 0; overflow-wrap: anywhere; }
blockquote { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: #2b2d33; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.quote-meta { font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* Empty start. */
.start { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.start-inner { max-width: 420px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 24px; }
.start-inner p { margin: 0; color: var(--muted); line-height: 1.55; }
.start-icon { width: 96px; height: 96px; border-radius: 28px; background: var(--tile-fill, var(--card)); color: var(--tile-ink, var(--text-2)); display: flex; align-items: center; justify-content: center; }
.start-icon svg { width: 44px; height: 44px; }
@media (max-width: 760px) { .start-icon { width: 80px; height: 80px; border-radius: 24px; } }
/* The empty dashboard's row of what the documents will do; not links. */
.hint-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 12px; width: 100%; }
.hint-tile { background: var(--card); border-radius: var(--radius-xl); padding: 14px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.hint-tile .tile { width: 48px; height: 48px; }
@media (max-width: 760px) { .hint-tiles { grid-template-columns: repeat(auto-fit, minmax(calc((100% - 16px) / 3), 1fr)); gap: 8px; } }

/* Dashboard. */
.ask-link { height: 56px; background: var(--card); border-radius: var(--radius-xl); padding: 0 12px; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.ask-link:hover { background: var(--hover); color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 32px; }
.stat { background: var(--card); border-radius: var(--radius-xl); padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.stat .tile { width: 48px; height: 48px; margin-bottom: 8px; }
.stat > span:not(.tile) { font-size: 13px; color: var(--muted); }
.stat strong { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.stat small { font-size: 12px; color: var(--faint); }
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 28px; margin-bottom: 32px; }
.progress-row { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.progress-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; }

/* Upload. */
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 24px; margin: 0; border: 1.5px dashed #d6d6dc; border-radius: var(--radius-xl); background: var(--card); text-align: center; font-weight: 400; cursor: pointer; }
.dropzone:hover, .dropzone.dragging { border-color: var(--accent); background: var(--accent-soft); }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone strong { font-size: 15px; font-weight: 500; }
.dropzone .browse { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.file-list { list-style: none; margin: 12px 0 0; padding: 0; }
.file-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.file-list li .name { flex: 1; min-width: 0; display: flex; white-space: pre; }
.file-list .name .head { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.file-list .name .tail { flex-shrink: 0; }
.file-list .mono { font-size: 12px; color: var(--faint); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 16px; }
.option { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px; margin: 0; border: 1.5px solid transparent; border-radius: var(--radius-xl); background: var(--card); font-weight: 400; cursor: pointer; }
.option:has(input:checked) { border-color: var(--accent); background: var(--bg); }
.option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.option input { position: absolute; top: 18px; right: 18px; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.option strong { font-size: 15px; font-weight: 600; }
.option span.muted { font-size: 13px; line-height: 1.5; }

/* Chat: the thread scrolls on its own; the source pane follows the answer at
   the reading line (see chat_source_controller.js). */
.chat-layout { flex: 1; min-height: 0; display: flex; }
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.thread-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.thread { width: 100%; max-width: 760px; margin: 0 auto; padding: 32px 24px 24px; display: flex; flex-direction: column; gap: 32px; }
.chat-layout.source-open .thread { padding-bottom: 30vh; }
.in-source-label { display: none; align-items: center; gap: 6px; font-size: 12px; color: var(--accent-ink); }
.in-source-label::before { content: ""; width: 6px; height: 6px; border-radius: 3px; background: var(--accent); }
.chat-layout.source-open .answer.in-source .in-source-label { display: flex; }
.source-pane { display: none; }
.chat-layout.source-open .source-pane { display: flex; flex-direction: column; width: 46%; min-width: 380px; max-width: 640px; flex-shrink: 0; border-left: 1px solid var(--line); background: var(--bg); }
.source-bar { min-height: 64px; padding: 12px 12px 12px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; border-bottom: 1px solid var(--line); }
.source-bar strong { font-size: 14px; font-weight: 600; }
.source-bar .label { font-size: 13px; color: var(--faint); }
.source-bar .grow { flex: 1; }
.source-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 20px 0; }
.source-chips:empty { display: none; }
.source-citation { padding: 12px 20px 16px; display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--line); }
.source-citation .number { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--accent-ink); }
.source-citation .quote-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.source-citation .quote-texts { flex-shrink: 0; max-height: 30vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.quote-text { margin: 0; padding: 0; border: 0; background: none; font-size: 14px; line-height: 1.6; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.source-citation .quote-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.source-citation .quote-meta .tile { align-self: center; }
.source-citation .quote-meta a { font-family: var(--sans); font-size: 12px; }
.source-chip { height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--text-2); font-family: var(--mono); font-size: 11px; cursor: pointer; }
.source-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.follow { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; font-weight: 400; color: var(--text-2); }
.switch { width: 30px; height: 18px; border: 0; border-radius: 9px; background: #c9cad0; padding: 2px; display: flex; cursor: pointer; }
.switch[aria-checked="true"] { background: var(--accent); justify-content: flex-end; }
.switch span { width: 14px; height: 14px; border-radius: 7px; background: #fff; }
.switch:disabled { opacity: 0.5; cursor: not-allowed; }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Project settings: one bordered card per feature, text left, switch right. */
.feature-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.feature-card { display: flex; align-items: center; gap: 16px; padding: 16px 18px; background: var(--card); border-radius: var(--radius-xl); }
.feature-card .tile { width: 44px; height: 44px; }
.feature-card > div, .feature-card > .feature-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.feature-card .feature-text { cursor: pointer; }
.feature-card strong { font-size: 15px; font-weight: 600; }
.feature-card .muted { font-size: 13px; line-height: 1.5; }
.feature-card form { margin: 0; flex-shrink: 0; padding-top: 2px; }
.feature-card .switch { margin: 0; }
.feature-card .always-on { flex-shrink: 0; font-size: 12px; color: var(--faint); padding-top: 2px; }
.switch-input { appearance: none; position: relative; flex-shrink: 0; width: 30px; height: 18px; margin: 2px 0 0; border-radius: 9px; background: #c9cad0; cursor: pointer; }
.switch-input::before { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 7px; background: #fff; }
.switch-input:checked { background: var(--accent); }
.switch-input:checked::before { left: 14px; }
.switch-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.source-keep { display: contents; }
.source-frame { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* A PDF source: the frame holds the citation, the pane's viewer below it takes the rest. */
.source-frame:has(+ .pdf-viewer:not([hidden])) { flex: none; }
.source-frame[busy] { opacity: 0.6; }
.source-doc { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.source-doc-head { padding: 12px 16px 12px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line-soft); }
.source-doc-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.source-doc-head strong { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.source-doc .notice { margin: 12px 16px 0; }
.source-pane .pdf-viewer { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px 16px 16px; }
.source-pane .pdf-viewer[hidden] { display: none; }
.source-pane .pdf-scroll { flex: 1; max-height: none; }
.source-doc .source-text { flex: 1; max-height: none; margin: 16px; position: relative; }
.source-empty { padding: 40px 24px; color: var(--faint); font-size: 13px; text-align: center; }
.source-handle { display: none; }
@media (max-width: 760px) {
  .chat-layout.source-open .source-pane { position: fixed; left: 0; right: 0; z-index: 20; width: auto; min-width: 0; max-width: none; border-left: 0; }
  .source-pane.sheet-full { bottom: 0; height: 62vh; height: 62dvh; border-radius: 16px 16px 0 0; border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgb(17 17 19 / 12%); overflow: hidden; }
  .source-pane:not(.sheet-full) { top: 64px; border-bottom: 1px solid var(--line); box-shadow: 0 6px 16px rgb(17 17 19 / 8%); }
  .source-pane:not(.sheet-full) .source-bar, .source-pane:not(.sheet-full) .source-chips, .source-pane:not(.sheet-full) .source-frame, .source-pane:not(.sheet-full) .pdf-viewer { display: none; }
  .source-pane.sheet-full { height: 70vh; height: 70dvh; overflow-y: auto; overscroll-behavior: contain; }
  /* The sheet's content is taller than the sheet: it scrolls, the grip stays on top, and the page gets a height of its own. */
  .source-pane.sheet-full > * { flex-shrink: 0; }
  .source-pane.sheet-full .source-handle { position: sticky; top: 0; z-index: 1; }
  .source-pane.sheet-full .source-frame, .source-pane.sheet-full .source-doc, .source-pane.sheet-full .pdf-viewer { flex: none; }
  .source-pane.sheet-full .pdf-scroll { flex: none; height: 60vh; height: 60dvh; }
  .source-pane.sheet-full .source-doc .source-text { flex: none; max-height: 60vh; max-height: 60dvh; overflow: auto; }
  .source-chips { padding: 8px 16px 0; }
  .source-citation { padding: 10px 16px 12px; }
  .source-citation .quote-texts { max-height: 96px; }
  .source-handle { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; padding: 8px 16px 10px; border: 0; background: var(--bg); font: inherit; cursor: pointer; }
  .source-handle .grip { width: 36px; height: 4px; border-radius: 2px; background: #d6d6dc; }
  .source-handle .summary { width: 100%; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); text-align: left; }
  .source-handle .summary span:first-child { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .source-handle .summary span:last-child { font-size: 12px; color: var(--accent-ink); }
  .source-bar { min-height: 0; padding: 8px 12px 8px 16px; }
  .chat-layout.source-open .thread { padding: 72px 16px 70vh; }
  .source-bar .label { display: none; }
  .thread { padding: 20px 16px 16px; }
  .composer-dock { padding: 8px 12px 12px; }
}
.chat-empty { padding-top: 12vh; display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.chat-empty .hero-lead { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.chat-empty .hero-lead h2 { margin: 0; }
.chat-empty .ai-line { margin-top: -6px; }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.suggestions button { min-height: 36px; max-width: 100%; padding: 6px 14px 6px 8px; text-align: left; display: flex; align-items: flex-start; gap: 8px; border: 0; border-radius: var(--radius-xl); background: var(--card); color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; }
.suggestions .tile { width: 24px; height: 24px; }
.suggestions .pill-text { align-self: center; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.suggestions button:hover { background: var(--hover); color: var(--ink); }
.suggestions button.sends { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 760px) { .suggestions { flex-direction: column; align-items: stretch; } }
.composer-dock { padding: 12px 24px 20px; background: var(--bg); }
.composer { max-width: 712px; margin: 0 auto; border: 1px solid var(--field); border-radius: 14px; background: var(--bg); box-shadow: 0 2px 8px rgb(17 17 19 / 4%); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.composer:focus-within { border-color: #b9c6f5; }
.composer textarea { display: block; width: 100%; border: 0; resize: none; padding: 4px 6px; font: inherit; font-size: 15px; color: var(--ink); background: transparent; outline: none; }
.composer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.composer-bar .grow { flex: 1; }
.composer-bar select { width: auto; height: 32px; margin: 0; font-size: 13px; }
.composer-bar select:disabled { opacity: 0.5; }
.composer-bar select.attention { border-color: var(--accent); }
.composer-bar .text-input { width: 148px; height: 32px; margin: 0; font-size: 13px; }
.machine-chip .tile { width: 18px; height: 18px; }
.machine-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 28px; padding: 0 2px 0 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.machine-chip:has(button:disabled) { opacity: 0.5; }
.machine-chip .icon-button { width: 24px; height: 24px; }
.composer .hint { margin: -4px 6px 0; }
.answer-for { margin: -12px 0 -8px; overflow-wrap: anywhere; }
.cite-label { display: flex; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.cite-label .part { min-width: 0; overflow-wrap: anywhere; }
.cite-label .part:not(:last-child)::after { content: " ·" / ""; }
@media (max-width: 760px) {
  .composer-bar .grow { display: none; }
  .composer-bar .send { margin-left: auto; }
  .machine-chip { flex: 0 0 100%; min-height: 40px; padding-left: 14px; border-radius: 20px; }
  .machine-chip .icon-button { width: 36px; height: 36px; margin-left: auto; }
  .composer-bar:has(.text-input) select, .composer-bar .text-input { flex: 1; width: auto; min-width: 0; height: 36px; }
  .composer-bar .text-input { font-size: 16px; }
}
.send { width: 36px; height: 36px; border: 0; border-radius: 18px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.send:hover { background: var(--accent-hover); }
.send:disabled { opacity: 0.4; cursor: default; }
.answer { display: flex; flex-direction: column; gap: 16px; overflow-wrap: anywhere; }
.question { align-self: flex-end; max-width: 80%; background: var(--card); border-radius: 14px; padding: 10px 14px; font-size: 14px; line-height: 1.5; margin: 0; white-space: pre-wrap; }
.answer-text { font-size: 15px; line-height: 1.65; }
.answer-text p { margin: 0 0 8px; }
.sentence::after { content: " "; }
.answer-list { margin: 0 0 10px; padding-left: 22px; }
.answer-list li { margin: 3px 0; }
.answer-list .sentence::after { content: none; }
.citation-ref { font-family: var(--mono); font-size: 11px; font-weight: 500; vertical-align: super; line-height: 0; margin-left: 2px; padding: 0 3px; border-radius: 4px; text-decoration: none; }
.chat-layout.source-open .citation-ref.active { background: var(--accent); color: #fff; }
.answer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ai-line { margin: 0; max-width: 46ch; color: var(--muted); line-height: 1.5; }
.ai-line a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.ai-line a:hover { color: var(--ink); }
@media (max-width: 760px) { .ai-line { max-width: none; } }
.sources-button .tile { width: 18px; height: 18px; }
.sources-button { height: 26px; padding: 0 6px 0 4px; border: 1px solid var(--line); border-radius: 13px; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); text-decoration: none; }
.sources-button:hover { border-color: var(--accent); color: var(--ink); }
.missing { font-size: 13px; color: var(--warn); margin: 0; }
.citations { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.citations li { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; gap: 12px; font-size: 13px; }
.citations .number { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.citations li > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.citations blockquote { margin: 0; padding: 0; border: 0; background: none; }
.citations .source-link { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--faint); text-decoration: none; }
.citations .source-link:hover { color: var(--accent); }
.related { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.related > .empty { padding: 12px 14px; }
.related > p { margin: 0; padding: 10px 14px; font-size: 12px; font-weight: 500; color: var(--text-2); background: var(--surface); border-bottom: 1px solid var(--line); }
.related table { min-width: 520px; font-size: 13px; }
.related th { padding: 8px 14px; }
.related td { padding: 10px 14px; }
.related td:first-child, .related th:first-child { padding-left: 14px; }
.related td:last-child, .related th:last-child { padding-right: 14px; }
.related.parts-cited table { min-width: 640px; }
.parts-cited td { vertical-align: top; }
.parts-cited td.part-number { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.parts-cited td.description { min-width: 160px; overflow-wrap: anywhere; }
.parts-cited td.qty { white-space: nowrap; }
.parts-cited td.qty .unit { color: var(--muted); }
.parts-cited td.applies { min-width: 100px; overflow-wrap: anywhere; }
.parts-cited .none { color: var(--faint); }
.parts-cited-more { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.parts-cited-more a + a::before { content: " · "; color: var(--faint); }
.related.where-used table { min-width: 560px; }
.related.where-used > p.where-used-description { font-weight: 400; color: var(--muted); background: transparent; border-bottom: 0; padding-bottom: 0; overflow-wrap: anywhere; }
.related.where-used > .where-used-title { overflow-wrap: anywhere; }
.where-used-more { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.related tr.not-for-machine td { color: var(--muted); padding-bottom: 4px; }
.related tr.not-for-machine .part-number { color: var(--muted); }
.related tr.not-for-machine-note td { padding-top: 0; border-top: 0; }
.not-for-machine-note p { margin: 0; font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.not-for-machine-note .mono { font-family: var(--mono); }
.replaced-by { margin: 8px 0 0; border-left: 2px solid var(--line); padding-left: 10px; }
.replaced-by ul { margin: 0; padding: 0; list-style: none; }
.replaced-by li + li { margin-top: 10px; }
.replaced-by p { margin: 0; overflow-wrap: anywhere; }
.replaced-by-lead { font-size: 13px; font-weight: 500; color: var(--ink); }
.replaced-by-lead .mono { font-family: var(--mono); }
.replaced-by-lead .order-link { margin-left: 12px; }
.replaced-by .replaced-by-quote { margin-top: 4px; font-size: 12px; color: var(--text-2); }
.replaced-by-quote q { font-family: var(--mono); }
.replaced-by-source { display: inline-block; margin-top: 4px; font-size: 12px; overflow-wrap: anywhere; }
.replaced-by li > .badge { margin-left: 6px; }
.replaced-by li > .badge + .badge,
.replaced-by li > .badge.withdrawn + .badge.superseded { margin-left: 4px; } /* beats the .file-name pair rule */
.replaced-by-count, .replaced-by-more { font-size: 12px; color: var(--muted); }
.replaced-by .replaced-by-count { margin-bottom: 8px; }
.replaced-by .replaced-by-more { margin-top: 10px; }
.related tr.replaced-by-row td { padding-top: 0; border-top: 0; }
.related tr.replaced-by-row .replaced-by { margin-top: 0; }
.related tr:has(+ tr.replaced-by-row) td { padding-bottom: 4px; }
.related.where-used > .where-used-replaced { margin: 0; padding: 10px 14px; border-left: 0; border-bottom: 1px solid var(--line-soft); }
.preview-focus { margin: 0 0 8px; font-size: 12px; color: var(--text-2); }
.preview-focus .mono { color: var(--text); }
.preview-focus button { margin-left: 8px; }
.preview-focus .button[hidden] { display: none; }
.preview-focus:has(> [role="status"]:empty) { margin: 0; }
@media (max-width: 760px) {
  .related.parts-cited table { min-width: 0; }
  .parts-cited thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .parts-cited table, .parts-cited tbody, .parts-cited tr, .parts-cited td { display: block; }
  .parts-cited tr { padding: 12px 14px; border-top: 1px solid var(--line-soft); }
  .parts-cited tr:first-child { border-top: 0; }
  .parts-cited td, .parts-cited td:first-child, .parts-cited td:last-child { padding: 0; border: 0; }
  .parts-cited td.description { margin-top: 2px; min-width: 0; }
  .parts-cited td.qty, .parts-cited td.applies { display: inline-block; min-width: 0; margin: 6px 16px 0 0; }
  .parts-cited td.qty:has(.none), .parts-cited td.applies:has(.none) { display: none; }
  .parts-cited td.qty::before, .parts-cited td.applies::before { content: attr(data-label) " "; color: var(--faint); }
  .parts-cited td.source { display: inline-block; margin: 6px 0 0; font-size: 12px; color: var(--faint); }
  .parts-cited td.source::before { content: "Source "; }
  .parts-cited td.drawing { margin-top: 2px; }
  .parts-cited td.drawing a { display: inline-flex; align-items: center; min-height: 44px; }
  .parts-cited-more a { display: inline-flex; align-items: center; min-height: 44px; }
  .related.where-used table { min-width: 0; }
  .where-used .part-uses tr { padding: 12px 14px; }
  .where-used .part-uses tr:first-child { border-top: 0; }
  .where-used-more a { display: inline-flex; align-items: center; min-height: 44px; }
  .related tr.not-for-machine { padding-bottom: 0; }
  .related tr.not-for-machine td { padding-bottom: 0; }
  .related tr.not-for-machine-note { padding: 4px 14px 12px; border-top: 0; }
  .related tr.replaced-by-row { padding: 4px 14px 12px; border-top: 0; }
  .related tr:has(+ tr.replaced-by-row) { padding-bottom: 0; }
  .related tr:has(+ tr.replaced-by-row) td { padding-bottom: 0; }
  .replaced-by-lead .order-link, .replaced-by-more a { display: inline-flex; align-items: center; min-height: 44px; }
  .replaced-by-source { display: inline-flex; align-items: center; min-height: 44px; margin-top: 0; }
  .preview-focus .button { display: flex; height: 44px; margin: 8px 0 0; }
}
.safety-notice { border: 1px solid #ecc9a8; background: #fff8f1; border-radius: 10px; padding: 12px 14px; }
.safety-notice pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--sans); font-size: 13px; }
.safety-notice p { margin: 8px 0 0; }
.trace { border-top: 1px dashed var(--line); padding-top: 14px; font-size: 13px; }
.trace summary { cursor: pointer; font-weight: 500; }
.trace h4 { margin: 18px 0 8px; font-size: 13px; }
.trace-table td, .trace-table th { padding: 8px 10px; font-size: 12px; }
.dropped { padding-left: 18px; }
.dropped p { margin: 4px 0; }

/* Findings, sources and run reports. */
.page-heading { margin-bottom: 20px; }
.page-heading > p { margin-bottom: 8px; }
.run-heading { display: flex; justify-content: space-between; gap: 24px; align-items: center; flex-wrap: wrap; }
.progress-panel { background: var(--card); border-radius: var(--radius-xl); padding: 18px 20px; margin-bottom: 28px; }
.progress-panel .section-heading strong { display: inline-flex; align-items: center; font-weight: 500; }
.stages { display: flex; gap: 10px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.stages li { flex: 1; min-width: 95px; border-top: 2px solid var(--line-soft); padding-top: 10px; font-size: 12px; color: var(--faint); }
.stages li span { margin-right: 5px; font-family: var(--mono); }
.stages .done { border-color: var(--ok); color: var(--ok); }
.stages .current { border-color: var(--accent); color: var(--accent-ink); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.metric { background: var(--card); border-radius: var(--radius-xl); padding: 16px; }
.metric > span:not(.tile) { font-size: 13px; color: var(--muted); }
.metric strong { display: block; font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; }
.metric small { font-size: 14px; color: var(--faint); font-weight: 400; }
.review-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; margin-top: 28px; align-items: start; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { font-size: 13px; padding: 8px 12px 10px; text-decoration: none; color: var(--muted); }
.tabs a:hover { color: var(--ink); }
.tabs .active { border-bottom: 2px solid var(--accent); color: var(--ink); font-weight: 500; }
.finding { background: var(--card); border: 1px solid transparent; border-radius: var(--radius-xl); padding: 18px; margin-bottom: 12px; overflow-wrap: anywhere; }
.finding.selected { background: var(--bg); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.finding .eyebrow { margin-bottom: 0; }
.finding-fields { font-size: 13px; }
.finding-fields > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.source-link { font-size: 13px; font-weight: 500; text-decoration: none; }
.rejection { color: var(--bad); margin-bottom: 0; }
.source-panel { position: sticky; top: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: 18px; }
.source-text { max-height: 65vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--sans); font-size: 13px; line-height: 1.8; padding: 18px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); margin: 0; }
mark { color: inherit; background: var(--mark-bg); padding: 1px 3px; margin: 0 -3px; border-radius: var(--mark-radius); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.gaps-section { margin-top: 36px; }
.gap { padding: 14px 16px; border: 1px solid #f0dfbd; background: #fffbf2; border-radius: var(--radius); margin-bottom: 10px; }
.gap h3 { margin-bottom: 4px; }
.gap p { font-size: 13px; margin-bottom: 0; }
.gap blockquote { margin-bottom: 0; }
.audit { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 32px; }
.audit summary { font-size: 13px; cursor: pointer; font-weight: 500; }
.passage { padding: 16px 18px; }
.passage.safety_notice { border-color: #ecc9a8; }
.passage.table { border-color: #c7d3ef; }
.passage.steps { border-color: #bfe0cd; }
.heading-path { color: var(--faint); margin-bottom: 6px; }
.passage-text { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--sans); font-size: 13px; margin: 0; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 28px; }
.question-form { margin-top: 16px; }
@media (max-width: 900px) { .review-grid { grid-template-columns: 1fr; } .source-panel { position: static; } .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Sign in. */
.sign-in { min-height: 100vh; padding: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 48px; }
.sign-in-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 28px; }
.sign-in-card .tile { display: flex; margin-bottom: 16px; }
.sign-in .brand { padding: 0; font-size: 16px; }
.sign-in .brand-mark { width: 28px; height: 28px; border-radius: 8px; font-size: 20px; padding-top: 6px; }
.sign-in .text-input { height: 44px; }
.sign-in .button { width: 100%; height: 44px; font-size: 14px; margin-top: 8px; }

/* PDF.js TextLayer geometry, scoped to the source viewer. */
.pdf-toolbar, .pdf-finding-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pdf-toolbar .button, .pdf-finding-nav .button { height: 30px; padding: 0 10px; }
.pdf-page-label, .pdf-zoom-label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; font-weight: 400; }
.pdf-page-label input { width: 58px; height: 30px; padding: 0 6px; border: 1px solid var(--field); border-radius: 6px; font: inherit; }
.pdf-zoom-label select { max-width: 110px; height: 30px; margin: 0; padding: 0 6px; font-size: 12px; }
.pdf-finding-nav { justify-content: space-between; }
.pdf-finding-links { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.pdf-finding-links .next { margin-left: auto; }
.pdf-scroll { max-height: 65vh; min-height: 180px; overflow: auto; background: #e9e9ec; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.pdf-page { position: relative; background: white; margin: 0 auto; --scale-round-x: 1px; --scale-round-y: 1px; }
.pdf-page canvas { display: block; }
.pdf-page .textLayer { position: absolute; inset: 0; overflow: clip; line-height: 1; text-align: initial; letter-spacing: normal; word-spacing: normal; text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; --min-font-size: 1; --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size)); --min-font-size-inv: calc(1 / var(--min-font-size)); }
.pdf-page .textLayer :is(span, br) { position: absolute; color: transparent; white-space: pre; cursor: text; transform-origin: 0 0; user-select: text; }
.pdf-page .textLayer > :not(.markedContent), .pdf-page .markedContent span:not(.markedContent) { --font-height: 0; --scale-x: 1; --rotate: 0deg; font-size: calc(var(--text-scale-factor) * var(--font-height)); transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv)); }
.pdf-page .markedContent { display: contents; }
.pdf-highlight { position: absolute; background: var(--mark-bg); border-radius: var(--mark-radius); mix-blend-mode: multiply; pointer-events: none; z-index: 2; }
.pdf-figure { position: absolute; border: 2px dashed #d52323; pointer-events: none; z-index: 1; }
.pdf-related { position: absolute; background: rgb(var(--mark-rgb) / calc(0.3 * var(--mark-strength))); border-radius: 3px; mix-blend-mode: multiply; pointer-events: none; z-index: 1; }
.pdf-callout { position: absolute; border: 3px solid #d52323; border-radius: 50%; pointer-events: none; z-index: 2; }
.pdf-callout-hit { position: absolute; z-index: 4; -webkit-tap-highlight-color: transparent; box-sizing: border-box; min-width: 24px; min-height: 24px; margin: 0; padding: 0; border: 2px solid transparent; border-radius: 50%; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.pdf-callout-hit:hover, .pdf-callout-hit:focus-visible, .pdf-callout-hit[aria-expanded="true"] { border-color: #d52323; background: rgb(213 35 35 / 10%); }
.pdf-callout-hit:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.callout-popover { position: absolute; z-index: 5; box-sizing: border-box; width: 280px; max-width: calc(100% - 16px); max-height: 260px; overflow-y: auto; overscroll-behavior: contain; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); box-shadow: 0 6px 16px rgb(17 17 19 / 12%); font-size: 13px; line-height: 1.4; text-align: left; user-select: text;
  /* The scroll cue: a shadow (fixed to the box) at an edge with more rows past it; the white covers move with the
     content and hide each shadow once the content's end reaches that edge. */
  background: linear-gradient(var(--bg) 40%, transparent) top / 100% 24px no-repeat local,
    linear-gradient(transparent, var(--bg) 60%) bottom / 100% 24px no-repeat local,
    linear-gradient(rgb(17 17 19 / 12%), transparent) top / 100% 12px no-repeat scroll,
    linear-gradient(transparent, rgb(17 17 19 / 12%)) bottom / 100% 12px no-repeat scroll, var(--bg); }
.callout-popover[hidden] { display: none; }
.callout-popover:focus { outline: none; }
.callout-popover:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.callout-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.callout-popover-title { margin: 0; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.callout-popover-close { flex-shrink: 0; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.callout-popover-close:hover { background: var(--hover); color: var(--ink); }
.callout-row { padding: 8px 0 0; }
.callout-row + .callout-row { margin-top: 8px; border-top: 1px solid var(--line-soft); }
.callout-row p { margin: 0; overflow-wrap: anywhere; }
.callout-row .part-number { font-family: var(--mono); font-size: 12px; }
.callout-row .description { margin-top: 2px; color: var(--text-2); }
.callout-row .callout-meta { margin-top: 4px; font-size: 12px; color: var(--muted); }
.callout-row .callout-meta > span + span { margin-left: 12px; }
.callout-row .callout-meta .unit { color: var(--muted); }
.callout-row .callout-list-link { display: inline-block; margin-top: 6px; font-size: 12px; }
/* Touch has no hover: a faint dotted ring at rest says the callout can be tapped. */
@media (hover: none) { .pdf-callout-hit:not([aria-expanded="true"]) { border: 2px dotted rgb(213 35 35 / 45%); } }
@media (forced-colors: active) { .pdf-callout-hit:hover, .pdf-callout-hit:focus-visible, .pdf-callout-hit[aria-expanded="true"] { border-color: Highlight; background: transparent; } .callout-popover { border-color: CanvasText; } }
@media (max-width: 760px) {
  .pdf-callout-hit::before { content: ""; position: absolute; inset: min(0px, calc((100% - 44px) / 2)); }
  .callout-popover { width: 260px; }
  .callout-popover-close { width: 44px; height: 44px; margin: -10px -12px -10px 0; }
  .callout-row .callout-list-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 0; }
}
.source-transcript { margin-top: 16px; font-size: 13px; }
.source-transcript summary { cursor: pointer; }
.pdf-viewer > .source-link { display: inline-block; margin-top: 10px; }

/* Projects: the switcher at the top of the sidebar. */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; min-width: 220px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgb(17 17 19 / 10%); display: flex; flex-direction: column; }
.menu.align-end .menu-panel { left: auto; right: 0; }
.menu-panel hr { width: 100%; height: 1px; margin: 4px 0; border: 0; background: var(--line-soft); }
.menu-panel form { margin: 0; }
.menu-item { width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 6px; background: none; display: flex; align-items: center; gap: 10px; font: inherit; font-size: 13px; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: #f4f4f5; color: var(--ink); }
.menu-item .tile { width: 24px; height: 24px; }
.menu-item.danger { color: var(--bad); }
.menu-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-switcher .menu-item .grow { white-space: normal; overflow-wrap: anywhere; }
.menu-item .check { width: 14px; color: var(--accent); display: flex; }
.project-switcher > summary, .account-menu > summary { height: 52px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); display: flex; align-items: center; gap: 10px; }
.project-switcher > summary:hover, .account-menu > summary:hover { background: var(--hover); }
.project-switcher .menu-panel { right: 0; min-width: 0; }
.project-tile { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; background: var(--tile-fill, var(--area-dash)); color: var(--tile-ink, var(--area-dash-ink)); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.project-tile.small { width: 24px; height: 24px; font-size: 12px; }
.project-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.project-name strong { font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-name span { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-switcher > summary svg.icon, .account-menu > summary svg.icon { color: var(--faint); }

/* Account menu: the signed-in person at the bottom of the sidebar; opens upward. */
.account-menu { margin-top: 6px; }
.account-menu .menu-panel { top: auto; bottom: calc(100% + 6px); right: 0; min-width: 0; }
.legal-links { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.menu-panel .legal-links { padding: 4px 10px 6px; font-size: 12px; }
.legal-links a { color: var(--faint); }

/* Recent chats: each row deletes from a button shown on hover or focus. */
.chat-row { display: flex; align-items: center; border-radius: var(--radius); }
.chat-row > a { flex: 1; min-width: 0; }
.chat-row form { margin: 0; }
.chat-row .chat-delete { width: 28px; height: 28px; margin-right: 3px; opacity: 0; color: var(--faint); }
.chat-row:hover, .chat-row.current { background: var(--hover); }
.chat-row:hover .chat-delete, .chat-row:focus-within .chat-delete { opacity: 1; }
.chat-row .chat-delete:hover { background: #e2e2e6; color: var(--bad); }
@media (hover: none) { .chat-row .chat-delete { opacity: 1; } }
.narrow-only { display: none !important; }
@media (max-width: 760px) { .narrow-only { display: flex !important; } }

/* The chat before a document is ready. */
.chat-gate { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.gate-list { width: 100%; text-align: left; }
.gate-list .progress { width: 100%; }

/* Notices with an action, and dialogs. */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; min-height: 44px; max-width: calc(100vw - 32px); padding: 6px 8px 6px 16px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 13px; display: flex; align-items: center; gap: 16px; box-shadow: 0 8px 24px rgb(17 17 19 / 18%); }
.toast form { margin: 0; }
.toast-action { height: 30px; padding: 0 10px; border: 0; border-radius: 6px; background: rgb(255 255 255 / 14%); color: #fff; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.toast-action:hover { background: rgb(255 255 255 / 24%); }
dialog.dialog { width: min(440px, calc(100vw - 32px)); padding: 24px; border: 0; border-radius: var(--radius-lg); box-shadow: 0 16px 48px rgb(17 17 19 / 18%); color: var(--ink); }
dialog.dialog::backdrop { background: rgb(17 17 19 / 24%); }
dialog.dialog h2 { font-size: 17px; margin-bottom: 14px; overflow-wrap: anywhere; }
dialog.dialog p { font-size: 14px; line-height: 1.55; color: var(--text-2); }
/* One space above a dialog's buttons whatever comes before them (a sentence, a list, a field, options): the
   row's margin collapses with the smaller one above it. */
dialog.dialog .button-row { margin-top: 16px; }
dialog.dialog .notice { margin-bottom: 16px; }
.dialog-list { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); max-height: 200px; overflow-y: auto; }
.dialog-list li { padding: 8px 12px; font-size: 13px; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.dialog-list li:first-child { border-top: 0; }
.dialog-list .blocked { color: var(--warn); font-size: 12px; }
.dialog-list .blocked a { color: inherit; }
.button.danger { background: var(--bad); border-color: var(--bad); }
.button.danger:hover { background: #8c2818; border-color: #8c2818; }

/* Team and the waiting list: emails wrap anywhere, so the table never scrolls
   sideways and its row menus may open past it. */
.table-scroll:has(> .people-list), .table-scroll:has(> .waitlist) { overflow: visible; }
.people-list td.name-col, .waitlist td.name-col { overflow-wrap: anywhere; }
/* A waiting entry's Invite button sits beside its row menu; on a phone it is the menu's first item. */
.waitlist td.row-actions { width: auto; }
.waitlist .row-buttons { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
@media (max-width: 760px) { .waitlist td.name-col { min-width: 140px; } }

/* Machines (docs/design/screens/machines.md, "Machines"). */
.machine-list td.name-col { overflow-wrap: anywhere; }
.lead { display: flex; align-items: center; gap: 10px; min-width: 0; }
.search-form { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.search-form .text-input { flex: 1; min-width: 0; margin-bottom: 0; }
.search-form > a { font-size: 13px; text-decoration: none; }
.search-form > a:hover { color: var(--ink); }
.csv-example { margin: 0 0 16px; padding: 8px 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-family: var(--mono); font-size: 12px; }
#import-help { margin: 8px 0 0; padding-left: 18px; }
.skipped { margin-bottom: 12px; }
.skipped > summary { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; cursor: pointer; list-style: none; }
.skipped > summary::-webkit-details-marker { display: none; }
.skipped > summary svg { transition: transform 0.15s; }
.skipped[open] > summary svg { transform: rotate(90deg); }
.skipped-list { max-height: 240px; overflow-y: auto; margin-top: 8px; }
.skipped-list > li { flex-wrap: wrap; gap: 4px 8px; align-items: baseline; overflow-wrap: anywhere; }
.matched-row { margin-top: 2px; font-size: 13px; color: var(--text-2); }
.matched-row strong { color: var(--ink); }
.grow .badge.withdrawn { margin-left: 6px; }
.machine-delete .button { width: 100%; height: 44px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .skipped > summary svg { transition: none; } }
@media (max-width: 760px) {
  .search-form .text-input, .search-form .button { height: 44px; font-size: 14px; }
}

/* Documents: choosing rows to delete. */
.select-col { width: 28px; padding-right: 0; }
.select-col input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.selection-bar { display: flex; align-items: center; gap: 8px; }
.selection-bar[hidden], .actions [hidden] { display: none; }
.selection-bar span { font-size: 13px; color: var(--text-2); }
.row-menu summary { width: 32px; height: 32px; }
td.row-actions { width: 76px; white-space: nowrap; padding-left: 0; padding-right: 0; }
/* A name may break anywhere, so the table would shrink its column to one letter. */
td.name-col { min-width: 200px; }
.document-list td.num, .company-list td.num, .usage-list td.num, .provider-costs td.num { white-space: nowrap; }
/* Admin: the Partial mark ("+") after a value that counts only what is known. */
.partial { color: var(--warn); font-weight: 600; }
/* Admin: "≈" before a total converted at EUR_PER_USD. */
.approx { color: var(--muted); }
.provider-costs tfoot td { font-weight: 600; }

/* Documents on a phone: the same table, one line per row, the name shortened
   in the middle; a row opens the document's page. */
.document-list .narrow-only, .document-row { display: none; }
.document-row { position: relative; flex: 1; min-width: 0; align-items: center; gap: 12px; padding: 10px 0; color: var(--ink); text-decoration: none; }
.document-row > .icon { flex-shrink: 0; color: #8a8c93; }
.document-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.document-row-name { display: flex; min-width: 0; font-size: 14px; font-weight: 500; white-space: nowrap; }
.document-row-name .head { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.document-row-name .tail { flex-shrink: 0; }
/* The name is the link to the page and covers the row; the status link sits above it. */
a.document-row-name { color: inherit; text-decoration: none; }
a.document-row-name::after { content: ""; position: absolute; inset: 0; }
.document-row-meta .status-link { position: relative; z-index: 1; gap: 6px; padding: 6px 4px; margin: -6px -4px; }
.document-row-meta { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--faint); white-space: nowrap; }
.document-row-meta .status-dot { width: 7px; height: 7px; margin: 0; }
.document-row-meta .status { font-weight: 500; color: var(--accent-ink); }
.document-row-meta .status.duplicate { color: var(--faint); }
.document-row-meta .status.ready { color: var(--ok); }
.document-row-meta .status.needs_review { color: var(--warn); }
.document-row-meta .status.failed { color: var(--bad); }
.document-row-meta .rest { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) {
  .document-list table, .document-list thead, .document-list tbody { display: block; }
  .document-list tr { display: flex; align-items: center; gap: 12px; min-height: 60px; border-top: 1px solid var(--line-soft); }
  .document-list thead tr { min-height: 36px; border-top: 0; }
  .document-list th, .document-list td { padding: 0; border: 0; }
  .document-list :is(th, td):not(.select-col, .name-col) { display: none; }
  .document-list .name-col { flex: 1; min-width: 0; }
  .document-list td.name-col > :not(.document-row), .document-list .wide-only { display: none; }
  .document-list .narrow-only { display: inline; margin: 0; font-size: 12px; font-weight: 400; }
  .document-row { display: flex; }
}

/* Processing progress (docs/design/screens/documents.md, "Processing progress"): the status is a link
   to the steps dialog, and carries the percentage while the document is processing. */
.status-link { display: inline-flex; align-items: center; color: inherit; text-decoration: none; border-radius: 6px; }
.status-link:hover .badge { box-shadow: inset 0 0 0 1px currentColor; }
.percent { font-family: var(--mono); font-weight: 400; margin-left: 5px; }
.document-row-meta .percent { margin-left: 0; }
.progress-row .badge { margin-left: 6px; }
.progress-row > div:first-child > :first-child { min-width: 0; overflow-wrap: anywhere; }
.progress-row > div:first-child > :last-child { flex-shrink: 0; white-space: nowrap; }
dialog.dialog .steps-file { display: flex; min-width: 0; margin: -8px 0 14px; font-size: 13px; color: var(--faint); white-space: nowrap; }
.steps-file .head { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.steps-file .tail { flex-shrink: 0; }
.steps-summary { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.steps-summary .progress { align-self: stretch; }
.steps { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.step { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: baseline; gap: 2px 10px; padding: 10px 12px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.step:first-child { border-top: 0; }
.step .status-dot { margin: 0; align-self: center; }
.step.waiting .status-dot { background: var(--faint); }
.step-name { overflow-wrap: anywhere; }
.step.waiting .step-name { color: var(--faint); }
.step-state { font-size: 12px; font-weight: 500; text-align: right; color: var(--faint); }
.step.done .step-state { color: var(--ok); }
.step.running .step-state { color: var(--accent-ink); }
.step.failed .step-state { color: var(--bad); }
.step.needs_review .step-state { color: var(--warn); }
.step-count { font-family: var(--mono); font-weight: 400; color: var(--text-2); }
dialog.dialog .step-error { grid-column: 2 / -1; margin: 0; font-size: 12px; line-height: 1.5; color: var(--bad); overflow-wrap: anywhere; }
dialog.dialog .step.needs_review .step-error { color: var(--warn); }
dialog.dialog .steps-hint { margin: 0 0 14px; font-size: 12px; color: var(--faint); }
/* Retry is in the polled frame, Close after it outside: one row above the other. */
.steps-retry { margin-bottom: 8px; }
.steps-dialog:has(.steps-retry) > .button-row { margin-top: 0; }
@media (max-width: 480px) {
  .step-state { grid-column: 2 / -1; text-align: left; }
}

/* A dialog that is a bottom sheet on a phone. */
.sheet-grip { display: none; }
@media (max-width: 760px) {
  dialog.sheet { width: 100%; max-width: none; max-height: 85vh; max-height: 85dvh; margin: auto 0 0; padding: 8px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; }
  dialog.sheet .sheet-grip { display: block; width: 36px; height: 4px; margin: 0 auto 12px; border-radius: 2px; background: #d6d6dc; }
}

/* Document page (docs/design/screens/documents.md, "Document page"). The sections reload
   with the poll; the preview sits outside that frame. */
.document-page { display: grid; grid-template-columns: minmax(0, 720px); gap: 28px; align-items: start; }
.document-page[data-preview="on"] { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); }
.document-page[data-preview="off"] .doc-preview { display: none; }
.doc-preview { position: sticky; top: 24px; min-width: 0; }
.doc-preview .pdf-scroll { max-height: 70vh; max-height: 70dvh; }
.preview-toggle { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 400; color: var(--text-2); }
.doc-section { padding-top: 20px; margin-top: 24px; border-top: 1px solid var(--line-soft); }
.doc-section:first-child { padding-top: 0; margin-top: 0; border-top: 0; }
.doc-section h3 { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin: 20px 0 6px; }
.details { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px 12px; margin: 12px 0 16px; font-size: 13px; }
.details dt { color: var(--faint); }
.details dd { overflow-wrap: anywhere; }
.details dd.num { font-family: var(--mono); font-size: 12px; }
.doc-section .rejection { margin: 8px 0 0; font-size: 13px; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-actions .delete { color: var(--bad); }
.version-list { font-size: 13px; }
.version-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 0; }
.version-list .mono { font-size: 12px; color: var(--muted); }
.version-list a { margin-left: auto; }
/* Applies to (docs/design/screens/applicability.md, "Applicability and withdrawing"). */
.applies-list { color: var(--text-2); }
.applies-list strong { color: var(--ink); }
.applies-form fieldset { min-width: 0; margin: 16px 0 0; padding: 0; border: 0; }
.applies-form legend, .dialog legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.applies-form .field-row { margin-bottom: 0; }
.dialog fieldset .options { margin: 0 0 16px; }
/* Suggested from the title page (docs/design/screens/applicability.md, "Suggested from the title page"). */
.suggestion { margin: 16px 0 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.suggestion h4 { margin: 0; font-size: 13px; font-weight: 600; }
.suggestion .hint { margin-top: 2px; }
.suggestion .rows { margin-top: 4px; }
.suggestion .rows > li:first-child { border-top: 0; }
.suggestion .quote-text { margin: 4px 0 0; font-size: 12px; color: var(--muted); white-space: normal; }
.suggestion .quote-words { white-space: pre-line; }
.suggestion .quote-meta { margin-left: 4px; }
.suggestion .button-row { margin-top: 4px; }
/* Supersedes (docs/design/screens/documents.md, "Revisions that coexist"). */
dd.link-list > span { display: block; }
.supersedes-form .supersedes-choice, .revision-form .revision-choice, .changes-form .changes-choice { display: flex; align-items: flex-start; gap: 8px; }
.supersedes-form select, .revision-form .text-input, .changes-form select { flex: 1; min-width: 0; margin-bottom: 0; }
/* Service bulletins (docs/design/screens/applicability.md, "Service bulletins"; docs/design/screens/machines.md, "Machine coverage"). */
.changes-list { color: var(--text-2); }
.changes-list > li > p { flex-basis: 100%; margin: 0; }
.changes-list .badge { margin-left: 6px; }
.changes-form option[data-level="2"] { padding-inline-start: 16px; }
.changed-by-list .badge { margin-left: 6px; }
.badge.bulletin { background: var(--accent-soft); color: var(--accent-ink); }
.cite-label .badge.bulletin { margin-right: 4px; }
.coverage-model { margin-top: 28px; }
.coverage-model .section-heading { margin-bottom: 8px; }
.coverage-model h2 { min-width: 0; overflow-wrap: anywhere; }
.coverage-count { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.coverage-model .progress { margin-bottom: 10px; }
.coverage-model p { margin: 4px 0; }
.coverage-model h3 { font-size: 13px; font-weight: 600; margin: 16px 0 6px; }
.coverage-serials { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px 16px; font-size: 13px; }
/* Parts lists on the document page */
.parts-list { margin-top: 20px; scroll-margin-top: 16px; }
.parts-list:first-of-type { margin-top: 12px; }
.doc-section .parts-list h3 { margin: 0 0 2px; }
.parts-list .heading-path { margin: 0; }
.parts-meta { margin: 0 0 8px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.parts-meta .mono { color: var(--faint); }
/* Relative, so an empty cell's absolutely placed .sr-only "none" stays in the box. Scroll shadows: the
   covers (local) move with the table and hide the shadows (scroll, fixed at the box's edges) at its ends,
   so a shadow shows only on a side with more table beyond it. */
.parts-table-wrap {
  position: relative; overflow: auto; overscroll-behavior-x: contain; max-height: 60vh;
  border: 1px solid var(--line); border-radius: var(--radius);
  background:
    linear-gradient(to right, var(--bg) 30%, rgb(255 255 255 / 0)) left / 32px 100% no-repeat local,
    linear-gradient(to left, var(--bg) 30%, rgb(255 255 255 / 0)) right / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgb(17 17 19 / 14%), rgb(17 17 19 / 0)) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgb(17 17 19 / 14%), rgb(17 17 19 / 0)) right / 12px 100% no-repeat scroll;
  background-color: var(--bg);
}
.parts-table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.parts-table { width: max-content; min-width: 100%; font-size: 13px; }
.parts-table th { position: sticky; top: 0; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); text-align: left; }
.parts-table td { padding: 8px 12px; vertical-align: top; overflow-wrap: anywhere; }
.parts-table tbody tr:first-child td { border-top: 0; }
.parts-table th:first-child, .parts-table td:first-child { padding-left: 12px; }
.parts-table th:last-child, .parts-table td:last-child { padding-right: 12px; }
.parts-table td.part-number { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.parts-table td.description { min-width: 160px; }
.parts-table td.notes, .parts-table td.applies { min-width: 120px; }
.parts-table .none { color: var(--faint); }
.parts-table .no-callout { display: block; font-size: 11px; color: var(--warn); }
.parts-review { margin: 10px 0 0; }
.parts-review > summary { font-size: 13px; font-weight: 500; }
.parts-review h4 { margin: 12px 0 0; font-size: 12px; font-weight: 500; color: var(--faint); }
.parts-review .skipped-list { margin-top: 0; }
@media (max-width: 760px) { .parts-review > summary { min-height: 44px; } }
@media (max-width: 1100px) {
  .document-page[data-preview="on"] { grid-template-columns: minmax(0, 720px); }
  .doc-preview { position: static; }
}
@media (max-width: 760px) {
  .doc-actions .button { height: 44px; font-size: 14px; }
  .details { grid-template-columns: 96px minmax(0, 1fr); }
  .version-list a { margin-left: 0; flex-basis: 100%; }
  .applies-list > li > .grow { flex-basis: 100%; }
  .applies-list .button, .applies-form .button, .suggestion .button { height: 44px; font-size: 14px; }
  .suggestion .button-row form { flex: 1; }
  .suggestion .button-row .button { width: 100%; }
  .applies-form .field-row > div { flex-basis: 100%; }
  .applies-form .button-row .button { flex: 1; }
  .supersedes-form select, .supersedes-form .button, .revision-form .text-input, .revision-form .button { height: 44px; font-size: 14px; }
  .changes-form select { height: 44px; font-size: 16px; }
  .changes-form .button, .changes-list .button { height: 44px; font-size: 14px; }
  .changes-list > li > .grow { flex-basis: 100%; }
  .coverage-model .section-heading { flex-direction: column; align-items: flex-start; gap: 2px; }
  .coverage-model .section-heading.with-tile { flex-direction: row; align-items: center; gap: 2px 10px; }
  .coverage-serials { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coverage-serials a { display: flex; align-items: center; min-height: 40px; }
}

/* Table passages: cells are exact slices of the source text. Only the wrap
   scrolls sideways, never the page. */
.passage, .review-grid > * { min-width: 0; }
.passage-table-wrap { overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--line); border-radius: var(--radius); }
.passage-table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.passage-table-wrap.cited-table { max-height: 60vh; overflow-y: auto; }
.passage-table { width: max-content; min-width: 100%; font-size: 13px; }
.passage-table td, .passage-table td:first-child, .passage-table td:last-child { padding: 8px 12px; border: 1px solid var(--line); min-width: 96px; max-width: 280px; vertical-align: top; white-space: pre-wrap; overflow-wrap: anywhere; }
.passage-table tr:first-child td { border-top: 0; }
.passage-table td:first-child { border-left: 0; }
.passage-table td:last-child { border-right: 0; }
.passage-table tr:last-child td { border-bottom: 0; }
.passage-table td.missing { background: var(--surface); }
.passage-table td.cited { background: rgb(var(--mark-rgb) / calc(0.7 * var(--mark-strength))); outline: 2px solid var(--ink); outline-offset: -2px; }

/* Admin cost statistics. */
.period-switch { display: flex; gap: 4px; margin-bottom: 12px; }
.period-switch a { height: 32px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: var(--radius); color: var(--muted); text-decoration: none; font-size: 13px; }
.period-switch a:hover { background: var(--hover); color: var(--ink); }
.period-switch a[aria-current="page"] { background: var(--hover); color: var(--ink); font-weight: 500; }
@media (max-width: 760px) { .period-switch a { flex: 1; justify-content: center; padding: 0; } }

/* Parts screen (docs/design/screens/parts.md, "Parts screen"). */
.part-group { margin-top: 28px; }
.part-group > header { margin-bottom: 8px; }
.part-group h2 { margin: 0; font-family: var(--mono); font-size: 15px; overflow-wrap: anywhere; }
.part-group-description { margin: 2px 0 0; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.part-group-count { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.parts-divider { margin: 36px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.part-uses td { vertical-align: top; font-size: 13px; }
.part-uses td.where .heading-path { margin: 0 0 2px; color: var(--text-2); overflow-wrap: anywhere; }
.part-uses td.where .at, .part-uses .row-description { margin: 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.part-uses td.where .at .mono { color: var(--faint); }
.part-uses td.where .drawing-link { display: inline-block; margin-top: 2px; }
.part-uses td.qty { white-space: nowrap; }
.part-uses td.qty .unit { color: var(--muted); }
.part-uses td.applies { min-width: 120px; overflow-wrap: anywhere; }
.part-uses .none { color: var(--faint); }
.part-uses td.document .badge { margin-left: 6px; }
.part-uses td.document .badge + .badge { margin-left: 4px; }
@media (max-width: 760px) {
  /* One block per occurrence: headers leave the layout (they stay for screen readers), Qty and Applies join one line. */
  .part-uses thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .part-uses, .part-uses tbody, .part-uses tr, .part-uses td { display: block; }
  .part-uses tr { padding: 12px 0; border-top: 1px solid var(--line-soft); }
  .part-uses td, .part-uses td:first-child, .part-uses td:last-child { padding: 0; border: 0; }
  .part-uses td.where { margin-top: 4px; }
  .part-uses td.qty, .part-uses td.applies { display: inline-block; min-width: 0; margin: 6px 16px 0 0; }
  .part-uses td.qty:has(.none), .part-uses td.applies:has(.none) { display: none; }
  .part-uses td.qty::before, .part-uses td.applies::before { content: attr(data-label) " "; color: var(--faint); }
  .part-uses td.where .drawing-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 0; }
}

/* Conflicts screen (docs/design/screens/conflicts.md, "Conflicts screen"). */
.period-switch .count { margin-left: 6px; font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--faint); }
.conflict-list td { vertical-align: top; font-size: 13px; }
.conflict-list td.severity { white-space: nowrap; }
.conflict-list td.subject { min-width: 160px; font-weight: 500; overflow-wrap: anywhere; }
.conflict-list td.side { min-width: 220px; width: 34%; }
.conflict-list .change-note { margin: 2px 0 0; font-size: 12px; font-weight: 400; color: var(--muted); overflow-wrap: anywhere; }
.conflict-list .claim-value { margin: 0 0 4px; font-family: var(--mono); font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.conflict-list .claim-value .claim-condition { font-family: var(--sans); font-size: 12px; color: var(--muted); }
.conflict-list .claim-quote { margin: 0 0 4px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.conflict-list .claim-source { margin: 0; font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.conflict-list .claim-source .source-link { margin-left: 6px; font-size: 12px; }
.conflict-list .claim-source .badge { margin-left: 6px; }
/* Grouped Conflicts tab: one row per thing stated, its values and the documents that state them. */
.conflict-list td.values { min-width: 280px; width: 62%; }
.claim-values, .claim-docs { list-style: none; margin: 0; padding: 0; }
.claim-values > li { padding: 10px 0 0; margin-top: 10px; border-top: 1px solid var(--line-soft); }
.claim-values > li:first-child { padding-top: 0; margin-top: 0; border-top: 0; }
.claim-values .claim-value { margin: 0 0 4px; }
.claim-count { margin-left: 6px; font-family: var(--sans); font-size: 12px; color: var(--muted); }
.claim-docs { font-size: 12px; color: var(--text-2); }
.claim-docs li { padding: 1px 0; overflow-wrap: anywhere; }
.claim-docs .source-link { margin-left: 6px; font-size: 12px; }
.claim-more > summary { padding: 2px 0; font-size: 12px; color: var(--accent-ink); cursor: pointer; list-style: none; }
.claim-more > summary::-webkit-details-marker { display: none; }
.claim-more > .claim-values { margin-top: 10px; }
@media (max-width: 760px) {
  /* One block per row: headers leave the layout (they stay for screen readers), the severity and the subject share a line, the two sides stack. */
  .conflict-list thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .conflict-list, .conflict-list tbody, .conflict-list tr, .conflict-list td { display: block; }
  .conflict-list tr { padding: 12px 0; border-top: 1px solid var(--line-soft); }
  .conflict-list td, .conflict-list td:first-child, .conflict-list td:last-child { padding: 0; border: 0; }
  .conflict-list td.severity { display: inline-block; margin-right: 8px; vertical-align: baseline; }
  .conflict-list td.subject { display: inline; min-width: 0; }
  .conflict-list td.side { min-width: 0; width: auto; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
  .conflict-list td.side[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 11px; color: var(--faint); }
  .conflict-list .claim-source .source-link { display: inline-flex; align-items: center; min-height: 44px; }
  .conflict-list td.values { min-width: 0; width: auto; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
  .claim-docs .source-link, .claim-more > summary { display: inline-flex; align-items: center; min-height: 44px; }
}

/* How a parts row was read: Read from a scan and Columns read by AI (docs/design/screens/parts.md, "Read from a scan"). */
.read-mark { display: block; margin: 2px 0 0; font-family: var(--sans); font-size: 11px; font-weight: 400; line-height: 1.4; color: var(--faint); white-space: normal; }
.scan-warning { margin: 4px 0 0; font-family: var(--sans); font-size: 12px; font-weight: 500; line-height: 1.4; color: var(--warn); white-space: normal; overflow-wrap: anywhere; }
.scan-warning .scan-page-link { display: block; margin-top: 2px; font-weight: 400; }
.parts-table td .scan-warning, .parts-cited td.part-number .scan-warning { width: 17em; max-width: 100%; }
.no-order-note { margin: 4px 0 0; font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.related.where-used > p.no-order-note { padding-top: 0; padding-bottom: 10px; font-weight: 400; background: transparent; border-bottom: 0; }
.callout-row .read-mark, .callout-row .scan-warning { margin-top: 4px; }
@media (max-width: 760px) {
  .scan-warning .scan-page-link { display: flex; align-items: center; min-height: 44px; margin-top: 0; }
  .parts-cited td.part-number .scan-warning { width: auto; }
  /* The parts table is as wide as its content and scrolls in its box: a fixed width that fits the phone's box
     beside the Item column keeps the warning wrapping in view. */
  .parts-table td .scan-warning { width: min(17em, calc(100vw - 120px)); }
  /* Under line 1 (the number and Order) on a phone; a warned row has no Order link, so focus follows what is seen. */
  .parts-cited td.part-number .read-mark, .parts-cited td.part-number .scan-warning { flex-basis: 100%; order: 1; }
}

/* Order link and Company page (docs/design/screens/parts.md, "Order link"; docs/design/screens/company.md, "Company"). */
.order-link { font-family: var(--sans); font-size: 12px; font-weight: 400; white-space: nowrap; }
.part-group-title { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; }
.part-group-title .order-link { font-size: 13px; }
.parts-cited td.part-number .order-link { display: block; margin-top: 2px; }
.where-used-title .order-link { margin-left: 12px; font-weight: 400; }
.callout-row .callout-list-link + .order-link { margin-left: 12px; }
.callout-row .order-link { display: inline-block; margin-top: 6px; }
.callout-row .replaced-by-lead .order-link { margin-top: 0; }
.shop-link-value { margin: 0; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.company-shop .text-input { font-family: var(--mono); font-size: 13px; }
.order-total { margin: 0 0 16px; font-size: 14px; color: var(--muted); }
.order-total strong { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); margin-right: 6px; }
.order-clicks td.part-number { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
/* Project settings, AI settings (docs/design/screens/projects.md): the warning above the sections, or the re-index's
   progress in its place, and the folded card of the models the project uses. */
.warn-callout { margin: 0 0 20px; padding: 12px 14px; border: 1px solid var(--warn); background: var(--warn-soft); border-radius: var(--radius); font-size: 13px; color: var(--ink); }
.warn-callout a { color: var(--ink); text-decoration: underline; }
.page > .progress-row { margin-top: 16px; }
details.ai-settings { background: var(--card); border-radius: var(--radius-xl); }
details.ai-settings > summary { position: relative; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 14px; padding: 16px; }
details.ai-settings > summary .summary-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-right: 48px; }
details.ai-settings > summary::-webkit-details-marker { display: none; }
details.ai-settings > summary strong { font-size: 15px; font-weight: 600; }
/* The label first on its own: a browser without alt text in content keeps it, and drops the line after. */
details.ai-settings > summary::after { content: "Show"; content: "Show" / ""; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--faint); }
details.ai-settings[open] > summary::after { content: "Hide"; content: "Hide" / ""; }
.ai-body { padding: 0 16px 8px; }
.ai-body h3 { font-size: 14px; margin: 20px 0 0; }
.ai-body h3:first-child { margin-top: 4px; }
.ai-body .project-models + p.muted { font-size: 13px; margin: 8px 0 0; }
.project-models { list-style: none; margin: 8px 0 0; padding: 0; }
.project-models li { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.project-models li:last-child { border-bottom: 0; }
.project-models li > p { grid-column: 1 / -1; margin: 0; }
.project-model-step { display: flex; flex-direction: column; font-size: 13px; }
.project-model-value { font-size: 13px; overflow-wrap: anywhere; }
.reading-footnote { margin-top: 12px; }
@media (max-width: 760px) {
  .project-models li { grid-template-columns: minmax(0, 1fr); }
  .part-group-title .order-link, .where-used-title .order-link, .callout-row .order-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 0; }
  .parts-cited td.part-number { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; }
  .parts-cited td.part-number .order-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 0; }
  .company-shop .text-input { font-size: 16px; height: 44px; }
}
