/* Reviewer Selection Portal — editorial console.
   System font stacks only: this ships to an on-prem network where a webfont request
   would either hang or fail. */

:root {
  --paper: #faf9f6;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --ink: #1c1a17;
  --ink-2: #57514a;
  --ink-3: #8b847a;
  --rule: #e4dfd6;
  --rule-2: #d3ccc0;
  /* Primary action. Taken from the Integra logo's own blue. It was a burgundy, which sat 7
     degrees of hue from --bad: the primary action and the error state were effectively the
     same colour, and a red "go" button reads as "stop". Blue frees red for errors alone. */
  --accent: #3f52a2;
  --on-accent: #ffffff;
  --accent-soft: #eceffb;
  --ok: #2c6a4a;
  --ok-soft: #e7f1ea;
  --warn: #8a5600;
  --warn-soft: #fbf0dc;
  --bad: #9e2f2f;
  --bad-soft: #f8e8e7;
  --shadow: 0 1px 2px rgba(28, 26, 23, .06), 0 4px 12px rgba(28, 26, 23, .04);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --radius: 6px;
  --rail: 264px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #16151300;
    --paper: #151412;
    --surface: #1d1b19;
    --surface-2: #232120;
    --ink: #eeeae4;
    --ink-2: #b3aca3;
    --ink-3: #857e75;
    --rule: #302d2a;
    --rule-2: #413d38;
    --accent: #9fadf0;
    --on-accent: #131832;
    --accent-soft: #1e2440;
    --ok: #7bbd96;
    --ok-soft: #1c2a22;
    --warn: #dcac5e;
    --warn-soft: #2c2418;
    --bad: #e08a86;
    --bad-soft: #2e1e1d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 12px rgba(0, 0, 0, .2);
  }
}

:root[data-theme="dark"] {
  --paper: #151412;
  --surface: #1d1b19;
  --surface-2: #232120;
  --ink: #eeeae4;
  --ink-2: #b3aca3;
  --ink-3: #857e75;
  --rule: #302d2a;
  --rule-2: #413d38;
  --accent: #9fadf0;
  --on-accent: #131832;
  --accent-soft: #1e2440;
  --ok: #7bbd96;
  --ok-soft: #1c2a22;
  --warn: #dcac5e;
  --warn-soft: #2c2418;
  --bad: #e08a86;
  --bad-soft: #2e1e1d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 12px rgba(0, 0, 0, .2);
}

* { box-sizing: border-box; }

/* Any rule that sets `display` outranks the UA stylesheet's `[hidden] { display: none }`,
   so an element with a display of its own stays on screen while claiming to be hidden.
   This bit the publisher marks: both were rendered at once regardless of the selection. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
button { font: inherit; color: inherit; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Icons inherit colour and sit on the text baseline wherever they are dropped. */
.ico { display: inline-flex; align-items: center; flex: none; }
.ico svg { display: block; }
.card > h3 .ico { color: var(--ink-3); }
.tab .ico { opacity: .65; }
.tab[aria-selected="true"] .ico { opacity: 1; color: var(--accent); }
.btn .ico { opacity: .8; }
.btn.primary .ico { opacity: 1; }
.banner > .ico { margin-top: 1px; align-self: flex-start; }
.banner.bad > .ico { color: var(--bad); }
.banner.warn > .ico { color: var(--warn); }
.banner.ok > .ico { color: var(--ok); }
.banner.info > .ico { color: var(--accent); }

/* ---------------------------------------------------------------- shell -- */

.shell { display: flex; flex-direction: column; min-height: 100%; }

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 17px; }
.topbar h1 small { display: block; font: 400 11px/1.3 var(--sans); color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; }
.topbar .spacer { flex: 1; }

/* Brand mark.
   Drop a replacement at public/img/logo.png and it picks it up — the slot sizes by height and
   keeps the asset's own aspect ratio, so any reasonable logo fits.

   The wordmark is black ink on a transparent background, which disappears against a dark
   header. It sits on a white plate in dark mode rather than being inverted: a filter would
   flip the orange "in" to blue and the three brand dots to their complements, which is worse
   than a plate. If a reverse/white version of the logo ever exists, swap it in under the
   dark-mode rules and drop the plate. */
.brand {
  display: flex;
  align-items: center;
  flex: none;
  padding: 4px 7px;
  border-radius: 5px;
  line-height: 0;
  background: transparent;
  transition: background .15s;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand { background: #fff; }
}
:root[data-theme="dark"] .brand { background: #fff; }
.brand img {
  height: 26px;
  width: auto;
  display: block;
}
.topbar h1 {
  padding-left: 14px;
  margin-left: 2px;
  border-left: 1px solid var(--rule);
}
@media (max-width: 560px) {
  /* 2.1.1: at phone width "engine ok" broke over two lines and the header ran off the right edge. */
  .topbar { flex-wrap: wrap; gap: 8px 12px; padding: 8px 14px; }
  .topbar h1, .mode, .verbadge { white-space: nowrap; }
  .brand img { height: 20px; }
  .topbar h1 { padding-left: 10px; font-size: 15px; }
  .topbar h1 small { display: none; }
}

.mode {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink-2);
  padding: 4px 10px; border: 1px solid var(--rule-2); border-radius: 100px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.dot.live { box-shadow: 0 0 0 0 currentColor; animation: pulse 2s infinite; color: var(--ok); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(44,106,74,.45); } 70% { box-shadow: 0 0 0 6px rgba(44,106,74,0); } 100% { box-shadow: 0 0 0 0 rgba(44,106,74,0); } }
@media (prefers-reduced-motion: reduce) { .dot.live { animation: none; } }

.body { display: flex; flex: 1; min-height: 0; align-items: flex-start; }

/* ------------------------------------------------------------------ rail -- */

.rail {
  width: var(--rail); flex: none;
  border-right: 1px solid var(--rule);
  background: var(--surface);
  align-self: stretch;
  display: flex; flex-direction: column;
  position: sticky; top: 49px; max-height: calc(100vh - 49px);
}
.rail header {
  padding: 14px 16px 8px;
  display: flex; align-items: baseline; gap: 8px;
}
.rail header h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; font-family: var(--sans); font-weight: 600; color: var(--ink-3); }
.rail .list { overflow-y: auto; padding: 0 8px 12px; flex: 1; }
.rail .empty { padding: 12px 16px; color: var(--ink-3); font-size: 13px; }

.runcard {
  width: 100%; text-align: left; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius);
  padding: 9px 10px; margin-bottom: 2px; display: block;
}
.runcard:hover { background: var(--surface-2); }
.runcard[aria-current="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.runcard .t { font-size: 13px; line-height: 1.35; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.runcard .m { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-3); }

.state { font-size: 11px; padding: 1px 7px; border-radius: 100px; border: 1px solid; white-space: nowrap; }
.state.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-soft); }
.state.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-soft); }
.state.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: var(--bad-soft); }
.state.idle { color: var(--ink-3); border-color: var(--rule-2); background: var(--surface-2); }

/* ------------------------------------------------------------------ main -- */

.main { flex: 1; min-width: 0; padding: 0 0 64px; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin: 0 0 22px; position: sticky; top: 49px; background: var(--paper); z-index: 20; padding-top: 14px; }
/* 6.0.0: the tab row never makes the page scroll sideways, at any width, and no label wraps to a second
   line (below ~1100 px "All eligible" and "Developer log" did both, and the row grew from 55 to 76 px — the sticky
   stack is 104 px). Narrower, it tightens first, then the Developer log keeps only its icon (its name stays in the
   hover and for screen readers); past that the row scrolls within itself, as it always did on a phone. */
.tabs { container: tabs / inline-size; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 8px 14px; cursor: pointer; color: var(--ink-3); font-size: 14px;
  display: inline-flex; align-items: center; gap: 7px;
  flex: none; white-space: nowrap;
}
@container tabs (max-width: 900px) {
  .tab { padding-inline: 10px; gap: 6px; }
  .aside-tab { padding-left: 12px; }
}
@container tabs (max-width: 780px) {
  .aside-tab .tab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tab .n { font-size: 11px; background: var(--surface-2); border: 1px solid var(--rule); border-radius: 100px; padding: 0 6px; color: var(--ink-2); }
.tab:disabled { opacity: .4; cursor: not-allowed; }

/* The Developer log is diagnostics, not part of choosing reviewers. Pushed to the far end of
   the bar and set in a quieter register so the four working tabs read as the actual flow. */
.aside-tab {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--ink-3);
  border-left: 1px solid var(--rule);
  padding-left: 16px;
}
.aside-tab:not(:disabled):hover { color: var(--ink-2); }
.aside-tab[aria-selected="true"] { color: var(--ink-2); font-weight: 500; }

.devnote {
  font-size: 13px;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 9px 13px;
  margin: 0 0 16px;
  max-width: 78ch;
}
.devnote strong { color: var(--ink); font-weight: 600; }

.view { display: none; }
.view.on { display: block; }

.lede { font-family: var(--serif); font-size: 15px; color: var(--ink-2); max-width: 66ch; margin: 0 0 22px; }

/* Manuscript tab: form body on the left, readiness and the search button pinned on the
   right, so what the engine will make of the intake is visible while it is being typed
   rather than only after scrolling to the bottom. */
.intake-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.intake-main { min-width: 0; }
.intake-side { position: sticky; top: 104px; min-width: 0; }
.intake-side .card { margin-bottom: 12px; }
.intake-side .card.initiate .inner { display: grid; gap: 12px; }
.intake-side .card.initiate #submitBtn { justify-content: center; }

