/* PRISMA Screening Tool (PRISM) -- standalone fullscreen instrument.
   OKLCH tokens, system font stacks, semantic human/AI colour. All classes namespaced pt-*.
   The category toggles use the shared "Category chip" of research.css; this file only
   places them. */

/* TOKENS */
:root {
  /* neutrals -- cool slate, very low chroma */
  --pt-surface:   oklch(1 0 0);
  --pt-surface-2: oklch(0.982 0.004 255);
  --pt-surface-3: oklch(0.955 0.005 255);
  --pt-border:    oklch(0.905 0.006 255);
  --pt-border-2:  oklch(0.86 0.008 255);
  --pt-ink:       oklch(0.27 0.02 262);
  --pt-ink-2:     oklch(0.46 0.018 262);
  --pt-ink-3:     oklch(0.55 0.014 262);   /* darkened for AA contrast of muted text (a11y) */
  --pt-ink-4:     oklch(0.63 0.011 262);   /* darkened for AA contrast of fine meta text (a11y) */

  /* functional accents -- hue carries meaning */
  --pt-human:     oklch(0.50 0.14 264);   /* binding / human / primary */
  --pt-human-bg:  color-mix(in oklab, var(--pt-human) 11%, white);
  --pt-human-line:color-mix(in oklab, var(--pt-human) 30%, white);
  --pt-ai:        oklch(0.50 0.11 218);   /* advisory / AI, dark enough for text */
  --pt-ai-bg:     color-mix(in oklab, var(--pt-ai) 10%, white);
  --pt-ai-line:   color-mix(in oklab, var(--pt-ai) 28%, white);
  --pt-include:   oklch(0.50 0.12 152);
  --pt-include-bg:oklch(0.955 0.035 152);
  --pt-exclude:   oklch(0.52 0.15 28);
  --pt-exclude-bg:oklch(0.955 0.035 33);
  --pt-warn:      oklch(0.66 0.14 70);    /* divergence / attention */
  --pt-warn-bg:   oklch(0.955 0.045 78);
  --pt-warn-line: oklch(0.84 0.08 75);
  --pt-warn-ink:  oklch(0.48 0.12 58);

  /* type */
  --pt-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --pt-mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  --pt-serif: Georgia, "Times New Roman", serif;

  --pt-2xs: 10.5px;
  --pt-xs:  11.5px;
  --pt-sm:  12.5px;
  --pt-base:13.5px;
  --pt-md:  15px;
  --pt-lg:  17px;
  --pt-xl:  21px;
  --pt-2xl: 27px;

  --pt-r-sm: 5px;
  --pt-r:    7px;
  --pt-r-lg: 10px;
  --pt-shadow-sm: 0 1px 2px oklch(0.4 0.03 262 / 0.06);
  --pt-shadow-lg: 0 12px 32px oklch(0.35 0.03 262 / 0.16), 0 2px 8px oklch(0.35 0.03 262 / 0.08);

  --pt-nav-w: 252px;
  --pt-rail-w: 344px;
}

/* BASE */
/* The page is one column: the shared site header keeps its natural height and the
   workspace fills the rest, so no header height is hard-coded here. */
body.pt-fullscreen {
  margin: 0; background: #fff; color: var(--pt-ink);
  font-family: var(--pt-sans); font-size: var(--pt-base);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden;
}
body.pt-fullscreen > header { flex: none; }
/* The workspace is read for hours on laptop screens, so its shared header keeps title and
   navigation on one compact row and leaves subtitle and authors to the other pages. */