/* Controls that live inside a card heading: the manuscript id and the publisher. They sit
   with the title because they identify the manuscript rather than describe it. */
/* input[type=text] is (0,1,1) and beats a bare class, so this selector has to out-specify
   the global field width rather than rely on source order. */
input[type=text].hdr-input {
  /* Flexible, not fixed (3.3.2): when the heading runs short it gives up width before anything
     wraps, and takes spare width when there is room. 110px still shows a generated MS id. */
  flex: 1 1 110px;
  min-width: 110px;
  max-width: 170px;
  width: auto;
  font: 12px var(--mono);
  padding: 4px 8px;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius);
  background: var(--paper);
}
.hdr-input::placeholder { font-family: var(--sans); letter-spacing: .01em; }

.hdr-pub {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--rule-2); border-radius: var(--radius);
  background: var(--paper); padding: 2px 6px 2px 8px;
}
.hdr-pub .pubmark { color: var(--ink-3); display: flex; }
.hdr-pub .publogo { height: 13px; width: auto; display: block; }
:root[data-theme="dark"] .hdr-pub .publogo,
:root:not([data-theme="light"]) .hdr-pub .publogo { filter: brightness(2.4) saturate(.6); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .hdr-pub .publogo { filter: none; }
}
.hdr-pub select {
  width: auto; border: 0; background: none; padding: 2px 2px 2px 0;
  /* Size to the CHOSEN option, not the longest (3.3.2): "Default rules" made the closed menu
     33px wider than "Sage rules" needs, and the heading wrapped at a 1512px window. */
  field-sizing: content;
  font: 13px var(--sans); color: var(--ink); cursor: pointer;
}

.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.runcard .t2 {
  font-size: 11px; color: var(--ink-3); margin: -2px 0 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Build badge. Small and permanent: every screenshot, bug report and CSV can be tied back to
   the build that produced it. */
.verbadge {
  font: 500 11px var(--mono);
  color: var(--ink-3);
  border: 1px solid var(--rule-2);
  border-radius: 100px;
  padding: 3px 9px;
  white-space: nowrap;
  flex: none;
}

/* Who is signed in, and the way out. Hidden entirely when sign-in is not configured, so a
   local run without credentials looks exactly as it did before Entra existed.
   ⚠️ NOT `.who` — that class already belongs to the identity block inside a reviewer card
   (`.rev .who`), which is a block column. A bare `.who { display: flex }` here reached into
   every card and laid name, affiliation, ORCID and email out side by side. Keep topbar
   classes namespaced; the card had the name first. */
.session {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid var(--rule);
}
.session-name {
  font: 500 12px var(--sans);
  color: var(--ink-2);
  white-space: nowrap;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The name is the least important thing in the topbar — on a narrow screen the sign-out
   control is what has to survive. */
@media (max-width: 900px) {
  .session-name { display: none; }
  .session { padding-left: 6px; }
}

/* Same shell as the publisher control so the header reads as one row of fields rather than
   a field, a field and a stray link. A bare <select> also sizes itself to its longest option,
   which left a wide gap between the label and the arrow — the wrapper fixes the width and the
   select fills it. */
.hdr-example {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--rule-2); border-radius: var(--radius);
  background: var(--paper); padding: 2px 6px 2px 8px;
}
.hdr-example .exmark { color: var(--ink-3); display: flex; }
.hdr-example select {
  width: 118px;
  border: 0; background: none; padding: 2px 2px 2px 0;
  font: 13px var(--sans); color: var(--ink); cursor: pointer;
}

/* Where the browser can size a menu to its chosen option (Chrome 123+), header menus do; others
   keep the fixed width above. */
@supports (field-sizing: content) {
  .hdr-example select { width: auto; field-sizing: content; }
}
.titlemark { display: flex; align-items: center; color: var(--accent); flex: none; }
.topbar h1 { padding-left: 10px; border-left: 0; margin-left: 0; }
.intake-side #readyList { max-height: 46vh; overflow-y: auto; overscroll-behavior: contain; }

@media (max-width: 1080px) {
  .intake-grid { grid-template-columns: 1fr; }
  .intake-side { position: static; }
  .intake-side #readyList { max-height: none; }
}

/* ----------------------------------------------------------------- forms -- */

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.card > h3 { font-size: 15px; padding: 13px 16px; border-bottom: 1px solid var(--rule); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; row-gap: 8px; }
/* A card heading adapts to its OWN width, not the window's (3.3.2). Controls in a heading (the
   Manuscript id, publisher, Load example, Clear) had one layout; when a label grew or the window
   narrowed, the last group broke onto a second line on its own. Now, as the heading tightens:
   first Clear drops to its icon (the title and the accessible name keep the word), then the
   heading becomes two deliberate rows — title + id, then publisher … tools. */
.card > h3 { container: cardhead / inline-size; }
@container cardhead (max-width: 630px) {
  .card > h3 #clearBtn { font-size: 0; gap: 0; padding-inline: 7px; }
}
@container cardhead (max-width: 520px) {
  /* Two deliberate rows: the title and the id (the id takes the rest of the line), then the
     publisher on the left and the tools on the right, like a toolbar. */
  .card > h3 input[type=text].hdr-input { flex: 1 1 60%; max-width: none; }
}
.card > h3 .hint { font: 400 12px var(--sans); color: var(--ink-3); margin-left: auto; display: flex; align-items: center; gap: 4px; flex: none; }
.card .inner { padding: 16px; }

.field { margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
.field > label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 5px; }
.field .help { font-size: 12px; color: var(--ink-3); margin: 4px 0 0; }
/* The rules the chosen publisher runs (engine 1.3.0 lanes), under the form header. */
.lanehelp { font-size: 12.5px; color: var(--ink-2); margin: 0 0 12px; }
.lanehelp b { font-weight: 600; color: var(--ink); }

input[type=text], input[type=email], textarea, select {
  width: 100%; padding: 8px 10px; font: inherit; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--radius);
}
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, .runcard:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-soft); }

.row { display: grid; gap: 10px; }
.row.c2 { grid-template-columns: 1fr 1fr; }
.row.c3 { grid-template-columns: 1fr 1fr 1fr; }

.err { color: var(--bad); font-size: 12px; margin-top: 4px; display: block; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--rule-2); border-radius: var(--radius); background: var(--paper); }
.chips input { border: 0; background: none; flex: 1; min-width: 120px; padding: 3px 4px; outline: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; background: var(--surface-2); border: 1px solid var(--rule); border-radius: 100px; padding: 2px 4px 2px 10px; font-size: 13px; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--ink-3); line-height: 1; padding: 2px 4px; border-radius: 50%; }
.chip button:hover { color: var(--bad); background: var(--bad-soft); }
/* Primary-keyword star (engine 1.4.0, Sage rules — 3.3.0). Scoped to the chip; the remove button
   keeps its own hover. */
.chip button.star { color: var(--ink-3); font-size: 14px; padding: 0 3px 0 0; margin-left: -4px; }
.chip button.star:hover { color: var(--warn); background: none; }
.chip button.star[aria-pressed="true"] { color: var(--warn); }
.chip.primary { border-color: color-mix(in srgb, var(--warn) 45%, var(--rule)); }
.chip button.star:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.author { border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; background: var(--paper); }
.author .head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.author .head strong { font-size: 13px; }
.author .head .spacer { flex: 1; }
.corr { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
/* "No ORCID available" — the corresponding author's deliberate opt-out. Same rhythm as .corr,
   one step quieter, so it reads as an answer to the field above rather than a new field. */
/* Scoped as `.field > label.noorcid` on purpose: `.field > label` (0,1,1) is the uppercase
   field-label style and would otherwise win over a bare class (0,1,0) — the specificity trap
   in capsule 09. */
.field > label.noorcid { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink-2); cursor: pointer; margin: 8px 0 0; }
.field > label.noorcid input { margin: 0; flex: none; }