body.pt-fullscreen > header { padding-top: 0.5rem; }
body.pt-fullscreen > header::after { margin-top: 0.5rem; }
body.pt-fullscreen .header-top { display: flex; align-items: center; gap: 1rem; }
body.pt-fullscreen .header-brand h1 { margin: 0; font-size: 1.35rem; white-space: nowrap; }
body.pt-fullscreen .header-brand .subtitle,
body.pt-fullscreen .header-brand .header-authors { display: none; }
body.pt-fullscreen .header-nav { flex-wrap: wrap; justify-content: flex-end; margin-top: 0; }
body.pt-fullscreen *, body.pt-fullscreen *::before, body.pt-fullscreen *::after { box-sizing: border-box; }
/* every [hidden] element stays hidden, whatever display rule a component sets */
body.pt-fullscreen [hidden] { display: none !important; }
.pt-fullscreen .mono { font-family: var(--pt-mono); }
#prisma-root {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  width: 100%; max-width: 1760px; margin: 0 auto; padding: 0.6rem 1.25rem 0.6rem;
}
.pt-surface { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

.pt-fullscreen ::-webkit-scrollbar { width: 10px; height: 10px; }
.pt-fullscreen ::-webkit-scrollbar-thumb { background: var(--pt-border-2); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
.pt-fullscreen ::-webkit-scrollbar-thumb:hover { background: var(--pt-ink-4); background-clip: padding-box; }
.pt-fullscreen ::-webkit-scrollbar-track { background: transparent; }

/* PRIMITIVES */
.pt-empty, .pt-muted { color: var(--pt-ink-3); font-size: var(--pt-sm); }
.pt-spacer { flex: 1; }
.pt-sub-head { margin: 0; font-size: var(--pt-xs); font-weight: 600; color: var(--pt-ink-2); }

.pt-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.38rem 0.75rem; border: 1px solid var(--pt-border-2); background: var(--pt-surface);
  border-radius: var(--pt-r-sm); font-size: var(--pt-sm); font-family: var(--pt-sans);
  color: var(--pt-ink); cursor: pointer; transition: background-color .12s, border-color .12s; white-space: nowrap;
}
.pt-btn:hover:not([disabled]) { border-color: var(--pt-ink-4); background: var(--pt-surface-2); }
.pt-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.pt-btn-sm { padding: 0.22rem 0.55rem; font-size: var(--pt-xs); }
.pt-link-btn {
  padding: 0; border: 0; background: none; color: var(--pt-human); cursor: pointer;
  font: inherit; font-size: var(--pt-xs); text-decoration: underline; text-underline-offset: 2px;
}
.pt-link-btn:hover { color: var(--pt-ink); }

/* toggle switch */
.pt-switch { position: relative; width: 30px; height: 17px; flex: none; display: inline-block; }
.pt-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pt-switch-track { position: absolute; inset: 0; background: var(--pt-border-2); border-radius: 20px; transition: .16s; pointer-events: none; }
.pt-switch-track::before { content: ""; position: absolute; width: 13px; height: 13px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .16s; box-shadow: var(--pt-shadow-sm); }
.pt-switch input:checked + .pt-switch-track { background: var(--pt-human); }
.pt-switch input:checked + .pt-switch-track::before { transform: translateX(13px); }
.pt-switch input:focus-visible + .pt-switch-track { outline: 2px solid var(--pt-human); outline-offset: 2px; }

.pt-dec-include { color: var(--pt-include); }
.pt-dec-exclude { color: var(--pt-exclude); }
.pt-dec-unclear { color: var(--pt-warn-ink); }

/* WORKSPACE: 3-PANE */
.pt-ws {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: var(--pt-nav-w) minmax(0, 1fr) var(--pt-rail-w);
  background: transparent; overflow: hidden;
}
.pt-ws > * { min-width: 0; min-height: 0; }

/* WORKSPACE: corpus column */
.pt-nav { background: var(--pt-surface-2); display: flex; flex-direction: column; min-height: 0; }
.pt-nav-tools { background: var(--pt-surface-2); }
.pt-wsbar-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; padding: 0.55rem 0.75rem 0.35rem; }
.pt-mode-seg, .pt-status-seg, .pt-assignee-seg { display: inline-flex; border: 1px solid var(--pt-border-2); border-radius: var(--pt-r-sm); background: var(--pt-surface); }
.pt-seg-btn { border: 0; background: transparent; color: var(--pt-ink-2); font: 600 var(--pt-xs) var(--pt-sans); padding: 0.3rem 0.55rem; cursor: pointer; white-space: nowrap; }
.pt-mode-seg .pt-seg-btn:first-child, .pt-status-seg .pt-seg-btn:first-child, .pt-assignee-seg .pt-seg-btn:first-child { border-radius: var(--pt-r-sm) 0 0 var(--pt-r-sm); }
.pt-mode-seg .pt-seg-btn:last-child, .pt-status-seg .pt-seg-btn:last-child, .pt-assignee-seg .pt-seg-btn:last-child { border-radius: 0 var(--pt-r-sm) var(--pt-r-sm) 0; }
.pt-seg-btn + .pt-seg-btn { border-left: 1px solid var(--pt-border-2); }
.pt-seg-btn:hover { color: var(--pt-ink); }
.pt-seg-btn[aria-pressed="true"] { background: var(--pt-human-bg); color: var(--pt-human); }
.pt-seg-count { font-weight: 500; color: var(--pt-ink-3); }
.pt-seg-btn[aria-pressed="true"] .pt-seg-count { color: inherit; }

.pt-ws-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 0.15rem 0.55rem; padding: 0.3rem 0.75rem; font-size: var(--pt-sm); color: var(--pt-ink-2); min-height: 2.5rem; }
.pt-ws-bar:empty { display: none; }

.pt-acceptance-status {
  display: flex; align-items: baseline; gap: 0.65rem; padding: 0.55rem 0.75rem;
  border: 1px solid var(--pt-warn-line); border-radius: var(--pt-r);
  background: var(--pt-warn-bg); color: var(--pt-warn-ink); font-size: var(--pt-sm);
}
.pt-acceptance-status strong { font-size: var(--pt-base); }

.pt-list-filters { display: grid; gap: 0.45rem; padding: 0.15rem 0.75rem 0.5rem; }
.pt-seg-row { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-self: start; }
/* one grid of two columns, each as wide as its widest chip, so the chips align and share
   their column width; each group starts on a new row, and the second is set apart by a
   spacer row instead of a separator glyph. A label that still does not fit takes both
   columns (bindFilters). */
.pt-cat-filter { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); justify-content: start; gap: 0.2rem; }
.pt-cat-filter-group { display: contents; }
.pt-cat-filter-group + .pt-cat-filter-group::before { content: ""; grid-column: 1 / -1; height: 0.2rem; }
.pt-cat-filter-group > :first-child { grid-column-start: 1; }
.pt-cat-filter .category-chip--compact { min-width: 0; padding: 0 0.3rem 0 0.25rem; min-height: 1.3rem; gap: 0.2rem; font-size: 0.66rem; }
.pt-cat-filter .chip-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-cat-filter .category-chip.is-wide { grid-column: 1 / -1; }
.pt-cat-filter .category-chip--compact .chip-dot { width: 7px; height: 7px; }

.pt-corpus-search { padding: 0 0.75rem 0.5rem; }
.pt-corpus-search input {
  width: 100%; padding: 0.42rem 0.6rem; border: 1px solid var(--pt-border-2); border-radius: var(--pt-r-sm);
  font-size: var(--pt-sm); font-family: var(--pt-sans); background: var(--pt-surface);
}
.pt-corpus-search input:focus { outline: none; border-color: var(--pt-human-line); }
.pt-corpus-empty { padding: 0.6rem; }

.pt-nav-list { position: relative; flex: 1 1 auto; overflow-y: auto; padding: 0.3rem 0.4rem 0.6rem; min-height: 0; } /* positioned so the sr-only spans stay inside the scroll container */
.pt-nav-item {
  display: flex; align-items: flex-start; gap: 0.5rem; width: 100%; text-align: left; border: none; background: none;
  border-radius: var(--pt-r); padding: 0.42rem 0.5rem; margin-bottom: 2px; cursor: pointer; font: inherit; color: inherit;
}
.pt-nav-item:hover { background: var(--pt-surface-3); }
.pt-nav-item.active { background: var(--pt-surface); box-shadow: var(--pt-shadow-sm), inset 0 0 0 1px var(--pt-border-2); }
.pt-nav-mark { flex: none; width: 11px; height: 11px; margin-top: 3px; border-radius: 50%; }
.pt-mark-expert { background: var(--pt-ink-3); position: relative; }
.pt-mark-expert::after { content: ""; position: absolute; left: 3.5px; top: 1.5px; width: 3px; height: 6px; border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.pt-mark-erfasst { background: var(--pt-human); position: relative; }
.pt-mark-erfasst::after { content: ""; position: absolute; left: 3.5px; top: 1.5px; width: 3px; height: 6px; border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.pt-nav-text { min-width: 0; flex: 1; }
.pt-nav-t {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  font-size: var(--pt-sm); font-weight: 500; line-height: 1.3; color: var(--pt-ink-2);
}
.pt-nav-item.active .pt-nav-t { color: var(--pt-ink); font-weight: 600; }
.pt-nav-m { display: block; font-size: var(--pt-2xs); color: var(--pt-ink-3); margin-top: 1px; }
.pt-nav-assignee { color: var(--pt-ink-2); }
.pt-nav-draft { color: var(--pt-warn-ink); font-weight: 600; }
.pt-nav-id { display: block; font-size: var(--pt-2xs); color: var(--pt-ink-3); margin-top: 2px; overflow-wrap: anywhere; }
.pt-nav-cats { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; max-width: 34px; margin-top: 4px; }
.pt-nav-cats .chip-dot, .pt-ref-cats .chip-dot { width: 7px; height: 7px; }
.chip-dot.is-partial { background: color-mix(in srgb, var(--chip-color) 30%, white); box-shadow: inset 0 0 0 1.25px var(--chip-color); }
.pt-hit-badge {
  flex: none; background: var(--pt-ai-bg); color: var(--pt-ai);
  border: 1px solid var(--pt-ai-line); border-radius: 20px; padding: 0 7px; height: 18px;
  display: inline-flex; align-items: center; font-size: var(--pt-2xs); font-weight: 600;
}
.pt-nav-list.is-searching .pt-nav-item { flex-wrap: wrap; }
.pt-nav-list.is-searching .pt-hit-badge { margin-left: 18px; }

/* Reviewer key and working folder */
.pt-sync-inline { margin: 0 0.6rem 0.2rem; }
.pt-sync-inline:empty { display: none; }
.pt-reviewer-setup, .pt-reviewer-choice, .pt-folder-setup, .pt-sync-ready {
  display: flex; align-items: center; gap: 0.35rem 0.6rem; flex-wrap: wrap; padding: 0.35rem 0.15rem;
}
.pt-reviewer-setup label { display: flex; align-items: center; }
.pt-reviewer-setup input { width: 96px; padding: 0.36rem 0.5rem; border: 1px solid var(--pt-border-2); border-radius: var(--pt-r-sm); font: var(--pt-sm) var(--pt-sans); }
.pt-reviewer-error { color: var(--pt-exclude); font-size: var(--pt-xs); }
.pt-sync-identity { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0.2rem 0.5rem; min-width: 0; font-size: var(--pt-xs); }
.pt-sync-identity strong { font-family: var(--pt-mono); }
.pt-sync-identity code { overflow-wrap: anywhere; color: var(--pt-ink-3); font-size: var(--pt-2xs); }
.pt-sync-ready .pt-sync-identity, .pt-folder-setup .pt-sync-identity { flex-basis: 100%; }
.pt-folder-status { display: inline-flex; align-items: baseline; gap: 0.6rem; color: var(--pt-ink-2); font-size: var(--pt-xs); }
.pt-sync-browser-note { margin: 0; color: var(--pt-warn-ink); font-size: var(--pt-xs); }
.pt-save-status { flex-basis: 100%; margin: 0.15rem 0 0; padding: 0.35rem 0.5rem; border-radius: var(--pt-r-sm); font-size: var(--pt-xs); }
.pt-save-saved { color: var(--pt-include); background: var(--pt-include-bg); }
.pt-save-saving { color: var(--pt-human); background: var(--pt-human-bg); }
.pt-save-dirty { color: var(--pt-warn-ink); background: var(--pt-warn-bg); }
.pt-save-error { color: var(--pt-exclude); background: var(--pt-exclude-bg); }
.pt-conflict { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; padding: 0.35rem 0.15rem; font-size: var(--pt-xs); color: var(--pt-exclude); }
.pt-conflict .pt-btn { max-width: 100%; white-space: normal; text-align: left; }
.pt-trial-note { font-size: var(--pt-xs); color: var(--pt-ink-3); }

/* WORKSPACE: reading column. Title and metadata stay in place, only the text scrolls. */
.pt-read { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--pt-surface); border-inline: 1px solid var(--pt-border); }
.pt-paper-head { flex: none; width: 100%; max-width: 820px; margin: 0 auto; padding: 0.85rem 1.5rem 0.55rem; overflow-wrap: anywhere; }
.pt-paper-title { font-family: var(--pt-serif); font-size: clamp(var(--pt-lg), 1.7vw, var(--pt-xl)); font-weight: 500; line-height: 1.22; letter-spacing: -0.01em; margin: 0 0 0.3rem; }
.pt-paper-metadata { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.15rem 1.1rem; margin: 0; padding: 0; color: var(--pt-ink-3); }
.pt-paper-metadata > div { min-width: 0; display: inline-flex; align-items: baseline; gap: 0.25rem; max-width: 100%; }
.pt-paper-metadata dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; } /* spoken, not shown: the values identify themselves */
.pt-paper-metadata dd { min-width: 0; margin: 0; font-size: var(--pt-xs); color: var(--pt-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-paper-metadata .pt-meta-warn dd, .pt-paper-metadata .pt-source-mark dd { color: var(--pt-warn-ink); font-weight: 600; }
.pt-doi-link, .pt-source-link { display: inline-block; max-width: 26ch; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; color: var(--pt-human); text-decoration-thickness: 1px; text-underline-offset: 2px; }
/* a DOI is an identifier that must be readable and copyable in full, so it wraps */
.pt-paper-metadata .pt-meta-doi dd { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.pt-paper-metadata .pt-meta-doi .pt-doi-link { display: inline; max-width: none; overflow: visible; }
.pt-doi-link:hover, .pt-source-link:hover { color: var(--pt-ink); }
.pt-layer-toggle { display: inline-flex; margin-top: 0.45rem; border: 1px solid var(--pt-border-2); border-radius: var(--pt-r-sm); }
.pt-layer-btn {
  border: none; background: var(--pt-surface); color: var(--pt-ink-3); cursor: pointer;
  font-family: var(--pt-sans); font-size: var(--pt-xs); font-weight: 600; padding: 0.28rem 0.65rem;
}
.pt-layer-btn:first-child { border-radius: var(--pt-r-sm) 0 0 var(--pt-r-sm); }
.pt-layer-btn:last-child { border-radius: 0 var(--pt-r-sm) var(--pt-r-sm) 0; }
.pt-layer-btn + .pt-layer-btn { border-left: 1px solid var(--pt-border-2); }
.pt-layer-btn:hover { color: var(--pt-ink-2); }
.pt-layer-btn[data-mode="full"].active { background: var(--pt-human-bg); color: var(--pt-human); }
.pt-layer-btn[data-mode="ai"].active { background: var(--pt-ai-bg); color: var(--pt-ai); }

.pt-reading-surface { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; border-top: 1px solid var(--pt-border); }
.pt-read-inner { max-width: 820px; margin: 0 auto; padding: 0 1.5rem 2rem; overflow-wrap: anywhere; }
.pt-layer-band {
  border: 1px solid var(--pt-ai-line); background: var(--pt-ai-bg); color: var(--pt-ai);
  font-size: var(--pt-xs); font-weight: 600; line-height: 1.45; padding: 0.4rem 0.6rem;
  border-radius: var(--pt-r-sm); margin-bottom: 0.8rem;
}
.pt-intext-bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0; margin-bottom: 0.3rem; background: var(--pt-surface);
}
.pt-intext-bar input {
  flex: 1; min-width: 0; padding: 0.38rem 0.6rem; border: 1px solid var(--pt-border-2);
  border-radius: var(--pt-r-sm); font-size: var(--pt-sm); font-family: var(--pt-sans);
}
.pt-intext-bar input:focus { outline: none; border-color: var(--pt-human-line); }
.pt-intext-count { min-width: 3.5em; text-align: right; font-size: var(--pt-xs); color: var(--pt-ink-3); font-variant-numeric: tabular-nums; }
.pt-intext-nav {
  width: 26px; height: 28px; border: 1px solid var(--pt-border-2); background: var(--pt-surface);
  border-radius: var(--pt-r-sm); cursor: pointer; color: var(--pt-ink-2); font-size: var(--pt-md); line-height: 1;
}
.pt-intext-nav:hover:not([disabled]) { border-color: var(--pt-ink-4); }
.pt-intext-nav[disabled] { opacity: 0.45; cursor: not-allowed; }
.pt-pin-hit { height: 28px; }

.pt-doc { max-width: 68ch; margin: 0 auto; font-family: var(--pt-serif); font-size: var(--pt-md); line-height: 1.76; color: var(--pt-ink); }
.pt-doc-h1, .pt-doc-h2, .pt-doc-h3, .pt-doc-h4 { font-family: var(--pt-sans); line-height: 1.3; letter-spacing: -0.01em; margin: 1.5rem 0 0.5rem; }
.pt-doc-h1 { font-size: var(--pt-xl); font-weight: 700; }
.pt-doc-h2 { font-size: var(--pt-lg); font-weight: 700; }
.pt-doc-h3 { font-size: var(--pt-md); font-weight: 700; color: var(--pt-ink-2); }
.pt-doc-h4 { font-size: var(--pt-base); font-weight: 700; color: var(--pt-ink-2); }
.pt-doc-p { margin: 0 0 0.9rem; text-wrap: pretty; }
/* author, affiliation and contact lines at the head of a full text, kept but set back */
.pt-doc .pt-doc-front { font-family: var(--pt-sans); font-size: var(--pt-xs); line-height: 1.45; color: var(--pt-ink-3); margin-bottom: 0.35rem; }
.pt-doc .pt-doc-keywords { font-family: var(--pt-sans); font-size: var(--pt-xs); line-height: 1.45; color: var(--pt-ink-3); }
.pt-doc-ul { margin: 0 0 0.9rem; padding-left: 1.3rem; }
.pt-doc-ul li { margin-bottom: 0.35rem; }
.pt-doc-q { margin: 0 0 0.9rem; padding: 0.4rem 0.9rem; border-left: 3px solid var(--pt-border-2); color: var(--pt-ink-2); font-style: italic; }
.pt-doc-hr { height: 1px; background: var(--pt-border); border: none; margin: 1.4rem 0; }
.pt-doc code { font-family: var(--pt-mono); font-size: 0.86em; background: var(--pt-surface-3); padding: 1px 5px; border-radius: 4px; }
/* pipe tables scroll inside their wrapper, never the reading pane */
.pt-doc-table { max-width: 100%; overflow-x: auto; margin: 0 0 1rem; }
.pt-doc-table table { border-collapse: collapse; font-family: var(--pt-sans); font-size: var(--pt-sm); line-height: 1.45; }
.pt-doc-table th, .pt-doc-table td { padding: 0.3rem 0.55rem; border: 1px solid var(--pt-border); text-align: left; vertical-align: top; overflow-wrap: normal; }
.pt-doc-table th { font-weight: 600; background: var(--pt-surface-2); }
.pt-doc-dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.15rem 1rem; margin: 0 0 1rem; font-size: var(--pt-base); line-height: 1.5; }
.pt-doc-dl > div { display: contents; }
.pt-doc-dl dt { font-family: var(--pt-sans); font-weight: 600; }
.pt-doc-dl dd { margin: 0; }
.pt-doc mark.pt-hit { background: var(--pt-surface-3); color: inherit; border-bottom: 2px solid var(--pt-ink-4); border-radius: 2px; padding: 0 1px; }
.pt-doc mark.pt-hit.active { background: var(--pt-ink-2); color: var(--pt-surface); border-bottom-color: var(--pt-ink-2); box-shadow: 0 0 0 2px var(--pt-border-2); }
.pt-read-screen ::selection { background: color-mix(in oklab, var(--pt-human) 24%, white); }
.pt-notext { margin: 1rem 0; font-family: var(--pt-sans); font-size: var(--pt-base); color: var(--pt-ink-2); }

/* WORKSPACE: assessment rail */
.pt-rail { background: var(--pt-surface-2); display: flex; flex-direction: column; min-height: 0; }
.pt-rail-head { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; padding: 0.6rem 1rem 0.1rem; }
.pt-rail-title { margin: 0 auto 0 0; font-size: var(--pt-md); font-weight: 650; }
.pt-save-mark { display: inline-grid; place-items: center; width: 18px; height: 18px; }
.pt-save-mark.is-dirty svg { width: 15px; height: 15px; fill: none; stroke: var(--pt-warn-ink); stroke-width: 1.6; stroke-linejoin: round; }
.pt-save-mark.is-saved svg { width: 15px; height: 15px; fill: none; stroke: var(--pt-include); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pt-decision { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 20px; font-size: var(--pt-sm); font-weight: 700; border: 1px solid transparent; }
.pt-decision-neutral { background: var(--pt-surface-3); color: var(--pt-ink); border-color: var(--pt-border-2); }
.pt-decision-include { background: var(--pt-include-bg); color: var(--pt-include); border-color: color-mix(in oklab, var(--pt-include) 25%, transparent); }
.pt-decision-exclude { background: var(--pt-exclude-bg); color: var(--pt-exclude); border-color: color-mix(in oklab, var(--pt-exclude) 25%, transparent); }
.pt-decision-unclear { background: var(--pt-warn-bg); color: var(--pt-warn-ink); border-color: var(--pt-warn-line); }
.pt-derived { font-size: var(--pt-2xs); color: var(--pt-ink-3); }
.pt-verdict { flex: none; margin: 0; padding: 0.1rem 1rem 0.2rem; font-size: var(--pt-sm); color: var(--pt-ink); font-weight: 600; }
.pt-verdict-edit summary { cursor: pointer; font-size: var(--pt-xs); color: var(--pt-ink-2); width: max-content; }
.pt-verdict-edit[open] summary { margin-bottom: 0.35rem; }
.pt-verdict-edit > .pt-reason-block { margin-top: 0.45rem; }
.pt-provenance { flex: none; margin: 0; padding: 0 1rem 0.45rem; font-size: var(--pt-xs); color: var(--pt-ink-2); }
.pt-text-basis { flex: none; margin: -0.3rem 0 0; padding: 0 1rem 0.45rem; font-size: var(--pt-xs); color: var(--pt-warn-ink); }
.pt-rail-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0.15rem 1rem 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.pt-read-only-note { padding: 0.6rem 1rem; }
.pt-dim .category-chips { margin-top: 0.25rem; gap: 0.28rem; }
.pt-dim .category-chip { min-height: 1.6rem; }
.pt-dim-none { font-size: var(--pt-xs); color: var(--pt-ink-3); }
/* codebook text of the toggle under focus or pointer */
.pt-cat-def { padding: 0.45rem 0.6rem; border-left: 3px solid var(--pt-border-2); background: var(--pt-surface); border-radius: var(--pt-r-sm); font-size: var(--pt-xs); line-height: 1.45; color: var(--pt-ink-2); }
.pt-cat-def p { margin: 0; }
.pt-cat-def p + p { margin-top: 0.25rem; }
.pt-cat-def-name { font-weight: 600; color: var(--pt-ink); }
.pt-cat-def-label { font-weight: 600; color: var(--pt-ink); }

.pt-override-row { display: flex; align-items: center; }
.pt-override { display: inline-flex; align-items: center; gap: 0.45rem; font-size: var(--pt-xs); color: var(--pt-ink-2); cursor: pointer; }
.pt-override-block { display: grid; gap: 0.25rem; }
.pt-override-input {
  width: 100%; padding: 0.4rem 0.55rem; border: 1px solid var(--pt-border-2);
  border-radius: var(--pt-r-sm); font-size: var(--pt-sm); font-family: var(--pt-sans);
  line-height: 1.45; resize: vertical; background: var(--pt-surface); color: var(--pt-ink);
}

.pt-reason-chips { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.25rem; }
.pt-reason-chip {
  min-height: 24px; padding: 0.1rem 0.55rem; border-radius: 20px; font: 500 var(--pt-xs) var(--pt-sans);
  border: 1px solid var(--pt-border-2); background: var(--pt-surface); color: var(--pt-ink-2); cursor: pointer;
}
.pt-reason-chip:hover:not([disabled]) { border-color: var(--pt-ink-4); }
.pt-reason-chip.sel { background: var(--pt-ink-2); color: var(--pt-surface); border-color: var(--pt-ink-2); font-weight: 600; }
.pt-reason-chip.sel::before { content: "\2713\00a0"; }
.pt-reason-chip[disabled] { cursor: default; }

.pt-evid-list { list-style: none; margin: 0.25rem 0 0; padding: 0; display: grid; gap: 0.12rem; }
.pt-evid-row { display: flex; align-items: center; gap: 0.35rem; min-width: 0; font-size: var(--pt-xs); line-height: 1.35; }
.pt-evid-cat { flex: none; font-weight: 600; color: var(--pt-ink); }
.pt-evid-snip { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--pt-ink-2); font-family: var(--pt-serif); }
.pt-evid-summary { display: grid; gap: 0.2rem; margin-top: 0.2rem; font-size: var(--pt-xs); line-height: 1.35; }
.pt-evid-summary.is-basis .pt-evid-label { color: var(--pt-ink-3); }
.pt-evid-summary.is-missing .pt-evid-label { color: var(--pt-warn-ink); font-weight: 600; }
.pt-evid-chips { display: flex; flex-wrap: wrap; gap: 0.2rem; }
.pt-evid-chips .category-chip--compact { padding: 0 0.38rem 0 0.3rem; min-height: 1.3rem; gap: 0.25rem; font-size: 0.66rem; }
.pt-evid-chips .chip-dot { width: 7px; height: 7px; }
.pt-evid-origin { flex: none; font-size: var(--pt-2xs); font-weight: 600; padding: 0 0.3rem; border: 1px solid var(--pt-ai-line); border-radius: var(--pt-r-sm); background: var(--pt-ai-bg); color: var(--pt-ai); }
.pt-evid-x { flex: none; border: none; background: none; color: var(--pt-ink-3); cursor: pointer; font-size: var(--pt-md); line-height: 1; padding: 0 2px; }
.pt-evid-x:hover { color: var(--pt-exclude); }

.pt-analysis-entry { display: flex; align-items: center; gap: 0.5rem; }
.pt-analysis-state { font-size: var(--pt-xs); color: var(--pt-ink-3); margin-right: auto; }
.pt-analysis-state.is-open { color: var(--pt-warn-ink); font-weight: 600; }
.pt-analysis-state.is-complete { color: var(--pt-include); }

.pt-history { margin: 0; font-size: var(--pt-2xs); color: var(--pt-ink-3); }

.pt-references { display: grid; gap: 0.15rem; padding-top: 0.45rem; border-top: 1px solid var(--pt-border); }
.pt-ref { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem; margin: 0; font-size: var(--pt-xs); color: var(--pt-ink-2); }
.pt-ref-label { color: var(--pt-ink-3); }
.pt-ref-cats { display: inline-flex; gap: 2px; }

.pt-provenance-details summary { cursor: pointer; font-size: var(--pt-xs); color: var(--pt-ink-2); font-weight: 600; }
.pt-provenance-body { display: grid; gap: 0.35rem; padding-top: 0.35rem; }
.pt-provenance-label { margin: 0.25rem 0 0; font-size: var(--pt-2xs); font-weight: 600; color: var(--pt-ink-3); }
.pt-verification-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.35rem; margin: 0; }
.pt-verification-grid div { min-width: 0; padding: 0.3rem 0.4rem; background: var(--pt-surface); border-radius: var(--pt-r-sm); }
.pt-verification-grid dt { font-size: var(--pt-2xs); font-weight: 600; color: var(--pt-ink-3); }
.pt-verification-grid dd { margin: 0.1rem 0 0; font-size: var(--pt-xs); overflow-wrap: anywhere; }
.pt-verification-activity > p { margin: 0 0 0.25rem; font-size: var(--pt-xs); overflow-wrap: anywhere; }
.pt-verify-empty { color: var(--pt-ink-3); font-style: italic; font-size: var(--pt-xs); }
.pt-verify-refs { margin: 0; padding-left: 1.1rem; }
.pt-verify-refs li { font-size: var(--pt-xs); line-height: 1.45; color: var(--pt-ink-2); overflow-wrap: anywhere; }
.pt-legacy-gap { margin: 0; padding: 0.35rem 0.5rem; border-left: 3px solid var(--pt-warn); border-radius: var(--pt-r-sm); background: var(--pt-warn-bg); color: var(--pt-warn-ink); font-size: var(--pt-xs); line-height: 1.45; }