.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: var(--radius); border: 1px solid var(--rule-2); background: var(--surface); cursor: pointer; font-size: 14px; }
.btn:hover:not(:disabled) { border-color: var(--ink-3); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------------------- readiness -- */

.readiness { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); padding: 14px 16px; }
.readiness .top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.readiness .score { font-family: var(--serif); font-size: 26px; line-height: 1; }
.readiness .meter { flex: 1; height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.readiness .meter i { display: block; height: 100%; background: var(--ok); transition: width .3s; }
.readiness.thin .meter i { background: var(--warn); }
.readiness.bad .meter i { background: var(--bad); }

.advice { display: flex; gap: 9px; padding: 9px 0; border-top: 1px solid var(--rule); font-size: 13px; }
.advice:first-of-type { border-top: 0; }
.advice .ic { flex: none; width: 18px; height: 18px; border-radius: 50%; margin-top: 1px; display: grid; place-items: center; }
.advice.high .ic { background: var(--bad-soft); color: var(--bad); }
.advice.medium .ic { background: var(--warn-soft); color: var(--warn); }
.advice.low .ic { background: var(--surface-2); color: var(--ink-3); }
.advice b { display: block; font-weight: 600; }
.advice p { margin: 2px 0 0; color: var(--ink-2); }

/* ---------------------------------------------------------------- banner -- */

.banner { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; border: 1px solid; display: flex; gap: 12px; }
.banner.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.banner.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
/* 5.0.0: waiting in the gateway's queue — information, not a warning; nothing is wrong. */
.banner.info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.banner .mark { font-size: 18px; line-height: 1.2; flex: none; }
.banner h4 { font-size: 14px; font-family: var(--sans); font-weight: 700; margin-bottom: 3px; }
.banner p { margin: 0 0 6px; font-size: 13px; color: var(--ink-2); max-width: 78ch; }
/* A list in a banner reads as the paragraph does — without this it took the body's 15px and ran
   larger than the banner's own heading (the engine's anchor-confidence signals, 3.1.1). */
.banner ul { margin: 0 0 6px; padding-left: 18px; font-size: 13px; color: var(--ink-2); max-width: 78ch; }
.banner li { margin: 1px 0; }
.banner .fix { font-size: 13px; }
.banner .fix b { font-weight: 600; }
.banner code { font: 12px var(--mono); background: rgba(0,0,0,.05); padding: 1px 4px; border-radius: 3px; }
/* Engine 1.6.0 abort: the searches that ran. A query is one long word, so it wraps inside the banner. */
.banner details.searched { margin: 2px 0 6px; }
.banner details.searched ul { margin: 4px 0 0; }
.banner details.searched code { word-break: break-word; }

.ack { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; padding-top: 9px; border-top: 1px solid color-mix(in srgb, var(--bad) 25%, transparent); }

/* ----------------------------------------------------------------- stats -- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 14px; }
.stat .v { font-family: var(--serif); font-size: 27px; line-height: 1.1; }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-top: 3px; }
.stat .s { font-size: 12px; color: var(--ink-2); margin-top: 5px; }
.stat.accent .v { color: var(--accent); }
.stat.muted .v { color: var(--ink-3); }
.stat.val .v { color: var(--accent); }

/* --------------------------------------------------------------- stages -- */

.stages { display: flex; flex-wrap: wrap; gap: 6px; }
.stagechip { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); padding: 8px 11px; min-width: 104px; }
.stagechip .n { font-size: 12px; font-weight: 600; text-transform: capitalize; display: flex; align-items: center; gap: 5px; }
.stagechip .c { font: 11px var(--mono); color: var(--ink-3); margin-top: 4px; }
.stagechip.done { border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.stagechip.active { border-color: var(--accent); background: var(--accent-soft); }

/* The sticky "which manuscript is this?" strip under the tabs. Sticky rather than a right-
   hand panel: the shortlist is a vertical read of dense cards, and a side panel would take
   width from them exactly when we want to show more of them — and vanish at the widths where
   that squeeze is worst. */
.runctx {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 9px 2px 10px;
  margin-bottom: 4px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
/* 2.1.1: the title is what identifies the run, so it keeps at least ~34 characters; keyword chips
   and the meta block wrap to a second line instead of squeezing it to "Intrat…". */
.runctx .ctx-title { display: flex; align-items: baseline; gap: 9px; min-width: min(34ch, 100%); flex: 1 1 34ch; }
.runctx .ctx-title b { font: 600 13px var(--mono); color: var(--ink); flex: none; }
.runctx .ctx-title span {
  font-size: 13px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.runctx .ctx-kw { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; flex: none; }
.runctx .ctx-more { font: 11px var(--sans); color: var(--ink-3); }
/* A primary keyword the engine applied (1.4.0 echo). */
.runctx .ctx-kw .pill.kwp { border-color: color-mix(in srgb, var(--warn) 45%, var(--rule-2)); }
.runctx .ctx-kw .pill.kwp b { color: var(--warn); font-weight: 700; }
.runctx .ctx-meta { display: flex; align-items: center; gap: 10px; flex: none; font-size: 12px; color: var(--ink-3); }
/* How the conflict check was built. A pill, not a banner — it is a property of the run. */
.runctx .ctx-meta .pill.basis,
.runctx .ctx-meta .pill.lane { font-size: 11.5px; padding: 1px 8px; white-space: nowrap; }
.pickn { font: 500 11px var(--sans); color: var(--accent); }
/* Below this the title alone fills the row; keywords wrap under it rather than squeezing it. */
@media (max-width: 1080px) {
  .runctx .ctx-title { flex: 1 0 100%; }
}
/* 3.0.0: the lane chip ("Sage rules not applied") is longer than the plain publisher name it
   replaced, so on a phone the meta row wraps instead of pushing "Full intake" off the screen. */
@media (max-width: 640px) {
  .runctx .ctx-meta { flex: 1 1 100%; flex-wrap: wrap; row-gap: 6px; }
  /* Found by the same sweep, older than 3.0.0: long keywords (CIX-26-0146.R1) held the chip row
     at its full width, and the page scrolled sideways on a phone. */
  .runctx .ctx-kw { flex: 1 1 100%; min-width: 0; }
}

/* Collapsing the run list. Deliberately a labelled stub, not an icon rail — see the comment
   on #railToggle in index.html. */
.rail { transition: width .16s ease; }
.rail .railtoggle { font-size: 11px; line-height: 1; padding: 4px 7px; }
.rail .railstub { display: none; }
.rail.collapsed { width: 44px; overflow: hidden; }
.rail.collapsed > header,
.rail.collapsed > .list { display: none; }
.rail.collapsed .railstub {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  padding: 14px 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-3);
  font: 500 11px var(--sans);
}
.rail.collapsed .railstub:hover { color: var(--ink); background: var(--surface-2); }
.rail.collapsed .railstub .lab {
  writing-mode: vertical-rl;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.rail.collapsed .railstub .n {
  font: 11px var(--mono);
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  padding: 1px 5px;
}

/* A manuscript keyword found in the matched paper's title. This is the one place the card
   answers "why is this person here?" without the editor holding the manuscript in their
   head — and a single hit on a five-keyword manuscript reads as the thin match it is. */
/* Country flags. The flag is the INSTITUTION's country — parsed from the affiliation on the
   matching paper — so it sits with the institution, never with the person's name. Country
   spread is a policy the engine enforces, and a flag answers "how concentrated is this slate"
   in peripheral vision, which a country name cannot. */
/* Chrome on Windows has no flag glyphs and prints the two regional-indicator letters ("US")
   instead. This bundled font — the Twemoji country-flag subset, 78 KB, served from our own
   origin with no network — draws them on every platform, so a slate looks the same to every
   editor. unicode-range limits it to regional indicators and the tag sequences, so the browser
   fetches it only when a flag is on the page and never uses it for any other character.
   Art: Twemoji, CC-BY 4.0 — see /fonts/TwemojiCountryFlags.LICENSE.md and the README. */
@font-face {
  font-family: "Twemoji Country Flags";
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067,
    U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
  src: url("/fonts/TwemojiCountryFlags.woff2") format("woff2");
  font-display: swap;
}
.flag {
  flex: none;
  font-size: 14px;
  line-height: 1;
  /* The bundled flag font first, deliberately on every platform: macOS draws the same Twemoji
     flag as Windows rather than Apple's own. The system emoji fonts stay as the fallback in
     case the font file fails to load. */
  font-family: "Twemoji Country Flags", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
/* Unrecognised or mis-parsed country: a muted marker rather than a wrong flag. The engine's
   country field is parsed text and does produce junk, and surfacing that is the honest move. */
.flag.noflag { font-size: 12px; color: var(--ink-3); font-family: var(--sans); }

/* "About every card on this run" (2.1.0): what used to repeat on every card, said once. Quiet
   on purpose — it is context for the list, not an alarm — so it is a ruled note, not a banner. */
.runnotes { border: 1px dashed var(--rule-2); border-radius: var(--radius); background: var(--surface-2); padding: 10px 14px; margin-bottom: 14px; font-size: 13px; color: var(--ink-2); }
.runnotes h5 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-family: var(--sans); font-weight: 700; margin: 0 0 4px; }
.runnotes ul { margin: 0; padding-left: 18px; }
.runnotes .method { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 4px; }
.runnotes .method details.note { margin: 0; }
/* Passed checks, collapsed: one "Clear" line, each reason one click away. */
details.note.passed > div { display: grid; gap: 8px; margin-top: 6px; }
.passed-one > b { display: block; font-size: 12.5px; }

.rev .aff { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.rev .aff .cty { color: var(--ink-3); font-size: 12px; }

/* Where to go and check this person, under the address you would write to — the order an
   editor actually works in. Labelled "Verify on" rather than "sources": ORCID and OpenAlex
   are records of the PERSON, PubMed is the PAPER that matched. */
.rev .verify {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 5px;
  font: 12px var(--sans);
}
.rev .verify .vlabel {
  font: 600 10.5px var(--sans);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
}
.rev .verify .plink {
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px dotted var(--rule-2);
}
.rev .verify .plink:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Spread panel rows.
   The count sits IMMEDIATELY after the name, not right-aligned. Right-aligning it invented a
   numeric column that does not exist, and left the institutions' count sitting against the
   countries' flag — so two independent lists read as one four-column matrix. "Ferrara ×3" is
   one phrase; keeping it one phrase keeps this a list. */
ul.spreadlist { margin: 0; padding: 0; list-style: none; }
ul.spreadlist li {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 3px 0;
  font-size: 13px;
  color: var(--ink-2);
}
ul.spreadlist li .lbl { min-width: 0; }
ul.spreadlist li b {
  flex: none;
  font: 600 11px var(--mono);
  color: var(--ink-3);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 1px 7px;
}
/* And give the two lists a real gutter, so they read as two things rather than one grid. */
.rev-spread-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; }
.rev-spread-cols > div + div { border-left: 1px solid var(--rule); padding-left: 34px; }

/* Further work by this reviewer. One or two DOIs is what the engine returns, so it is
   labelled as a sample and never as a publication list. */
.rev .alsowrote { margin: 6px 0 0; font: 12px var(--mono); color: var(--ink-3); line-height: 1.6; }
.rev .alsowrote .k {
  font: 11px var(--sans);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-right: 7px;
}
.rev .alsowrote a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule-2); }
.rev .alsowrote a:hover { color: var(--accent); border-bottom-color: var(--accent); }
/* Engine 1.4.0 recent papers (3.3.0): the list in Evidence, and the count chip on the card face. */
.rev .works { margin: 8px 0 0; font-size: 13px; }
.rev .works .k { font: 11px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 0 0 3px; }
.rev .works ul { margin: 0; padding-left: 18px; }
.rev .works li { margin: 2px 0; overflow-wrap: anywhere; }
.rev .works .y { font-variant-numeric: tabular-nums; color: var(--ink-3); }
.rev .works .j { color: var(--ink-3); }
.rev .works a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule-2); }
.rev .works a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.rev .works .na { font-size: 12px; margin: 4px 0 0; }
.rev .sig button.worksbtn { cursor: pointer; font: inherit; font-size: 12px; }
.rev .sig button.worksbtn:hover { color: var(--accent); border-color: var(--accent); }
.rev .sig button.worksbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

mark.kwhit {
  background: var(--accent-soft);
  color: var(--ink);
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 500;
}

/* "What was searched" — the intake a finished run was submitted with. Collapsed by default:
   it answers a question you only sometimes ask, and expanded by default it would push the
   stage funnel below the fold. Every selector here is scoped under .recap — the topbar
   `.who` incident came from a bare class in this file reaching into a component that had
   the name first. */
details.recap {
  margin: 0 0 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}
details.recap > summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  font: 500 13px var(--sans);
  color: var(--ink-2);
  list-style: none;
}
details.recap > summary::-webkit-details-marker { display: none; }
details.recap > summary:hover { color: var(--ink); }
details.recap[open] > summary { border-bottom: 1px solid var(--rule); }
details.recap > *:not(summary) { padding: 0 13px; }
details.recap > *:not(summary):first-of-type { padding-top: 11px; }
details.recap > *:not(summary):last-child { padding-bottom: 12px; }

.recap-row { display: flex; gap: 14px; padding: 5px 0; align-items: baseline; }
.recap-row + .recap-row { border-top: 1px solid var(--rule); }
.recap-k {
  flex: none;
  width: 108px;
  font: 11px var(--sans);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
}
.recap-v { flex: 1; min-width: 0; font-size: 13px; color: var(--ink); line-height: 1.5; }
.recap-v .mono { font: 12px var(--mono); }
.recap-v .na { color: var(--ink-3); font-style: italic; }
/* The abstract is the one field that can run long. Cap it and let it scroll inside itself
   rather than turning the panel into a wall of text. */
.recap-abs { margin: 0; max-height: 132px; overflow: auto; color: var(--ink-2); }
.recap-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.recap-author { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; padding: 2px 0; }
.recap-author .s { font-size: 12px; color: var(--ink-3); }

details.note { margin-top: 10px; }
details.note summary { cursor: pointer; font-size: 12px; color: var(--ink-2); padding: 4px 0; }
details.note summary:hover { color: var(--ink); }
details.note pre { font: 12px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 11px; margin: 6px 0 0; max-height: 340px; overflow: auto; color: var(--ink-2); }

/* ------------------------------------------------------------- reviewers -- */

.rev { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); margin-bottom: 10px; box-shadow: var(--shadow); }
.rev.shortlisted { border-color: var(--accent); }
.rev > .top { display: flex; gap: 14px; padding: 14px 16px; align-items: flex-start; }
.rev .pos { font-family: var(--serif); font-size: 19px; color: var(--ink-3); min-width: 26px; text-align: right; flex: none; padding-top: 1px; }
/* 3.1.0: the number says what it is, like "fit / 100" under the score. */
.rev .pos small { display: block; font: 600 9.5px/1.2 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-top: 2px; white-space: nowrap; }
/* The score rank under "place" when the engine's order differs from it (4.0.0, the owner's C1). */
.rev .pos small.srank { font-weight: 500; margin-top: 1px; }
/* Where each of the engine's groups starts, in the engine's order only (4.0.0, the owner's B1). */
#slList > h3.ghead, #slList > .pickedcards > h3.ghead { font: 600 11px/1.35 var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 18px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--rule); text-wrap: balance; }
/* Why a better-ranked reviewer sits in Consider (3.1.0). Read with the name, not buried below. */
.rev .whynot { display: flex; gap: 6px; align-items: center; margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--warn); }
.rev .whynot .ico, .rev .whynot svg { flex: none; }
.rev .who { flex: 1; min-width: 0; }
.rev .who h4 { font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rev .who .aff { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.rev .who .ids { font: 11px var(--mono); color: var(--ink-3); margin-top: 4px; display: flex; gap: 12px; flex-wrap: wrap; }

/* Address sits with the name, not behind a button: it is what an editor reads first and
   copies most often. */
.rev .who .mail { display: flex; align-items: center; gap: 6px; margin-top: 5px; font: 12px var(--mono); min-width: 0; }
.rev .who .mail .mi { color: var(--ink-3); display: flex; flex: none; }
.rev .who .mail a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rev .who .mail a:hover { border-bottom-color: var(--accent); color: var(--accent); }
.rev .who .mail.guess a { color: var(--ink-2); }
.rev .who .mail .tag {
  font: 600 9px/1.6 var(--sans); text-transform: uppercase; letter-spacing: .06em;
  color: var(--warn); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-radius: 3px; padding: 0 5px; flex: none;
}

button.copy {
  border: 0; background: none; padding: 2px; margin: 0; cursor: pointer; flex: none;
  color: var(--ink-3); border-radius: 4px; display: flex; align-items: center;
}
button.copy:hover { color: var(--accent); background: var(--surface-2); }
button.copy.done { color: var(--ok); }
.rev .score { text-align: right; flex: none; }
.rev .score .v { font-family: var(--serif); font-size: 22px; line-height: 1; }
.rev .score .k { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }

.sig { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; }
.pill { font-size: 12px; border-radius: 100px; padding: 2px 9px; border: 1px solid; display: inline-flex; align-items: center; gap: 5px; }
.pill.ok { color: var(--ok); background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.pill.warn { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.pill.bad { color: var(--bad); background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.pill.mute { color: var(--ink-3); background: var(--surface-2); border-color: var(--rule); }
/* Engine 1.5.0, Sage rules: Validated — portal blue, never a second green "Recommended" (4.0.0). */
.pill.val { color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }

.evidence { border-top: 1px solid var(--rule); padding: 12px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.evidence .blk h5 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-family: var(--sans); font-weight: 700; margin-bottom: 5px; }
.evidence .blk p { margin: 0; font-size: 13px; color: var(--ink-2); }
.evidence .paper { font-style: italic; }
.evidence .paper a { font-style: normal; }
.evidence ul { margin: 0; padding-left: 16px; font-size: 13px; color: var(--ink-2); }
.evidence li { margin-bottom: 3px; }
.evidence .na { color: var(--ink-3); font-style: italic; }

.bars { display: grid; gap: 5px; }
/* 2.1.1: the value column was 34px, so "22.67/40" was clipped into the Standing column (107 bar
   values across 100 cards), and "Identity confidence" wrapped. Both columns now size to their text. */
.bar { display: grid; grid-template-columns: 132px minmax(40px, 1fr) max-content; gap: 8px; align-items: center; font-size: 12px; }
.bar .t { white-space: nowrap; }
.bar .t { color: var(--ink-2); }
.bar .track { height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.bar .track i { display: block; height: 100%; background: var(--accent); }
.bar .n { text-align: right; font: 11px var(--mono); color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

.gates { border-top: 1px solid var(--rule); padding: 10px 16px 14px; }
.gate { display: flex; gap: 9px; align-items: flex-start; padding: 6px 0; font-size: 13px; border-top: 1px dotted var(--rule); }
.gate:first-child { border-top: 0; }
.gate .v { flex: none; font-size: 11px; padding: 1px 7px; border-radius: 3px; border: 1px solid; min-width: 82px; text-align: center; }
.gate .v.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: var(--ok-soft); }
.gate .v.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); background: var(--warn-soft); }
.gate .v.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); background: var(--bad-soft); }
.gate .d { min-width: 0; }
.gate .d b { font-weight: 600; }
.gate .d p { margin: 1px 0 0; color: var(--ink-2); }
/* Evidence as lines (3.0.0): the subject check and the namesake flag, where the evidence is the
   finding — what each matched paper is about, which forename each byline gives. */
.gate .d ul.ev { margin: 4px 0 0; padding-left: 16px; font-size: 12.5px; color: var(--ink-2); }
.gate .d ul.ev li { margin: 1px 0; overflow-wrap: anywhere; }
.gate .d ul.ev a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 2px; }

/* Evidence disclosure.
   The panel is height-capped and scrolls INSIDE itself. On a ranked shortlist, expanding one
   reviewer must not push the ranking below off screen — you need to keep reading down the
   list while inspecting one person. So the card grows by at most --panel-max, and the
   evidence scrolls within that. */
.rev .detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .24s ease;
}
.rev.open .detail { grid-template-rows: 1fr; }
.rev .detail > .panel { overflow: hidden; min-height: 0; }
.rev.open .detail > .panel {
  --panel-max: 340px;
  max-height: var(--panel-max);
  overflow-y: auto;
  overscroll-behavior: contain;       /* scrolling the panel does not scroll the page behind */
  border-top: 1px solid var(--rule);
  /* Shadows that appear only when there is more to scroll to. */
  background:
    linear-gradient(var(--surface) 30%, transparent) top / 100% 22px no-repeat,
    linear-gradient(transparent, var(--surface) 70%) bottom / 100% 22px no-repeat,
    radial-gradient(farthest-side at 50% 0, rgba(0,0,0,.12), transparent) top / 100% 7px no-repeat,
    radial-gradient(farthest-side at 50% 100%, rgba(0,0,0,.12), transparent) bottom / 100% 7px no-repeat;
  background-attachment: local, local, scroll, scroll;
}
.rev.open .detail > .panel > *:first-child { border-top: 0; }