.pt-action-dock { flex: none; display: grid; gap: 0.35rem; padding: 0.5rem 1rem 0.65rem; background: var(--pt-surface); border-top: 1px solid var(--pt-border-2); }
.pt-actions-hint { margin: 0; font-size: var(--pt-xs); color: var(--pt-warn-ink); }
.pt-actions-hint:empty { display: none; }
.pt-actions { display: flex; align-items: center; gap: 0.6rem; }
.pt-actions > button { white-space: nowrap; }
.pt-next-btn {
  display: inline-flex; align-items: center; gap: 0.35rem; height: 30px; padding: 0 12px; border-radius: var(--pt-r-sm);
  font-size: var(--pt-sm); font-weight: 600; font-family: var(--pt-sans); cursor: pointer;
  background: var(--pt-surface); border: 1px solid var(--pt-border-2); color: var(--pt-ink);
}
.pt-next-btn:hover { border-color: var(--pt-ink-4); }
.pt-save-btn {
  height: 30px; padding: 0 14px; border-radius: var(--pt-r-sm); font: 600 var(--pt-sm) var(--pt-sans); cursor: pointer;
  border: 1px solid var(--pt-human); background: var(--pt-human); color: var(--pt-surface); transition: background .12s, opacity .12s;
}
.pt-save-btn:hover:not([disabled]) { background: oklch(0.44 0.14 264); border-color: oklch(0.44 0.14 264); }
.pt-save-btn[aria-disabled="true"] { opacity: 0.45; }
.pt-save-btn[aria-disabled="true"]:hover { background: var(--pt-human); border-color: var(--pt-human); }
/* a set category still waiting for its Paper Beleg */
.pt-dim .category-chip.pt-chip-unbelegt { outline: 2px dashed var(--pt-warn-ink); outline-offset: 2px; }
@keyframes pt-gap-flash { 0%, 100% { box-shadow: none; } 40% { box-shadow: 0 0 0 4px var(--pt-warn); } }
.pt-gap-flash { animation: pt-gap-flash .9s ease-out 1; }
@media (prefers-reduced-motion: reduce) { .pt-gap-flash { animation: none; } }