/* Minimize bar: sticks to the top of the evidence panel so it is reachable from anywhere
   inside the scroll, without scrolling back down to the footer toggle. */
.panelbar {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding: 5px 16px;
  display: flex;
  justify-content: flex-end;
}
.minimize {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--rule-2); background: var(--surface-2); cursor: pointer;
  padding: 2px 9px 2px 7px; border-radius: 100px;
  font-size: 11px; color: var(--ink-2); line-height: 1.7;
}
.minimize:hover { color: var(--accent); border-color: var(--accent); }
.minimize .chev { display: flex; transform: rotate(180deg); }
.rev .detail > .panel::-webkit-scrollbar { width: 9px; }
.rev .detail > .panel::-webkit-scrollbar-thumb { background: var(--rule-2); border-radius: 5px; border: 2px solid var(--surface); }
.rev .detail > .panel::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  .rev .detail { transition: none; }
}

.evtoggle {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid transparent; background: none; cursor: pointer;
  padding: 4px 9px 4px 10px; border-radius: var(--radius);
  font-size: 13px; color: var(--ink-2);
}
.evtoggle:hover { background: var(--surface); border-color: var(--rule-2); color: var(--ink); }
.evtoggle .chev { display: flex; transition: transform .24s ease; }
.rev.open .evtoggle { color: var(--accent); font-weight: 600; }
.rev.open .evtoggle .chev { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .evtoggle .chev { transition: none; } }

.rev .foot { border-top: 1px solid var(--rule); padding: 9px 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.rev .foot .spacer { flex: 1; }
.rev .foot .why { font-size: 12px; color: var(--ink-3); }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=text] { width: auto; flex: 1; min-width: 180px; text-overflow: ellipsis; }
/* The toolbar adapts to its OWN width too (3.3.2, same treatment as the card headings): at a 1000px
   window Export CSV broke onto a line of its own. Tight: the filter gives up width and Expand all
   drops to its icon (its title keeps the word). Narrow: the filter takes a full row, the controls
   the next — a layout, not an accident. */
.toolbar { container: toolbar / inline-size; }
@container toolbar (max-width: 760px) {
  .toolbar input[type=text] { min-width: 140px; }
  .toolbar #expandAll { font-size: 0; gap: 0; padding-inline: 8px; }
}
@container toolbar (max-width: 600px) {
  .toolbar input[type=text] { flex: 1 0 100%; }
}
.toolbar .seg { display: flex; border: 1px solid var(--rule-2); border-radius: var(--radius); overflow: hidden; }
.toolbar .seg button { border: 0; background: var(--surface); padding: 6px 12px; cursor: pointer; font-size: 13px; border-left: 1px solid var(--rule); }
.toolbar .seg button:first-child { border-left: 0; }
.toolbar .seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.empty-state { text-align: center; padding: 56px 20px; color: var(--ink-3); }
.empty-state h3 { font-size: 17px; color: var(--ink-2); margin-bottom: 6px; }
.empty-state p { margin: 0 auto; max-width: 46ch; font-size: 14px; }

.toast { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: grid; gap: 8px; }
.toast div { background: var(--surface); border: 1px solid var(--rule-2); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--shadow); font-size: 13px; max-width: 360px; }
.toast div.bad { border-left-color: var(--bad); }
.toast div.ok { border-left-color: var(--ok); }
/* 5.3.3: a mark before the words — a pick says so in green with a tick, an unpick in grey with a minus. */
.toast div { display: flex; align-items: flex-start; gap: 8px; }
.toast div .ico { flex: none; margin-top: 2px; }
.toast div.ok .ico { color: var(--ok); }
.toast div.mute { border-left-color: var(--ink-3); }
.toast div.mute .ico { color: var(--ink-3); }

table.plain { width: 100%; border-collapse: collapse; font-size: 13px; }
table.plain th, table.plain td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.plain td { overflow-wrap: anywhere; }
table.plain th { white-space: nowrap; width: 1%; }
table.plain th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
table.plain td.n { font: 12px var(--mono); color: var(--ink-2); }

@media (max-width: 900px) {
  .rail { display: none; }
  .evidence { grid-template-columns: 1fr; }
  .row.c2, .row.c3 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .rev > .top { flex-wrap: wrap; }
}

/* ------------------------------------------------- Upload JSON (5.1.0) -- */
/* A Content Pilot export of the ScholarOne manuscript page fills the form (public/js/contentpilot.js).
   Every class here is prefixed cp- (09: a bare class once reached into the reviewer cards). */

/* The button sits with the form's other tools in the Manuscript heading. It is production's way in, so it
   keeps its words longest: when the heading runs short (from about 700 px, a 1512 px window), Load example
   (a demo tool) drops to its ▶ first, its menu still opening from the icon; then Clear (630 px, as before);
   the heading's two deliberate rows at 520 px; and only on a phone-narrow heading does Upload JSON lose its
   words. The accessible names and titles keep them throughout. */
.card > h3 .cp-upload { flex: none; }
@container cardhead (max-width: 700px) {
  .card > h3 .hdr-example { position: relative; padding: 4px 7px; }
  .card > h3 .hdr-example select { position: absolute; inset: 0; width: 100%; opacity: 0; }
  .card > h3 .hdr-example:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
}
@container cardhead (max-width: 380px) {
  .card > h3 #importJsonBtn { font-size: 0; gap: 0; padding-inline: 7px; }
}

/* A field the export left empty or wrong, until the editor fills it: amber, the portal's "needs you".
   (0,2,1) to beat input[type=text]; a red error state still wins over it. */
input[type].cp-need, textarea.cp-need, .chips.cp-need {
  border-color: var(--warn);
  background: var(--warn-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 18%, transparent);
}
input[type].cp-need[aria-invalid="true"], textarea.cp-need[aria-invalid="true"] {
  border-color: var(--bad); background: var(--bad-soft); box-shadow: none;
}
#authorList.cp-need .author .corr { color: var(--warn); font-weight: 600; }

/* The tooltip that asks for it: in the page's flow under its field (never over the next one), with an
   arrow pointing up at the field. */
.cp-tip {
  position: relative;
  /* Hugs its words, like a tooltip; a long message wraps at its field's width. */
  width: fit-content; max-width: 100%;
  display: flex; align-items: flex-start; gap: 7px;
  margin: 9px 0 0; padding: 7px 11px;
  font: 400 12.5px/1.45 var(--sans); letter-spacing: 0; text-transform: none;
  color: var(--ink);
  background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cp-tip::before {
  content: '';
  position: absolute; top: -6px; left: var(--cp-arrow, 14px);
  width: 10px; height: 10px;
  background: var(--warn-soft);
  border: solid color-mix(in srgb, var(--warn) 45%, transparent);
  border-width: 1px 0 0 1px;
  transform: rotate(45deg);
}
.cp-tip > .ico { color: var(--warn); flex: none; margin-top: 2px; }
/* Above its target (the author list), pointing down. */
.cp-tip.cp-above { margin: 0 0 12px; }
.cp-tip.cp-above::before { top: auto; bottom: -6px; border-width: 0 1px 1px 0; }
/* Under the Manuscript heading, pointing up at the ID field in it. */
.cp-tip.cp-under-head { margin: 12px 16px 0; }
@media (prefers-reduced-motion: no-preference) {
  .cp-tip.cp-new { animation: cp-pop .28s ease-out both; }
}
@keyframes cp-pop { from { opacity: 0; transform: translateY(-4px); } }

/* The import's note above the form. */
.banner.cp-import { align-items: flex-start; }
.cp-import-body { flex: 1; min-width: 0; }
.cp-import-body > p { margin: 0; }
.cp-import-meta { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
/* One fact never breaks inside itself ("4 authors" stays together); the line breaks between facts. */
.cp-import-meta .cp-fact { white-space: nowrap; }
.cp-import-body > .cp-import-lede { margin-top: 8px; font-size: 13px; font-weight: 600; }
/* .banner ul is (0,1,1): these lists are scoped under .banner to outrank it. */
.banner .cp-needlist { list-style: none; margin: 7px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cp-jump {
  font: 500 12.5px var(--sans); color: var(--ink);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--warn) 50%, var(--rule));
  border-radius: 100px; padding: 3px 11px; cursor: pointer;
}
.cp-jump:hover { border-color: var(--warn); background: var(--paper); }
.banner .cp-notes { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 12.5px; }
.cp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.banner .cp-dismiss { flex: none; align-self: flex-start; margin: -4px -6px 0 0; }

/* ------------------------------------------------- Phase 1 (5.2.0, Sage runs) -- */
/* Every rule is scoped under the component that owns it: the Sage card (.rev.simple), the filter card
   (.fcard), All eligible (#view-eligible), the form's new notes. A bare class once reached into the
   reviewer cards (09, the .who incident). */

/* A link-styled button, for "Clear filters", "Show here", "See all …". */
button.lnk { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
button.lnk:hover { text-decoration-thickness: 2px; }

/* --- the Sage card (P5 B + P4's facts + P2's chip) --- */
.rev.simple .who .mail.addr { flex-wrap: wrap; row-gap: 4px; font-size: 13px; }
.rev.simple .who .aff { margin-bottom: 0; }
.rev.simple .who .mail.addr .pill { font-family: var(--sans); }
.rev.simple .who .mail.addr.none { font-family: var(--sans); }
.rev.simple .facts { margin: 5px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; overflow-wrap: anywhere; }
.rev.simple .facts .yearbtn { border: 0; background: none; padding: 0; font: 600 12.5px var(--sans); color: var(--ink); cursor: pointer; border-bottom: 1px dotted var(--ink-3); }
.rev.simple .facts .yearbtn:hover, .rev.simple .facts button.more:hover { color: var(--accent); border-bottom-color: var(--accent); }
.rev.simple .facts button.more { border: 0; background: none; padding: 0 0 0 6px; font: 12px var(--sans); color: var(--ink-3); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.rev.simple .facts .pj { color: var(--ink-3); }
.rev.simple .facts.counts .short { display: none; }
.rev.simple .facts.counts.na, .rev.simple .facts.counts.est { color: var(--ink-3); }
.rev.simple .ids .cue { font-family: var(--sans); font-size: 11.5px; padding: 0 6px; border-radius: 3px; border: 1px solid; }
.rev.simple .ids .cue.warn { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.rev.simple .ids .cue.mute { color: var(--ink-3); background: var(--surface-2); border-color: var(--rule); }
.rev.simple .whynot.aside { color: var(--warn); }
.rev .ptag { display: inline-block; font: 600 10.5px/1.5 var(--sans); padding: 0 6px; margin-left: 6px; border-radius: 3px; border: 1px solid; vertical-align: 1px; white-space: nowrap; }
.rev .ptag.mute { color: var(--ink-2); background: var(--surface-2); border-color: var(--rule); }
.rev .ptag.warn { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.rev .ptag.bad { color: var(--bad); background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); margin: 0 6px 0 0; }
.rev .sig button.cochip { cursor: pointer; font: inherit; font-size: 12px; }
.rev .sig button.cochip:hover { border-color: var(--accent); color: var(--accent); }
.rev .pill.tiny { font-size: 10.5px; padding: 0 6px; }
.rev.flash { outline: 3px solid var(--accent); outline-offset: 2px; transition: outline-color .4s; }
/* Evidence on the Sage card: right column blocks, then the co-authors across the full width. */
.rev.simple .evidence .rp h5, .rev.simple .evidence .pubs h5, .rev.simple .evidence .likely h5 { margin-top: 0; }
.rev.simple .evidence .pubs, .rev.simple .evidence .likely { margin-top: 12px; }
.rev.simple .evidence .rp p .pill { vertical-align: 1px; }
.rev.simple .evidence.full { grid-template-columns: 1fr; }
.rev.simple .coauthors .corow { padding: 5px 0; border-top: 1px dotted var(--rule); font-size: 13px; }
.rev.simple .coauthors .corow:first-of-type { border-top: 0; }
.rev.simple .coauthors .cohead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.rev.simple .coauthors .goto { margin-left: auto; border: 1px solid var(--rule-2); background: var(--surface); border-radius: 100px; padding: 0 9px; font: 12px var(--sans); color: var(--accent); cursor: pointer; }
.rev.simple .coauthors ul.copapers { margin: 3px 0 0; padding-left: 18px; font-size: 12.5px; }
.rev.simple .coauthors ul.copapers .y, .rev.simple .coauthors ul.copapers .j { color: var(--ink-3); }
.rev.simple .coauthors p.na { margin-top: 6px; }
/* Phone: place · name · score stay on top, and every line under them runs the full card width. */
@media (max-width: 560px) {
  .rev.simple > .top { display: grid; grid-template-columns: auto 1fr auto; column-gap: 10px; }
  .rev.simple > .top > .who { display: contents; }
  .rev.simple > .top > .who > h4 { grid-column: 2; grid-row: 1; }
  .rev.simple > .top > .score { grid-column: 3; grid-row: 1; }
  .rev.simple > .top > .pos { grid-row: 1; }
  .rev.simple > .top > .who > :not(h4) { grid-column: 1 / -1; }
  .rev.simple .facts.counts .long { display: none; }
  .rev.simple .facts.counts .short { display: inline; }
}

/* --- the run strip: two picked co-authors --- */
.pickn.pair { color: var(--warn); font-weight: 600; }

/* --- P4: "Filter the whole list" --- */
details.fcard { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); margin: 0 0 14px; }
details.fcard > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 9px 13px; cursor: pointer; font-size: 13px; list-style: none; }
details.fcard > summary::-webkit-details-marker { display: none; }
details.fcard > summary .hint { flex-basis: 100%; font-size: 12px; color: var(--ink-3); }
details.fcard > summary .fsum { color: var(--accent); font-weight: 600; }
details.fcard[open] > summary { border-bottom: 1px solid var(--rule); }
details.fcard[open] > summary .fsum { display: none; }
details.fcard .frow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 13px 0; }
details.fcard .flabel { font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-right: 2px; }
details.fcard button.fchip { display: inline-flex; align-items: center; gap: 5px; font: 12.5px var(--sans); padding: 3px 10px; border-radius: 100px; border: 1px solid var(--rule-2); background: var(--surface); color: var(--ink); cursor: pointer; }
details.fcard button.fchip:hover:not(:disabled) { border-color: var(--accent); }
details.fcard button.fchip[aria-pressed="true"], details.fcard button.fchip.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); font-weight: 600; }
details.fcard button.fchip:disabled { opacity: .5; cursor: not-allowed; }
details.fcard input.dept { flex: 1 1 220px; min-width: 0; padding: 4px 8px; font-size: 13px; }
details.fcard .help { flex-basis: 100%; font-size: 12px; color: var(--ink-3); margin: 0; }
details.fcard .cpanel { margin: 8px 13px 0; padding: 9px 11px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); }
details.fcard .cpanel .k { font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin: 0 0 6px; }
details.fcard .cpanel input.cfind { width: 100%; max-width: 280px; margin-bottom: 6px; padding: 4px 8px; font-size: 13px; }
details.fcard .clist { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 14px; max-height: 220px; overflow: auto; font-size: 13px; }
details.fcard .clist .copt { display: flex; align-items: center; gap: 6px; cursor: pointer; }
details.fcard .cpanel .na { font-size: 12px; color: var(--ink-3); margin: 6px 0 0; }
details.fcard p.fres { margin: 0; padding: 9px 13px 11px; font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 12px; }

/* --- P2: the fold switch, the groups panel, the fold line --- */
.toolbar .foldsw[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); font-weight: 600; }
.card.cgroups ul.glist { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 13px; }
.card.cgroups ul.glist b { display: inline-block; min-width: 1.4em; color: var(--ink-3); }
#slList > .foldline { margin: -6px 0 10px 34px; font-size: 12.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 12px; }
#slList > .foldnote { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); margin: 0 0 10px; }
#slList > .endline { margin: 14px 0 4px; font-size: 13px; color: var(--ink-2); text-align: center; }

/* --- P3: All eligible --- */
#view-eligible .pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; margin: 8px 0; font-size: 13px; color: var(--ink-2); }
#view-eligible .pager .short { display: none; }
#view-eligible .eltable { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
#view-eligible .elrow { display: grid; grid-template-columns: 52px minmax(150px, 1.3fr) minmax(150px, 1.4fr) minmax(110px, .9fr) 52px 56px minmax(160px, 1.6fr) auto; gap: 0 10px; align-items: start; padding: 7px 10px; border-top: 1px solid var(--rule); font-size: 13px; }
#view-eligible .elrow.elcols { border-top: 0; font: 600 10.5px var(--sans); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding-block: 6px; background: var(--surface-2); }
#view-eligible .elrow.aside { background: color-mix(in srgb, var(--warn-soft) 55%, var(--surface)); }
#view-eligible .elrow.picked { box-shadow: inset 3px 0 0 var(--accent); }
#view-eligible .elrow .c { min-width: 0; overflow-wrap: anywhere; }
#view-eligible .elrow .c.n { font-variant-numeric: tabular-nums; color: var(--ink-2); }
#view-eligible .elrow .c.who { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
#view-eligible .elrow button.rowopen { border: 0; background: none; padding: 0; font: 600 13px var(--sans); color: var(--ink); text-align: left; cursor: pointer; }
#view-eligible .elrow button.rowopen:hover { color: var(--accent); text-decoration: underline; }
#view-eligible .elrow .c.inst { color: var(--ink-2); }
#view-eligible .elrow .c.inst .flag { margin-right: 5px; }
#view-eligible .elrow .c.inst .cty { color: var(--ink-3); margin-left: 4px; }
#view-eligible .elrow .c.em.ok { color: var(--ok); }
#view-eligible .elrow .c.em.warn { color: var(--warn); }
#view-eligible .elrow .c.em.bad { color: var(--bad); }
#view-eligible .elrow .c.paper { color: var(--ink-2); font-size: 12.5px; }
#view-eligible .elrow .c.paper .y { color: var(--ink-3); font-variant-numeric: tabular-nums; }
#view-eligible .elrow .pill.tiny { font-size: 10.5px; padding: 0 6px; }
#view-eligible .elhead { padding: 8px 10px 6px; border-top: 1px solid var(--rule); background: var(--surface-2); font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
#view-eligible .elhead.aside { background: var(--warn-soft); color: var(--warn); }
#view-eligible .elhead.aside .help { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink-2); margin: 3px 0 0; }
#view-eligible .elcard { padding: 8px 10px 10px; border-top: 1px dashed var(--rule-2); background: var(--paper); }
#view-eligible .elcard .rev { margin: 0; }
/* 6.1.0: the table follows its OWN width, not the window's — the round panel (300 px) sits beside it, and at 1440 px the
   table is ~830 px wide: the eight columns no longer fit, and "Feedback" / "Shortlist" broke inside the word (seen on the 10-30 demo).
   Buttons never break their label; medium width = two lines a row; narrow = the stacked phone layout. */