/* analysis coding step (FR-14, ADR-026) */
.pt-anpanel { display: grid; gap: 0.75rem; }
.pt-an-field-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.3rem; }
.pt-an-label { font-size: var(--pt-sm); font-weight: 600; color: var(--pt-ink); }
.pt-an-optional { font-size: var(--pt-2xs); color: var(--pt-ink-3); }
.pt-an-hint { font-size: var(--pt-2xs); color: var(--pt-warn-ink); font-weight: 600; }
.pt-an-fixed { font-size: var(--pt-sm); color: var(--pt-ink-2); }
.pt-an-opts { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.pt-an-opts .pt-an-opt {
  min-height: 26px; padding: 0.15rem 0.6rem; border-radius: 20px; font: 500 var(--pt-xs) var(--pt-sans);
  border: 1px solid var(--pt-border-2); background: var(--pt-surface); color: var(--pt-ink-2); cursor: pointer;
}
.pt-an-opts .pt-an-opt:hover:not([disabled]) { border-color: var(--pt-ink-4); }
.pt-an-opts .pt-an-opt.sel { background: var(--pt-human-bg); color: var(--pt-human); border-color: var(--pt-human-line); font-weight: 600; }
.pt-an-opts .pt-an-opt.sel::before { content: "\2713\00a0"; }
.pt-an-opts .pt-an-undec { font-style: italic; }
.pt-an-notes {
  width: 100%; padding: 0.4rem 0.55rem; border: 1px solid var(--pt-border-2);
  border-radius: var(--pt-r-sm); font-size: var(--pt-sm); font-family: var(--pt-sans);
  line-height: 1.45; resize: vertical; background: var(--pt-surface); color: var(--pt-ink);
}
.pt-an-status { margin: 0; font-size: var(--pt-xs); color: var(--pt-warn-ink); }

/* PIN MENU */
.pt-pinmenu {
  position: fixed; left: 50%; top: 32%; transform: translateX(-50%); z-index: 80; width: 320px; max-width: calc(100vw - 16px);
  background: var(--pt-surface); border: 1px solid var(--pt-border-2); border-radius: var(--pt-r-lg);
  box-shadow: var(--pt-shadow-lg); padding: 0.7rem 0.8rem;
}
.pt-pinmenu-head { display: flex; align-items: center; margin-bottom: 0.4rem; }
.pt-pinmenu-x { margin-left: auto; border: none; background: none; cursor: pointer; font-size: var(--pt-lg); line-height: 1; color: var(--pt-ink-3); }
.pt-pinmenu-x:hover { color: var(--pt-ink); }
.pt-pinmenu-ai { margin: 0 0 0.5rem; font-size: var(--pt-xs); font-weight: 600; color: var(--pt-ai); }
.pt-pinmenu-snip { font-family: var(--pt-serif); font-size: var(--pt-sm); line-height: 1.5; color: var(--pt-ink-2); background: var(--pt-surface-2); border-radius: var(--pt-r-sm); padding: 0.4rem 0.55rem; margin-bottom: 0.6rem; }
.pt-pinmenu-cats { gap: 0.3rem; }

/* visible keyboard focus on every interactive control (WCAG 2.4.7) */
.pt-fullscreen .pt-btn:focus-visible,
.pt-link-btn:focus-visible,
#pt-reviewer-key:focus-visible,
.pt-save-btn:focus-visible,
.pt-seg-btn:focus-visible,
.pt-corpus-search input:focus-visible,
.pt-intext-bar input:focus-visible,
.pt-reason-chip:focus-visible,
.pt-layer-btn:focus-visible,
.pt-intext-nav:focus-visible,
.pt-pinmenu-x:focus-visible,
.pt-nav-item:focus-visible,
.pt-next-btn:focus-visible,
.pt-evid-x:focus-visible,
.pt-an-opt:focus-visible,
.pt-an-notes:focus-visible,
.pt-override-input:focus-visible,
.pt-provenance-details summary:focus-visible,
.pt-verdict-edit summary:focus-visible,
.pt-doi-link:focus-visible,
.pt-source-link:focus-visible,
.pt-doc-table:focus-visible {
  outline: 2px solid var(--pt-human); outline-offset: 2px;
}
.pt-paper-title:focus-visible { outline: 2px solid var(--pt-human); outline-offset: 4px; border-radius: var(--pt-r-sm); }
.pt-seg-btn:focus-visible, .pt-layer-btn:focus-visible { position: relative; z-index: 1; }

/* screen-reader-only text: carries what marks and dots show visually */
.pt-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* RESPONSIVE */
@media (max-width: 1320px) {
  :root { --pt-nav-w: 224px; --pt-rail-w: 330px; }
  #prisma-root { padding-inline: 0.75rem; }
  .pt-paper-head { padding-inline: 1.1rem; }
  .pt-read-inner { padding-inline: 1.1rem; }
}
/* Below a desktop width the page scrolls as a whole: list, text and assessment stack,
   each with a bounded height where it would otherwise grow without limit. */
@media (max-width: 1050px) {
  body.pt-fullscreen { height: auto; overflow: visible; }
  .pt-ws { display: flex; flex-direction: column; overflow: visible; }
  .pt-nav { border-bottom: 1px solid var(--pt-border); }
  .pt-nav-list { flex: none; max-height: 45vh; }
  .pt-read { height: 70vh; border-inline: 0; border-block: 1px solid var(--pt-border); }
  .pt-rail { min-height: 0; }
  .pt-rail-body { overflow: visible; }
}
/* touch screens: the compact chips and segments reach a comfortable target height */
@media (pointer: coarse) {
  .pt-fullscreen .category-chip, .pt-seg-btn, .pt-reason-chip { min-height: 32px; }
}
@media (max-width: 700px) {
  #prisma-root { padding-inline: 0; }
  .pt-paper-head { padding: 0.75rem 1rem 0.5rem; }
  .pt-read-inner { padding: 0 1rem 1.2rem; }
  .pt-pin-hit { padding-inline: 0.5rem; }
}