#view-eligible .eltable { container: eltable / inline-size; }
#view-eligible .elrow .c.act { overflow-wrap: normal; }
#view-eligible .elrow .c.act .btn { white-space: nowrap; }
@container eltable (max-width: 1000px) {
  #view-eligible .elrow { grid-template-columns: 40px minmax(120px, 1.2fr) minmax(130px, 1.3fr) minmax(96px, .9fr) 48px 52px auto;
    grid-template-areas: "num who inst em fit topic act" "num paper paper paper paper paper act"; }
  #view-eligible .elrow > .c.num { grid-area: num; }
  #view-eligible .elrow > .c.who { grid-area: who; }
  #view-eligible .elrow > .c.inst { grid-area: inst; }
  #view-eligible .elrow > .c.em { grid-area: em; }
  #view-eligible .elrow > .c.fit { grid-area: fit; }
  #view-eligible .elrow > .c.topic { grid-area: topic; }
  #view-eligible .elrow > .c.paper { grid-area: paper; margin-top: 3px; }
  #view-eligible .elrow > .c.act { grid-area: act; flex-direction: column; align-items: stretch; }
  /* The heading cells carry no column class: the 7th is "Matched paper", which now sits under the name, not over the buttons. */
  #view-eligible .elrow.elcols > .c:nth-child(7) { display: none; }
}
/* Narrow: name and Shortlist on one line; the institution; email · fit · topic; the paper — under the name. */
@container eltable (max-width: 700px) {
  #view-eligible .elrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; position: relative; padding-left: 56px; }
  #view-eligible .elrow > .c.num { position: absolute; left: 10px; top: 8px; }
  #view-eligible .elrow > .c.who { order: 1; flex: 1 1 55%; }
  #view-eligible .elrow > .c.act { order: 2; flex: 0 0 auto; flex-direction: row; }
  #view-eligible .elrow > .c.inst { order: 3; flex: 1 1 100%; }
  #view-eligible .elrow > .c.em { order: 4; flex: 0 1 auto; }
  #view-eligible .elrow > .c.fit { order: 5; flex: 0 0 auto; }
  #view-eligible .elrow > .c.topic { order: 6; flex: 0 0 auto; }
  #view-eligible .elrow > .c.paper { order: 7; flex: 1 1 100%; }
  #view-eligible .elrow.elcols { display: none; }
  #view-eligible .elrow .c.fit::before { content: 'fit '; color: var(--ink-3); }
  #view-eligible .elrow .c.topic::before { content: 'topic '; color: var(--ink-3); }
}
@media (max-width: 560px) {
  #view-eligible .pager .long { display: none; }
  #view-eligible .pager .short { display: inline; }
}
#view-excluded .asideline { margin: 0 0 12px; }

/* --- P1: the keyword box --- */
/* A 28 px tap target (P1 B), its extra height taken back by negative margins so the chip does not grow. */
.chip button.star { min-width: 28px; min-height: 28px; margin-top: -4px; margin-bottom: -4px; display: inline-flex; align-items: center; justify-content: center; }
p.kwbuilt { font-size: 12.5px; color: var(--ink); background: var(--accent-soft); border-radius: var(--radius); padding: 6px 9px; margin: 6px 0 0; }
.kwnotes p.kwnote { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--warn); background: var(--warn-soft); border-radius: var(--radius); padding: 6px 9px; margin: 6px 0 0; }

/* --- P6: required details, field messages, the readiness block, the repeat note --- */
.field > label .req { color: var(--bad); text-transform: none; letter-spacing: 0; font-weight: 600; }
#authorList p.ferr { color: var(--bad); font-size: 12.5px; margin: 4px 0 0; }
#readyNeeded .needed { border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); background: var(--bad-soft); border-radius: var(--radius); padding: 8px 10px; margin: 0 0 10px; }
#readyNeeded .needed .k { font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: .05em; color: var(--bad); margin: 0 0 4px; }
#readyNeeded .needed ul { list-style: none; margin: 0; padding: 0; font-size: 13px; display: grid; gap: 3px; }
#readyNeeded .needed li { display: flex; gap: 6px; align-items: center; color: var(--bad); }
#repeatNote .repeat { display: flex; gap: 8px; align-items: flex-start; border-radius: var(--radius); padding: 9px 11px; margin: 0 0 10px; font-size: 13px; border: 1px solid; }
#repeatNote .repeat.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
#repeatNote .repeat.info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
#repeatNote .repeat p { margin: 4px 0; color: var(--ink-2); }
#repeatNote .runanyway { margin-top: 8px; padding-top: 8px; border-top: 1px dashed color-mix(in srgb, var(--warn) 40%, transparent); }
#repeatNote .runanyway .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
#runHead .banner p.lead { font-weight: 600; color: var(--ink); }
#runHead .banner p.engine { font-size: 12.5px; }
#runHead .askagain { border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); border-radius: var(--radius); padding: 9px 11px; font-size: 13px; }
#runHead .askagain p { margin: 0 0 6px; }

/* --- 5.2.0 review fixes (Sage runs) --- */
/* "Sort:" before the sort buttons (critic). */
.toolbar .seglabel { font-size: 12.5px; color: var(--ink-2); margin-right: -4px; }
/* "Show here": a group's members under its first, set in a little. */
#slList > .rev.infold { margin-left: 22px; }
@media (max-width: 560px) { #slList > .rev.infold { margin-left: 8px; } }
/* P4 B: picked people the filters leave out — the line in the filter card, their cards above the list. */
details.fcard p.pickedout { margin: -4px 0 0; padding: 0 13px 11px; font-size: 13px; color: var(--warn); }
#slList > .pickedcards { border-left: 3px solid color-mix(in srgb, var(--warn) 55%, transparent); padding-left: 10px; margin: 0 0 14px; }
#slList > .pickedcards > h3.ghead { margin-top: 0; }
/* Phone: the spread panel and the run notes behind one "About this list". */
#slList > details.aboutlist { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); padding: 8px 10px; margin: 0 0 12px; }
#slList > details.aboutlist > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
#slList > details.aboutlist[open] > summary { margin-bottom: 8px; }
/* P2's chip: 3 numbers and "+N more" on a wide card, 2 and "+N" on a phone, so it never wraps inside the pill. */
.rev .sig button.cochip .ph { display: none; }
@media (max-width: 560px) {
  .rev .sig button.cochip .dk { display: none; }
  .rev .sig button.cochip .ph { display: inline; }
}

/* 5.3.2: a deliberate scroll inside a view (a card brought back after Minimize, the All eligible pager, "Jump to set
   aside", a focused field) lands below the sticky topbar + tabs (104 px) instead of under them. */
[id^="view-"] * { scroll-margin-top: 112px; }

/* 6.1.0 (drop 2, 08 #135): the round panel — beside the three lists of a run, sticky like the run list, every rule scoped
   under .workpanel. Below 1280 px it folds to a labelled stub (round + clock); opened there it lies over the list instead
   of squeezing the cards. */
.workpanel { width: 300px; flex: none; align-self: stretch; position: sticky; top: 49px; max-height: calc(100vh - 49px);
  overflow-y: auto; overscroll-behavior: contain; border-left: 1px solid var(--rule); background: var(--surface); font-size: 12.5px; color: var(--ink-2); }
.workpanel .wp { display: grid; gap: 14px; padding: 14px 16px 18px; }
.workpanel .wp-head { display: flex; align-items: center; justify-content: space-between; }
.workpanel .wp-head h2 { margin: 0; font: 600 13px var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.workpanel .wp-head .wp-fold { font-size: 15px; line-height: 1; padding: 2px 8px; }
.workpanel .wp-k { font: 600 10.5px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.workpanel .wp-caprow { display: flex; align-items: baseline; gap: 8px; }
.workpanel .wp-caprow b { font: 600 15px var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.workpanel .wp-capnote { margin-left: auto; font-size: 11.5px; font-weight: 600; }
.workpanel .wp-meter { height: 5px; margin-top: 6px; border-radius: 100px; background: var(--surface-2); overflow: hidden; }
.workpanel .wp-meter i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.workpanel .cap-near .wp-meter i, .workpanel .cap-full .wp-meter i { background: var(--warn); }
.workpanel .cap-near .wp-capnote, .workpanel .cap-full .wp-capnote, .workpanel .cap-full .wp-caprow b { color: var(--warn); }

.workpanel .wp-rounds { display: grid; gap: 6px; }
.workpanel .wp-chips { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.workpanel .wp-round { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 2px; padding: 5px 0;
  border: 1px solid var(--rule-2); border-radius: var(--radius); background: var(--surface); font: 600 12px var(--sans); color: var(--ink-2); cursor: pointer; }
.workpanel .wp-round:hover { border-color: var(--ink-3); }
.workpanel .wp-round.st-busy::after { content: ""; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.workpanel .wp-round.st-submitted { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--rule-2)); background: var(--ok-soft); }
.workpanel .wp-round.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.workpanel .wp-round.on.st-submitted { background: var(--ok); border-color: var(--ok); }
.workpanel .wp-round.on.st-busy::after { background: var(--on-accent); }

.workpanel .wp-timer { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); }
.workpanel .wp-timerrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.workpanel .wp-clock { font: 600 26px/1.1 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.workpanel .wp-clock.on { color: var(--ok); }
.workpanel .wp-state, .workpanel .wp-sub { margin: 0; font-size: 12px; color: var(--ink-3); }
.workpanel .wp-state.on { color: var(--ok); font-weight: 600; }
.workpanel .wp-paused { color: var(--warn); }

.workpanel .wp-picks { display: grid; gap: 6px; }
.workpanel .wp-ro { margin-left: auto; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ok); }
.workpanel .wp-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.workpanel .wp-table td { padding: 5px 3px; border-top: 1px solid var(--rule); vertical-align: top; }
.workpanel .wp-table tr:last-child td { border-bottom: 1px solid var(--rule); }
.workpanel .wp-table .wp-n { width: 28px; padding-right: 6px; text-align: right; font: 500 11.5px var(--mono); color: var(--ink-3); }
.workpanel .wp-who { min-width: 0; }
.workpanel .wp-line { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.workpanel .wp-name { flex: 1; min-width: 0; padding: 0; border: 0; background: none; text-align: left; font: 600 12.5px var(--sans); color: var(--ink);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workpanel .wp-name:hover { color: var(--accent); text-decoration: underline; }
.workpanel .wp-meta { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 2px; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
/* The country keeps its room; "by …" gives way first. */
.workpanel .wp-cty { display: inline-flex; align-items: center; gap: 4px; flex: 0 1 auto; min-width: 0; overflow: hidden; }
.workpanel .wp-cty > span { overflow: hidden; text-overflow: ellipsis; }
.workpanel .wp-meta .wp-by { flex: 0 100 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.workpanel .wp-mail { display: inline-flex; flex: none; color: var(--ink-3); }
.workpanel .wp-mail.lvl-ok { color: var(--ok); }
.workpanel .wp-mail.lvl-warn { color: var(--warn); }
.workpanel .wp-mail.lvl-bad { color: var(--bad); }
.workpanel .wp-v { flex: none; display: inline-block; padding: 1px 7px; border: 1px solid var(--rule-2); border-radius: 100px; font: 500 11px var(--sans); white-space: nowrap; color: var(--ink-3); }
.workpanel .wp-v.v-ok { color: var(--ok); background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.workpanel .wp-v.v-not_suitable { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.workpanel .wp-v.v-unsure { color: var(--ink-2); background: var(--surface-2); }
.workpanel .wp-table .wp-x { width: 24px; text-align: right; }
.workpanel .wp-rm { display: inline-flex; padding: 3px; border: 0; border-radius: 50%; background: none; color: var(--ink-3); cursor: pointer; }
.workpanel .wp-rm:hover:not(:disabled) { color: var(--ink); background: var(--surface-2); }
.workpanel .wp-rm:disabled { opacity: .35; cursor: not-allowed; }
.workpanel .wp-empty { margin: 0; font-size: 12px; color: var(--ink-3); }

.workpanel .wp-counts { margin: 0; font-size: 12px; line-height: 1.6; }
.workpanel .wp-counts .c-ok { color: var(--ok); }
.workpanel .wp-counts .c-ns { color: var(--warn); }
.workpanel .wp-counts .c-nj { color: var(--ink-3); }

.workpanel .wp-submit .wp-submitbtn { width: 100%; justify-content: center; }
.workpanel .wp-done { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); border-radius: var(--radius); background: var(--ok-soft); }
.workpanel .wp-donehead { margin: 0; display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ok); }
.workpanel .wp-done .wp-next { justify-self: start; margin-top: 4px; }

.workpanel .wp-foot { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--rule); }
.workpanel .wp-others { margin: 0; display: flex; align-items: center; gap: 4px; color: var(--accent); }
.workpanel .wp-foot .btn { justify-self: start; }
.workpanel .wp-alloc { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.workpanel .wp-alloc input { width: auto; padding: 2px 6px; font: 12.5px var(--sans); border: 1px solid var(--rule-2); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.workpanel .wp-alloc .wp-by { color: var(--ink-3); }
.workpanel .wp-down { display: flex; align-items: flex-start; gap: 6px; margin: 0; color: var(--warn); }

/* Folded: a labelled stub with the round and the clock, like the run list's. */
.workpanel.folded { width: 52px; overflow: hidden; }
.workpanel .wp-stub { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; min-height: 100%; padding: 14px 0;
  border: 0; background: none; cursor: pointer; color: var(--ink-3); font: 500 11px var(--sans); }
.workpanel .wp-stub:hover { background: var(--surface-2); color: var(--ink); }
.workpanel .wp-stub .wp-chev { font-size: 15px; line-height: 1; }
.workpanel .wp-stubround { padding: 3px 6px; border-radius: var(--radius); background: var(--accent); color: var(--on-accent); font: 700 12px var(--sans); }
.workpanel .wp-stubround.sub { background: var(--ok); }
.workpanel .wp-stub .wp-stubclock { writing-mode: vertical-rl; font: 600 12px var(--mono); color: var(--ink); }
.workpanel .wp-stub .wp-stubclock.on { color: var(--ok); }
.workpanel .wp-stubcap { padding: 1px 4px; border: 1px solid var(--rule-2); border-radius: 999px; font: 11px var(--mono); }
.workpanel .wp-stubcap.cap-near, .workpanel .wp-stubcap.cap-full { color: var(--warn); border-color: var(--warn); }
.workpanel .wp-stublab { writing-mode: vertical-rl; text-transform: uppercase; letter-spacing: .1em; }

/* Narrow windows: opened, the panel lies over the list instead of squeezing the cards. */
@media (max-width: 1279px) {
  .workpanel:not(.folded) { position: fixed; top: 49px; right: 0; bottom: 0; max-height: none; z-index: 25; box-shadow: -8px 0 24px rgba(28, 26, 23, .12); }
}
@media (max-width: 640px) {
  .workpanel:not(.folded) { width: min(100vw, 340px); }
}

/* A row in All eligible brought up from the panel; a submitted round's Feedback panel says it reads only. */
.elrow.flash { outline: 3px solid var(--accent); outline-offset: 2px; }
.rev .fbk .fbk-lock { margin: 0; display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ok); }

/* The Feedback button on a card or an All eligible row, coloured by the editor's own verdict. Not red: in this portal
   red means an error, and "not suitable" is a judgement. */
.rev .fbk-btn.v-ok, .elrow .fbk-btn.v-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--rule-2)); background: var(--ok-soft); }
.rev .fbk-btn.v-not_suitable, .elrow .fbk-btn.v-not_suitable { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--rule-2)); background: var(--warn-soft); }
.rev .fbk-btn.v-unsure, .elrow .fbk-btn.v-unsure { color: var(--ink-2); background: var(--surface-2); }
.rev .fbk-btn .fbk-n { font: 600 11px var(--sans); color: var(--accent); }
.elrow .c.act { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* Earlier rounds that picked this person, above the card's foot. */
.rev .rmarks { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 16px 0; }
.rev .rmarks .rmark { font-size: 11.5px; color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

/* The panel under a card's foot, and the note at the end of the shortlist (scoped to its view — review, finding 17): the same parts. */
.rev .fbk, #view-shortlist .snote { display: grid; gap: 9px; padding: 11px 16px 13px; border-top: 1px dashed var(--rule-2); font-size: 13px; }
#view-shortlist .snote { margin: 14px 0 6px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
#view-shortlist .snote h4 { margin: 0; font: 600 15px var(--serif); color: var(--ink); }
.rev .fbk .wb-k, #view-shortlist .snote .wb-k { font: 600 10.5px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.rev .fbk .fbk-row, .rev .fbk .fbk-reasons, #view-shortlist .snote .fbk-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rev .fbk .fbk-v, #view-shortlist .snote .fbk-v, .rev .fbk .fbk-r { padding: 4px 11px; border: 1px solid var(--rule-2); border-radius: 100px; background: var(--surface);
  font: 500 12.5px var(--sans); color: var(--ink-2); cursor: pointer; }
.rev .fbk .fbk-r { padding: 2px 9px; font-size: 12px; }
.rev .fbk .fbk-v.on, #view-shortlist .snote .fbk-v.on, .rev .fbk .fbk-r.on { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.rev .fbk .fbk-v.v-ok.on, #view-shortlist .snote .fbk-v.u-useful.on { background: var(--ok); border-color: var(--ok); }
.rev .fbk .fbk-v.v-not_suitable.on, #view-shortlist .snote .fbk-v.u-not_useful.on { background: var(--warn); border-color: var(--warn); }
.rev .fbk .fbk-v.v-unsure.on, #view-shortlist .snote .fbk-v.u-partly.on { background: var(--ink-3); border-color: var(--ink-3); }
.rev .fbk .fbk-note, #view-shortlist .snote .fbk-note { display: grid; gap: 4px; }
.rev .fbk .fbk-note textarea, #view-shortlist .snote .fbk-note textarea { width: 100%; font: 13px var(--sans); padding: 6px 8px; border: 1px solid var(--rule-2);
  border-radius: var(--radius); background: var(--surface); color: var(--ink); resize: vertical; }
.rev .fbk .fbk-actions, #view-shortlist .snote .fbk-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rev .fbk .fbk-others, #view-shortlist .snote .fbk-others { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; color: var(--ink-2); font-size: 12.5px; }
.rev .fbk .fbk-at { color: var(--ink-3); }
