/* ============================================================================================
   Kairos — the whole visual system, in one stylesheet.

   WHAT THIS NEEDS TO FEEL LIKE, AND TO WHOM
     A tool a municipal officer consults under deadline pressure and acts on. It must read as
     precise and institutional — credible enough that a figure on screen can be quoted in a
     council meeting — and never as a consumer app trying to be liked. Everything below follows
     from that one sentence.

   WHERE THIS DESIGN IS ALLOWED TO BE BOLD
     Exactly two places: the brand blue on a primary action or an active state, and the near
     black rail down the left. Nowhere else. Semantic colour appears only where there is a real
     status to carry. If a screen looks colourful, something has gone wrong.

   TYPE: TWO FACES, EACH WITH A REASON
     Public Sans is the reading face — a neutral grotesk built for U.S. federal digital
     services, with a real weight range. It was chosen because it is NOT the framework default
     and because its heritage is institutional clarity rather than fashion.
     IBM Plex Mono is the data face, used ONLY where machine-originated content lives:
     reference numbers, CPV codes, source keys, timestamps in a run log, figures in a data
     table. Never a heading, never a button. The discipline of only using it where real data
     lives is what makes its appearances mean anything.

     Both are SELF-HOSTED from assets/fonts. There is no Google Fonts link and no third-party
     request: a commune's browser must not have to reach a CDN to render a page, and on a
     locked-down ministry network it often cannot. 88 KB, cached, served from the same mirror
     as everything else. font-display: swap means the system stack paints first and the real
     face swaps in — the page is never blank waiting for a font.

   COLOUR: LAYERS, NOT A LIST
     Three neutral surfaces — page, panel, nested — so nested content reads as nested without
     borders and shadows doing all the work. One accent. A semantic triad used only for real
     status. Muted text derived as an OPACITY of the primary text colour rather than picked as
     an unrelated grey, so it is always "this system's text, quieter".

   CONTRAST IS A REQUIREMENT, NOT A GUIDELINE
     Every text token below was composited over each of the three surfaces and measured. The
     tightest is --text-3 on --brand-soft at 5.49:1 (66%, raised from 60% on 9 Nov 2026: at 60% it was
     4.52:1 on --bg-2, too near the line for the 11 to 12 px labels of the phase rail). At 50% it
     measures 3.4:1 on white, which is a real failure.

   ONE RADIUS, NO SHADOWS, NO GRADIENTS
     3px everywhere. Depth comes from the surface layers and hairline borders. The three
     exceptions are stated where they appear and each is a thing that genuinely floats above
     the page: a modal, a dropdown, a tooltip. One gradient exists, on the login photograph,
     as a legibility scrim rather than as decoration.

   DENSITY
     Working screens: eighty calls with deadlines, values and scores. Rows are compact and
     figures are tabular so columns line up down the page. Nothing here is sized for a
     marketing screenshot.
   ============================================================================================ */

/* ── Self-hosted faces ────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Public Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/public-sans-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Public Sans'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/public-sans-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Public Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/public-sans-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Public Sans'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/public-sans-700.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/ibm-plex-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/ibm-plex-mono-500.woff2') format('woff2');
}

:root {
  --kx-head-measure: 32rem;   /* the bid page title's narrowest measure before the dates wrap under it */
  /* ── Surfaces: page → panel → nested ───────────────────────────────────────────────── */
  --bg-0: #F5F6F8;          /* the page. A soft neutral, not white, so a white panel can rise */
  --bg-1: #FFFFFF;          /* panels and cards — the raised layer */
  --bg-2: #EEF0F3;          /* nested: inputs, table headers, recessed rows inside a panel */

  /* Borders as ink at low opacity rather than a picked grey, so they follow the surface if
     it ever shifts. --border-input is a separate, much stronger token: the boundary of a
     form control has to clear 3:1 against its surroundings (WCAG 1.4.11) and the hairline
     that separates two table rows does not. 0.50 is the alpha that clears it on all three
     surfaces — 3.42:1 on the darkest of them. */
  --border:        rgba(15, 18, 26, 0.10);
  --border-strong: rgba(15, 18, 26, 0.20);
  --border-input:  rgba(15, 18, 26, 0.50);

  /* ── The one accent ────────────────────────────────────────────────────────────────── */
  --brand:       #2547A0;
  --brand-hover: #1D3A85;   /* darkens on hover, never lightens: on a light ground, lighter
                               reads as disabled */
  --brand-soft:  #EAEEF7;   /* the only tint of the accent — selected rows, focus wash */
  --brand-line:  #C3CFE6;

  /* ── Text. --text-3 is --text-1 at 60%, not a separate grey. ───────────────────────── */
  --text-1: #14161C;
  --text-2: #5B6270;
  --text-3: rgba(20, 22, 28, 0.66);

  /* ── Semantic. Re-picked for a light ground and measured, not carried over. ────────── */
  --red:   #B42318;   --red-soft:   #FEF3F2;   --red-line:   #E9BFBA;
  --amber: #92400E;   --amber-soft: #FFFAEB;   --amber-line: #E4C79A;
  --green: #166534;   --green-soft: #ECFDF3;   --green-line: #A9CFB6;

  /* The rail. Kept near-black by explicit instruction: the frame stays quiet so the accent
     inside it can be the loud thing. */
  --rail-900:    #0b0e12;
  --rail-800:    #11151b;
  --rail-700:    #1e242d;
  --rail-600:    #2b333e;
  --rail-line:   rgba(255, 255, 255, .10);
  --rail-ink:    #e7eaee;
  --rail-ink-2:  #a6afba;
  /* #8b95a1, not the #79838f it started at: the small labels set in this ink sit on the
     .userbtn's rgba(255,255,255,.05) wash and on its .1 hover, not on the bare rail, and at
     the old value that was 4.21:1 and 3.62:1 — under AA for 11px text. Measured on the
     hover state, which is the darkest contrast this ink ever has to survive: 4.59:1. */
  --rail-ink-3:  #8b95a1;

  --sidebar-w:   264px;

  /* ── ONE radius. 3px reads precise and institutional; 8px+ reads consumer. Both names
        resolve to the same value so no rule can quietly reintroduce a second one. ────── */
  --radius: 3px;
  --radius-sm: 3px;

  --gap: 16px;
  --maxw: 1360px;
  /* Prose gets its own measure — 68 characters — as a property of the text, not a margin on
     the page. A tender description at full card width is unreadable. */
  --measure: 68ch;

  --font: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
          'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  /* ── Aliases. The rules below this block were written against the old names; these keep
        one source of truth rather than two palettes drifting apart. ─────────────────── */
  --bg:          var(--bg-0);
  --surface:     var(--bg-1);
  --surface-2:   var(--bg-2);
  --line:        var(--border);
  --line-strong: var(--border-strong);
  --ink:         var(--text-1);
  --ink-2:       var(--text-2);
  --ink-3:       var(--text-3);
  --accent:      var(--brand);
  --accent-ink:  #ffffff;
  --accent-soft: var(--brand-soft);
  --accent-line: var(--brand-line);
  --ok:      var(--green);  --ok-bg:      var(--green-soft);  --ok-line:     var(--green-line);
  --warn:    var(--amber);  --warn-bg:    var(--amber-soft);  --warn-line:   var(--amber-line);
  --danger:  var(--red);    --danger-bg:  var(--red-soft);    --danger-line: var(--red-line);
  --info:    var(--brand);  --info-bg:    var(--brand-soft);  --info-line:   var(--brand-line);
  --muted-bg: var(--bg-2);
}

* { box-sizing: border-box; }

/* The `hidden` attribute is a UA-stylesheet rule (`display: none`), and ANY author rule that
   sets display beats it — `#app { display: flex }` alone was enough to keep the whole shell on
   screen while the login gate was showing. This restores the invariant once, for every element,
   rather than leaving each new layout rule to remember it. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Numbers must line up in a column of budgets. Everywhere, not just in tables. */
.num, td.num, .money, .score { font-variant-numeric: tabular-nums; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
/* The one fluid step. A page title is the only type on screen big enough for the difference
   between a 1280px laptop and a 1920px monitor to be visible; everything else holds still. */
h1 { font-size: clamp(19px, 1.1vw + 15px, 24px); }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p  { margin: 0 0 10px; }

/* ── Skip link ────────────────────────────────────────────────────────────────────────── */

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  padding: 10px 16px; background: var(--accent); color: #fff; border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; }

/* ── The sidebar ──────────────────────────────────────────────────────────────────────── */

#app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  display: flex; flex-direction: column;
  width: var(--sidebar-w); padding: 20px 14px 14px;
  background: var(--rail-800);
  color: var(--rail-ink);
  border-right: 1px solid var(--rail-900);
}

.shell {
  flex: 1; min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
}

/* ── The institutional block ──────────────────────────────────────────────────────────── */

.crest {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 6px 18px;
  color: inherit;
  border-bottom: 1px solid var(--rail-line);
  margin-bottom: 14px;
}
.crest:hover { text-decoration: none; }

/* A municipal coat of arms is drawn for white paper. Dropping one straight onto the rail loses
   its outlines and half its charges, so it sits on a light plate — which is also how a crest
   appears on real letterhead. */
.crest-plate {
  flex: none;
  display: grid; place-items: center;
  width: 60px; height: 60px; padding: 6px;
  background: #fff; border-radius: var(--radius);
  /* A border, not a shadow: the plate is a piece of paper on a dark rail, and the edge that
     says so should be a line you can point at rather than a blur. */
  border: 1px solid var(--rail-600);
}
#org-logo { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

/* Shown until a crest is uploaded: the commune's initials, set like a seal rather than like
   a placeholder, so a new tenant does not look broken on its first day. */
.crest-fallback {
  font-size: 19px; font-weight: 700; letter-spacing: .02em; color: var(--rail-800);
}

.crest-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.crest-text strong {
  font-size: 15px; font-weight: 600; line-height: 1.25; color: #fff;
  /* Two lines, then ellipsis: "Unione dei Comuni della Bassa Romagna" must not be cut to
     "Unione dei…" in the one place a user checks they are in the right tenant. */ overflow-wrap: anywhere; }
.crest-text small {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--rail-ink-3);
}

/* ── Sidebar navigation ───────────────────────────────────────────────────────────────── */

.sidenav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }

/* Grouped, because nine flat rows read as a wall. The heading is small and quiet: it is a
   signpost you use once to find a section and then stop seeing. */
.navgroup { display: flex; flex-direction: column; gap: 2px; }
.navgroup + .navgroup { margin-top: 14px; }
.navgroup-label {
  padding: 0 12px 4px; font-size: 10px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--rail-ink-3);
}
.navlabel { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* A counter on the row it belongs to, so the badge and the destination are one click. */
.navbadge {
  flex: none; min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 9px;
  background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.sidenav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius);
  color: var(--rail-ink-2); font-size: 14px; font-weight: 500;
  border-left: 3px solid transparent;
}
.sidenav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.sidenav a.active {
  background: var(--rail-700); color: #fff; border-left-color: #fff;
}
.sidenav a.active .navicon { opacity: 1; }
.navicon { flex: none; width: 18px; height: 18px; opacity: .75; }

/* ── Sidebar foot ─────────────────────────────────────────────────────────────────────── */

.sidebar-foot {
  padding-top: 14px; border-top: 1px solid var(--rail-line);
  display: flex; flex-direction: column; gap: 12px;
}

.flags { display: flex; align-items: center; gap: 8px; padding: 0 6px; }
.flag {
  display: block; border-radius: var(--radius);
  /* A hairline so a white band does not bleed into the rail behind it. */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .22);
}

.langswitch { display: flex; gap: 4px; padding: 0 6px; }
.langswitch button {
  flex: 1; padding: 5px 8px;
  border: 1px solid var(--rail-line); border-radius: var(--radius);
  background: none; color: var(--rail-ink-2);
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.langswitch button:hover { color: #fff; border-color: rgba(255, 255, 255, .3); }
.langswitch button[aria-pressed="true"] {
  background: var(--rail-700); color: #fff; border-color: transparent;
}

.usermenu { position: relative; }
.userbtn {
  position: relative;
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px; border: 0; border-radius: var(--radius);
  background: rgba(255, 255, 255, .05); color: var(--rail-ink);
  font: inherit; cursor: pointer; text-align: left;
}
.userbtn:hover { background: rgba(255, 255, 255, .1); }
.userbtn-text { display: flex; flex-direction: column; min-width: 0; }
.username { font-size: 13px; font-weight: 500; color: #fff; overflow-wrap: anywhere; }
.userrole { font-size: 11px; color: var(--rail-ink-3); }

.avatar {
  flex: none;
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.notif-dot {
  position: absolute; top: 4px; right: 6px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
}

.dropdown {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 70;
  padding: 4px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 6px 24px rgba(11, 26, 51, .3);
}
.dropdown a, .dropdown button {
  display: block; width: 100%; padding: 8px 10px; text-align: left;
  border: 0; background: none; border-radius: var(--radius-sm);
  color: var(--ink); font: inherit; font-size: 13px; cursor: pointer;
}
.dropdown a:hover, .dropdown button:hover { background: var(--muted-bg); text-decoration: none; }

/* ── Mobile ───────────────────────────────────────────────────────────────────────────── */

/* ── Top bar ──────────────────────────────────────────────────────────────────────────── */

/* Present at every width. It carries the two things that arrive without being asked for — a
   notification and a message — so they have one fixed place on screen rather than living
   inside a menu nobody opens. Light rather than dark: the rail is the frame, and a second
   dark band across the top would box the content in on two sides. */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  height: 52px; padding: 0 18px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar-title { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
/* Declared after .iconbtn so it wins on source order: both are single-class selectors,
   and without this the drawer toggle shows on a desktop where there is no drawer. */
.topbar .menu-only { display: none; }

.iconbtn {
  position: relative;
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: var(--radius);
  border: 0; background: none; color: var(--ink-2); cursor: pointer;
}
.iconbtn:hover { background: var(--muted-bg); color: var(--ink); text-decoration: none; }

/* Sits on the corner of its button. Never larger than two glyphs: "9+" is as much as a badge
   can say before it stops being a badge and becomes a number nobody reads. */
.badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  display: grid; place-items: center; border-radius: 8px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--surface);
}

/* ── The notification panel ───────────────────────────────────────────────────────────── */

.notif-wrap { position: relative; }
.panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 70;
  width: min(380px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 8px 28px rgba(16, 24, 32, .16);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.panel-list { max-height: min(60vh, 460px); overflow-y: auto; }
.panel-row {
  display: flex; flex-direction: column; gap: 2px;
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  color: var(--ink); border-left: 3px solid transparent;
}
.panel-row:last-child { border-bottom: 0; }
.panel-row:hover { background: var(--surface-2); text-decoration: none; }
.panel-row.unread { border-left-color: var(--accent); background: var(--accent-soft); }
.panel-row.unread:hover { background: var(--brand-line); }
.panel-title { font-size: 13px; font-weight: 600; }
.panel-body {
  font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.panel-when { font-size: 11px; color: var(--ink-3); }

.mobilebar { display: none; }
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(11, 26, 51, .45); }

@media (max-width: 940px) {
  .sidebar { transform: translateX(-100%); transition: transform .18s ease; }
  .sidebar.open { transform: none; }
  .shell { margin-left: 0; }
  .topbar { padding: 0 10px; }
  .topbar .menu-only { display: grid; }
}
@media (min-width: 941px) { .scrim { display: none !important; } }

/* ── Layout ───────────────────────────────────────────────────────────────────────────── */

main { max-width: 1360px; margin: 0 auto; padding: 24px 26px 64px; outline: none; width: 100%; }

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.page-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.grid { display: grid; gap: var(--gap); }
/* A grid item's default `min-width: auto` means its widest indivisible child sets the track's
   floor — so one wide table pushed a 1fr column out to 531px inside a 362px phone and the whole
   page scrolled sideways. min-width:0 lets the track shrink, which is what puts the overflow
   back inside the table's own `.table-wrap` where it belongs. */
.grid > * { min-width: 0; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* Stretched, not start-aligned: the two columns rarely hold the same amount of content, and a
   left card left short reads as an unfinished layout rather than as "there was less to show". */
.grid.detail { grid-template-columns: minmax(0, 1fr) 330px; align-items: stretch; }
.grid.detail .stack { display: flex; flex-direction: column; }
.grid.detail .stack > *:last-child { flex: 1; display: flex; flex-direction: column; }
.grid.detail .stack > *:last-child > .body { flex: 1; }

@media (max-width: 1180px) {
  .grid.detail { grid-template-columns: 1fr; }
  /* Two up rather than one, down to the point a phone forces single-column below: a stat
     tile or a budget figure is short, and stacking four of them the moment the two-column
     detail layout above gives up wastes the width a tablet or a narrow laptop still has. */
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .grid.cols-2 { grid-template-columns: 1fr; }
  main { padding: 16px 14px 48px; }
}
@media (max-width: 480px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card > header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
/* Sentence case. Caps are reserved for the three places where a label is a machine category
   and not a sentence — table headers, stat keys, status badges — and a card title is neither. */
.card > header h2 { font-size: 13px; letter-spacing: 0; color: var(--ink-2); }
.card .body { padding: 16px; }
.card .body.flush { padding: 0; }

/* ── Statistics tiles ─────────────────────────────────────────────────────────────────── */

.stat {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
/* Proportional figures, NOT tabular. Equal-width digits exist so numbers line up down a
   column; on a standalone 26px figure they just make "121" look gappy. tabular-nums stays
   where it earns its keep — table rows and axis ticks. */
.stat .v { font-size: 26px; font-weight: 600; letter-spacing: -0.02em;
           font-variant-numeric: proportional-nums; margin-top: 4px; }
.stat .n { font-size: 12px; color: var(--ink-3); }
.stat a { color: inherit; }

/* ── Tables ───────────────────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }

/* NOT position:sticky, deliberately.
   `.table-wrap` sets overflow-x:auto, and CSS computes the other axis to `auto` as well —
   which makes the wrap a scroll container, so a sticky <thead> anchors to the WRAP rather
   than to the viewport. With a `top` offset it then floats over the first row and swallows
   its clicks; with top:0 it never sticks to anything the user is actually scrolling. Long
   lists here are paginated ("Carica altre") rather than infinitely scrolled, so a static
   header costs almost nothing and removes the whole failure mode. */
thead th {
  padding: 9px 12px; text-align: left; white-space: nowrap;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-3);
}
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; }
td.tight { white-space: nowrap; }
.cell-title { font-weight: 500; color: var(--ink); display: block; }
.cell-sub { color: var(--ink-3); font-size: 12px; margin-top: 2px; display: block; }
/* One line, cut off with an ellipsis rather than pushing the row taller — the full text is
   still there in the title attribute, for anyone who hovers. */
.truncate { max-width: 420px; overflow-wrap: anywhere; }

/* ── Tables on a phone ────────────────────────────────────────────────────────────────────
   A grid of eight columns has nowhere to go below 720px — shrinking the type until "Scadenza"
   fits is not readable and scrolling it sideways hides most of the row you came for. Below
   the breakpoint every data table stops being a grid and becomes a stack of cards, one per
   row: the header disappears and each cell carries its own column name instead (written onto
   it by labelDataTables() in ui.js, from the very `<th>` text this table already has).

   The first cell keeps its normal, unlabelled weight — it is already the row's own title
   (`.cell-title`/`.cell-sub`, a name, an avatar) — and sits above a hairline as the card's
   heading; every cell after it is a plain label/value line. Scoped to the data tables only:
   `.prose.html table` and `.fmt table` are a source's own markup, arbitrary in shape, and stay
   a literal, horizontally-scrolling grid — turning a scraped budget table into label/value
   pairs would invent structure the source never had. */
@media (max-width: 720px) {
  .table-wrap table, .reqtable, .budget-others table {
    display: block; width: 100%; border: 0;
  }
  .table-wrap table thead, .reqtable thead, .budget-others table thead { display: none; }
  .table-wrap table tbody, .reqtable tbody, .budget-others table tbody { display: block; }
  .table-wrap table tbody tr, .reqtable tbody tr, .budget-others table tbody tr {
    display: block; margin-bottom: 10px;
    padding: 4px 13px; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface);
  }
  .table-wrap table tbody tr:last-child, .reqtable tbody tr:last-child,
  .budget-others table tbody tr:last-child { margin-bottom: 0; }
  .table-wrap table tbody tr.clickable, .reqtable tbody tr.clickable { cursor: pointer; }
  .table-wrap table tbody tr.clickable:active { background: var(--surface-2); }

  .table-wrap table td, .reqtable td, .budget-others table td {
    display: block; padding: 8px 0; border-bottom: 1px solid var(--line);
    text-align: left; white-space: normal; word-break: break-word;
  }
  .table-wrap table td:last-child, .reqtable td:last-child,
  .budget-others table td:last-child { border-bottom: 0; }
  .table-wrap table td[data-label]::before, .reqtable td[data-label]::before,
  .budget-others table td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 3px;
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: var(--ink-3);
  }
  /* The row's own title: no label, a touch larger, set off from the label/value lines below. */
  .table-wrap table td:first-child, .reqtable td:first-child, .budget-others table td:first-child {
    padding-bottom: 10px; margin-bottom: 2px;
  }
  .table-wrap table td:first-child::before, .reqtable td:first-child::before,
  .budget-others table td:first-child::before { content: none; }
  .table-wrap table td:first-child .cell-title { font-size: 14.5px; }

  /* Right-aligned figures were right-aligned to line up in a column that no longer exists. */
  .table-wrap table td.num, .reqtable td.num, .budget-others table td.num { text-align: left; }

  /* An empty-state or skeleton row (one cell, colspan'd across the old grid) reads as a
     message, not as a record — it gets none of the card chrome above. */
  .table-wrap table tbody tr.row-full, .reqtable tbody tr.row-full {
    border: 0; padding: 0; background: none;
  }
  .table-wrap table tbody tr.row-full td, .reqtable tbody tr.row-full td { padding: 0; border-bottom: 0; }
}


/* ── Score, pills, badges ─────────────────────────────────────────────────────────────── */

/* The relevance score is the single most-scanned number in the product. It is a filled chip
   rather than plain text so the eye can rank a column of eighty rows without reading them. */
.score {
  display: inline-block; min-width: 60px; padding: 2px 7px;
  border-radius: var(--radius-sm); text-align: center; white-space: nowrap;
  font-weight: 600; font-size: 12px; cursor: default;
}
/* Five bands, red to green, the same ones the score ring uses (charts.js) so a call never
   reads "high" here and something else there. The top band is filled solid rather than another
   tint — the same soft-vs-solid distinction .pop-presets button.on already uses for "the
   selected one, more so" — because a fifth tint next to --ok-bg would not read as distinct. */
.score.s-vlow  { background: var(--danger-bg); color: var(--danger); }
.score.s-low   { background: var(--warn-bg);   color: var(--warn); }
.score.s-mid   { background: var(--info-bg);   color: var(--info); }
.score.s-high  { background: var(--ok-bg);     color: var(--ok); }
.score.s-vhigh { background: var(--ok);        color: #fff; }

/* A status badge, not a capsule. The old 10px radius made a lozenge that read as a consumer
   tag; a bordered rectangle at the one radius reads as a stamp. The fill is a whisper — the
   border and the caps do the work, so a table with forty of them does not turn into confetti. */
.pill {
  display: inline-block; padding: 1px 7px; border-radius: var(--radius);
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  white-space: nowrap;
  background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--ink-2);
}
.pill.ok     { background: var(--ok-bg);     border-color: var(--ok-line);     color: var(--ok); }
.pill.warn   { background: var(--warn-bg);   border-color: var(--warn-line);   color: var(--warn); }
.pill.danger { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.pill.info   { background: var(--info-bg);   border-color: var(--info-line);   color: var(--info); }

/* A deadline is the one number that changes meaning as it shrinks, so it is coloured by
   urgency rather than by category. */
.deadline.soon   { color: var(--warn);   font-weight: 600; }
.deadline.urgent { color: var(--danger); font-weight: 600; }
.deadline.past   { color: var(--ink-3);  text-decoration: line-through; }

/* ── Controls ─────────────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.danger { color: var(--danger); border-color: var(--danger-line); }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 4px 6px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 7px 10px;
  /* The stronger token, not --line-strong: an input's edge is what tells you there is an
     input, and WCAG 1.4.11 asks 3:1 of it. --line-strong reaches 1.55:1 and is for hairlines
     between rows, where nothing depends on seeing the line. */
  border: 1px solid var(--border-input); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 13px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-line); outline-offset: -1px; border-color: var(--accent);
}
textarea { resize: vertical; min-height: 76px; line-height: 1.55; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.field .hint { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
/* A form's two-up rows: the fields carry their own bottom margin, so the grid adds no row gap.
   When a phone collapses the row to one column, the gap between its two fields (Postcode, City)
   is then the same as the gap between rows (City, Province). */
.modal .grid.cols-2 { row-gap: 0; }

.filters {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 12px 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px;
}
.filters input[type=search] { flex: 1 1 220px; min-width: 180px; }
.filters select, .filters input[type=date] { width: auto; min-width: 130px; }

@media (max-width: 720px) {
  /* The search box leads its own full-width row rather than fighting a status pillbar and
     two selects for space on a 360px screen; everything narrower stays inline below it and
     wraps as it already did. */
  .filters input[type=search] { flex-basis: 100%; }
  .filters select, .filters input[type=date] { flex: 1 1 140px; }
  .filters .pillbar { width: 100%; }
}

/* A column header that is also its own filter: the sort label and a bare funnel icon sit side
   by side, so the control costs a glance and a click rather than a fixed slice of the row
   whether or not it is in use — the same reasoning as the status pills getting a fully open
   row while this one does not: nobody narrows by score or deadline on every visit. */
th.th-filterable { white-space: nowrap; }
.th-sort {
  display: inline-flex; align-items: center; gap: 3px;
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; text-transform: inherit; letter-spacing: inherit;
  color: var(--ink-3); cursor: pointer;
}
.th-sort:hover { color: var(--ink-2); }
.th-sort.on { color: var(--accent); }
.th-sort .caret { font-size: 9px; }
th.th-filterable .popwrap { display: inline-flex; margin-left: 4px; vertical-align: middle; }
th.th-filterable .popbtn {
  padding: 2px; border: 0; background: none; color: var(--ink-3);
}
th.th-filterable .popbtn:hover { color: var(--ink-2); }
th.th-filterable .popbtn.on { color: var(--accent); }

/* The status pill row: same border/accent language as the deadline popover's presets, in a
   fully-rounded shape so it reads as an always-on toggle group rather than as a menu. */
.pillbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pill-toggle {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-2);
  font: inherit; font-size: 13px; cursor: pointer;
}
.pill-toggle:hover { border-color: var(--ink-3); color: var(--ink); }
.pill-toggle.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── The document reader ──────────────────────────────────────────────────────────────── */

/* A call's documents are the call. Reading them in a second tab — or worse, in the downloads
   folder — means reading them away from the eligibility clause that sent you there, so the
   reader opens right in the Overview flow, below the facts a reader has just read: full
   width, the same width every other card on this screen already uses, rather than squeezed
   into a side column. */
.reader {
  display: flex; flex-direction: column;
  height: 82vh; min-height: 480px;
  overflow: hidden;
}
.reader-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.reader-id { min-width: 0; }
.reader-title {
  display: block; font-size: 13px; overflow-wrap: anywhere; }
/* min-height:0 is what lets a flex child actually shrink; without it the frame pushes the
   card taller than the height set above. */
.reader-stage { flex: 1; min-height: 0; background: var(--bg-2); }
.reader-frame { width: 100%; height: 100%; border: 0; display: block; }
.reader-wait { padding: 24px; display: grid; gap: 10px; }
.reader-wait .skel:nth-child(2) { width: 80%; }
.reader-wait .skel:nth-child(3) { width: 60%; }
.reader-other { padding: 16px; }

/* A link to a document we hold a copy of. It is still a link and still looks like one — what
   it advertises is where it lands, so it carries a page mark rather than the "this leaves the
   site" arrow that `.prose.html a[target="_blank"]` gets below. Those two marks are now the
   honest difference between the links on this screen. */
.doclink { text-decoration-style: dotted; text-underline-offset: 2px; }
.doclink::after { content: ' ▤'; font-size: .85em; opacity: .7; }
.filerow.on .name { color: var(--accent); font-weight: 600; }

/* The streamed summary. Same prose sizing as everywhere else on this screen — it is a
   compressed paraphrase of the description, not a different kind of text, so it should not
   look like one. */
.ai-summary { margin: 0 0 12px; line-height: 1.55; }

/* The wait before the first token: says plainly what is happening, and the sweeping fill is
   deliberately indeterminate — an honest bar never claims to know when a generation will
   finish, it just shows that one is under way. */
.ai-loading { padding: 2px 0 4px; }
.ai-loading-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-3); margin-bottom: 9px;
}
.ai-loading-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none;
  animation: ai-pulse 1.1s ease-in-out infinite;
}
.ai-loading-bar {
  height: 4px; border-radius: 2px; background: var(--muted-bg); overflow: hidden;
}
.ai-loading-fill {
  height: 100%; width: 35%; border-radius: 2px; background: var(--accent);
  animation: ai-sweep 1.3s ease-in-out infinite;
}
@keyframes ai-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes ai-sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(385%); }
}

/* ── Score ring ─────────────────────────────────────────────────────────────── */

/* The ring: readiness on the Eligibility tab (views/eligibility.js). */

.score-ring { position: relative; margin: 0 auto; }
.score-ring-label {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.score-ring-value { font-size: 25px; font-weight: 700; color: var(--ink); line-height: 1; }
.score-ring-caption { font-size: 11px; color: var(--ink-3); margin-top: 3px; }

@media (max-width: 720px) {
  .reader { height: 70vh; }
}

/* ── The eligibility engine (views/eligibility.js) ─────────────────────────────────────
   Colour is information here and nowhere is it decoration: green met, red for everything that
   needs the person's attention (not met, to verify, to prepare; the glyphs
   ✕ ? → tell them apart), grey "depends on the project" or closed. No orange. The same everywhere —
   scope dots, card edges, icons, counts, the verdict and its ring — so a colour read once is read
   everywhere. */

.elig { display: flex; flex-direction: column; gap: 16px; }

.tab-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3);
           vertical-align: middle; margin-left: 6px; flex: none; }
.tab-dot.ok { background: var(--ok); } .tab-dot.warn { background: #B7791F; }
.tab-dot.danger { background: var(--danger); } .tab-dot.muted { background: var(--ink-3); }
.tab-dot.running { background: var(--accent); animation: ai-pulse 1.1s ease-in-out infinite; }

.scope-switch { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.scope-switch button {
  display: flex; align-items: center; gap: 7px; flex: none; max-width: 300px;
  padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13px; cursor: pointer;
}
.scope-switch button .tab-dot { margin: 0; }
.scope-switch button:hover { border-color: var(--accent-line); color: var(--ink); }
.scope-switch button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.scope-name { overflow-wrap: anywhere; }
.scope-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.scope-score { font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--ink-3); }

/* The wait (views/eligibility.js steps()): three short steps that tick as the stream arrives, and the
   documents being read, by name. A step's mark is a ring while it waits, a pulsing ring while it runs,
   and a tick when the stream says it is done. */
.elig-run { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.elig-run > li {
  display: grid; grid-template-columns: 16px minmax(0, 1fr); column-gap: 10px; align-items: center;
  font-size: 13.5px; color: var(--ink-3);
}
.elig-run > li.now { color: var(--ink); font-weight: 600; }
.elig-run > li.past { color: var(--ink-2); }
.elig-run-mark {
  width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff;
}
.elig-run > li.past .elig-run-mark { background: var(--ok); border-color: var(--ok); }
.elig-run > li.now .elig-run-mark {
  border-color: var(--accent); background: var(--accent-soft); animation: ai-pulse 1.1s ease-in-out infinite;
}
.elig-docs {
  grid-column: 2; list-style: none; margin: 7px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px; font-weight: 400;
}
.elig-docs li {
  max-width: 40ch; overflow-wrap: anywhere;
  font-size: 12px; color: var(--ink-2); padding: 2px 8px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2);
}
.elig-docs li.more, .elig-docs li.unread { color: var(--ink-3); background: none; }
@media (prefers-reduced-motion: reduce) { .elig-run > li.now .elig-run-mark { animation: none; } }

/* A call read for the first time (views/eligibility.js readingBlock()): what is happening, the time so far, a bar
   that moves without claiming a percentage, and each document as its reading comes back. */
.elig-wait .body { display: flex; flex-direction: column; gap: 12px; }
.elig-wait-head { display: flex; flex-direction: column; gap: 2px; }
.elig-wait-head p { margin: 0; }
.elig-wait-time { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.elig-wait-bar { position: relative; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.elig-wait-bar i { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 2px; animation: busy-run 1.6s ease-in-out infinite; }
.elig-wait-count { margin: 0; color: var(--ink-2); }
.elig-wait-docs .elig-run-words { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.elig-wait-name { overflow-wrap: anywhere; }
.elig-wait-state { color: var(--ink-3); font-weight: 400; }
.elig-run > li.skip { color: var(--ink-3); }
.elig-run > li.skip .elig-run-mark { border-style: dashed; }
@media (prefers-reduced-motion: reduce) { .elig-wait-bar i { animation: none; width: 30%; } }

/* The Overview's document list says the same while the call is read (views/opportunity.js paintDocList()). */
.doc-reading { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ink-3); }
.doc-reading.reading { color: var(--accent); }
.doc-reading.read { color: var(--ok); }

/* Every document of the call, read or not (views/eligibility.js documentsBlock()), and the pending note. */
.elig-doclist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.elig-doclist li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; }
.elig-doc-name { overflow-wrap: anywhere; }
.elig-doc-mark { color: var(--ok); font-weight: 700; }
.elig-doclist li.partly_read .elig-doc-mark, .elig-doclist li.unread .elig-doc-mark { color: var(--danger); }
.elig-not-read { color: var(--danger); margin: 0 0 8px; }
.elig-conflict {
  margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--warn-line); border-radius: var(--radius);
  background: var(--warn-bg); font-size: 13.5px;
}
.elig-conflict-t { font-weight: 700; color: var(--warn); margin-bottom: 4px; }
.elig-conflict ul { margin: 0 0 6px; padding-left: 18px; }
.elig-conflict p { margin: 0 0 8px; color: var(--ink-2); }

/* What a person gave for a rule (views/eligibility.js givenBlock()): kept after a reload. */
.rgiven { display: flex; flex-direction: column; gap: 2px; margin: 0 0 8px 28px; font-size: 13px; }
.rgiven-k { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.rgiven-item { overflow-wrap: anywhere; }
.rgiven-what { color: var(--ink-2); }
.rgiven-quote { color: var(--ink-3); font-style: italic; }
.efact-unsaved { color: var(--warn); margin-top: 6px; }
.elig-pending p { margin: 6px 0 0; }

/* "Is this wrong?" (views/eligibility.js wrongButton()): an icon, quiet until hovered, on the verdict and on
   every rule that needs attention. */
.btn.elig-wrong {
  padding: 2px 4px; border: 0; background: none; color: var(--ink-3); line-height: 0; border-radius: var(--radius-sm);
}
.btn.elig-wrong:hover, .btn.elig-wrong:focus-visible { color: var(--accent); background: var(--accent-soft); }
.elig-hero-top .elig-wrong { margin-left: auto; }

/* What blocks the verdict, by name: one line per rule, each opening its card. */
.elig-blockers { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; margin: 0 0 10px; }
.elig-blockers-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--danger);
}
.elig-blockers ul {
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0;
}
.elig-blocker {
  display: flex; align-items: baseline; gap: 6px; max-width: 100%; padding: 0; border: 0; background: none;
  color: var(--danger); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer;
}
.elig-blocker-x { font-size: 11px; font-weight: 700; flex: none; }
.elig-blocker-t {
  overflow-wrap: anywhere;
  text-decoration: underline; text-decoration-color: var(--danger-line); text-underline-offset: 2px;
}
.elig-blocker:hover .elig-blocker-t, .elig-blocker:focus-visible .elig-blocker-t { text-decoration-color: currentColor; }
.req.flash { box-shadow: 0 0 0 3px var(--danger-line); }

.elig-hero-body { display: flex; gap: 24px; align-items: flex-start; }
.elig-hero-body .score-ring { margin: 0; flex: none; }
.elig-hero-main { flex: 1; min-width: 0; }
.elig-hero-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.verdict {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius); font-size: 12px;
  font-weight: 700; letter-spacing: .05em; text-transform: uppercase; border: 1px solid;
}
.verdict.ok     { background: var(--ok-bg);     color: var(--ok);     border-color: var(--ok-line); }
.verdict.warn   { background: var(--warn-bg);   color: var(--warn);   border-color: var(--warn-line); }
.verdict.danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.verdict.muted  { background: var(--bg-2);      color: var(--ink-2);  border-color: var(--line-strong); }
.elig-headline { font-size: 15px; line-height: 1.55; margin: 0 0 12px; max-width: 78ch; }
.elig-counts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.elig-count { display: inline-flex; align-items: center; gap: 5px; }
.elig-count strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.elig-count-icon {
  width: 17px; height: 17px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; font-size: 10px; font-weight: 700; color: #fff; background: var(--ink-3);
}
.elig-count.ok .elig-count-icon { background: var(--ok); }
.elig-count.danger .elig-count-icon { background: var(--danger); }
/* Red for everything that needs the person's attention: not met, to verify and to prepare
   share the danger colour; their glyphs (✕ ? →) tell them apart. */
.elig-count.unclear .elig-count-icon { background: var(--danger); }
.elig-count.action .elig-count-icon { background: var(--danger); }
.elig-steps { margin-top: 14px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius); }
.elig-steps-title { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
.elig-steps ol { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.55; }
.elig-steps li { margin-bottom: 3px; }
.elig-steps li::marker { color: var(--ink-3); font-weight: 600; }

.elig-ov-headline { margin: 0 0 12px; font-size: 14.5px; line-height: 1.55; max-width: 80ch; }
.elig-ov { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 13.5px; line-height: 1.5; }
.elig-ov dt { color: var(--ink-3); }
.elig-ov dd { margin: 0; max-width: 80ch; }

.elig-filters { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.elig-filters .chips button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.elig-filters .count { color: var(--ink-3); font-weight: 400; font-variant-numeric: tabular-nums; }
.elig-issues { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.elig-issues input { width: auto; margin: 0; }

.req-group + .req-group { margin-top: 20px; }
.req-group-title {
  font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2);
  margin-bottom: 10px;
}
.req-group-title .count { color: var(--ink-3); }
.req-group-title .small { text-transform: none; letter-spacing: 0; font-weight: 400; }
details.req-group > summary { cursor: pointer; list-style: revert; }
details.req-group[open] > summary { margin-bottom: 10px; }

.req-list { display: flex; flex-direction: column; gap: 10px; }

/* Entrance, not decoration — and tied to scrolling, not to the clock. A verdict with forty
   requirements is read a screen at a time; animating all forty the instant the tab opens
   means everything below the fold has already finished by the time it scrolls into view, so
   the reveal buys nothing there and just delays the top of the list. Instead each card starts
   a few pixels down and invisible, and views/eligibility.js adds `.in-view` the moment an
   IntersectionObserver reports it has actually entered the viewport — once, not on every pass
   back up the page. Cards already on screen when the tab opens still get it immediately, so a
   short list never looks broken; a long one reveals as the reader scrolls down it. */
.req {
  opacity: 0; transform: translateY(10px);
  transition: opacity .45s cubic-bezier(.2, .7, .3, 1), transform .45s cubic-bezier(.2, .7, .3, 1);
}
.req.in-view { opacity: 1; transform: none; }
/* Several cards can enter the viewport in one jump — opening the tab on a tall monitor, or a
   fast scroll — and firing them all at once looks like a pop rather than a reveal. A short,
   position-based stagger only softens that simultaneous case; ordinary scrolling already
   staggers itself. */
.req-list > .req:nth-child(2) { transition-delay: 40ms; }
.req-list > .req:nth-child(3) { transition-delay: 80ms; }
.req-list > .req:nth-child(4) { transition-delay: 120ms; }
.req-list > .req:nth-child(n+5) { transition-delay: 160ms; }
@media (prefers-reduced-motion: reduce) {
  .req { opacity: 1; transform: none; transition: none; }
}
.req {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px;
  border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.req.ok { border-left-color: var(--ok); } .req.danger { border-left-color: var(--danger); }
.req.unclear { border-left-color: var(--danger); } .req.action { border-left-color: var(--danger); }
.req.muted { border-left-color: var(--line-strong); }
.req-icon {
  flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--ink-3);
}
.req.ok .req-icon { background: var(--ok); } .req.danger .req-icon { background: var(--danger); }
.req.unclear .req-icon { background: var(--danger); font-size: 13px; } .req.action .req-icon { background: var(--danger); }
.req.muted .req-icon { background: var(--bg-2); color: var(--ink-3); border: 1px solid var(--line-strong); }
.req.pending .req-icon { background: var(--bg-2); animation: ai-pulse 1.1s ease-in-out infinite; }
.req-body { flex: 1; min-width: 0; }
.req-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.req-title { font-weight: 650; font-size: 14px; }
.req-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.req-tag, .req-status {
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 1px 6px; border-radius: var(--radius); border: 1px solid var(--line-strong);
  color: var(--ink-2); background: var(--bg-2); white-space: nowrap;
}
.req-tag.nature-knockout { color: var(--danger); border-color: var(--danger-line); background: var(--danger-bg); }
.req-tag.nature-scored { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.req-status.ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.req-status.danger { color: var(--danger); border-color: var(--danger-line); background: var(--danger-bg); }
.req-status.unclear { color: var(--danger); border-color: var(--danger-line); background: var(--danger-bg); }
.req-status.action { color: var(--danger); border-color: var(--danger-line); background: var(--danger-bg); }
.req-threshold {
  display: inline-block; margin: 2px 0 6px; padding: 2px 8px; border-radius: var(--radius);
  background: var(--surface-2); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.req-text .fmt { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.req-text .fmt p { margin-bottom: 4px; }
.req-why { margin-top: 8px; font-size: 13.5px; line-height: 1.55; color: var(--ink); max-width: 90ch; }
.req-action { margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--ink); }
.req-k { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.req-more { padding-left: 0; margin-top: 4px; }
.req-source { margin-top: 6px; font-size: 12.5px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }
.req-source .req-k { color: var(--ink-3); }
.req-ref { color: var(--ink-2); }
.req-quote {
  margin: 0; padding: 6px 12px; border-left: 3px solid var(--accent-line); background: var(--surface-2);
  font-style: italic; line-height: 1.5; max-width: 90ch;
}

/* ── Eligibility: "Check for", the rule tabs, one line per rule, the reply box (views/eligibility.js) ── */
.elig-for { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.elig-for-label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.elig-for .scope-switch { flex: 1 1 320px; min-width: 0; flex-wrap: wrap; overflow: visible; }
.elig-for .scope-switch button { text-align: left; }
.rrow-answer { flex: none; padding: 0; }
.elig-n {
  min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.elig-again { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--accent); font-weight: 600; }
.elig-again .tab-dot { margin: 0; }
.elig-changed { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; margin: 0 0 10px; }
.elig-changed-label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.elig-changed ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.elig-to.ok { color: var(--ok); font-weight: 600; } .elig-to.danger, .elig-to.unclear, .elig-to.action { color: var(--danger); font-weight: 600; }
.elig-to.muted { color: var(--ink-2); font-weight: 600; }

.elig-ruletab-total { font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.elig-hint { margin: 0 0 10px; color: var(--ink-2); }
.elig-more { margin-top: 8px; padding-left: 0; }

.rlist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); }
.rrow { border-top: 1px solid var(--line); background: var(--surface); }
.rrow:first-child { border-top: 0; }
.rrow.flash { box-shadow: 0 0 0 3px var(--danger-line); }
.rrow-line { display: flex; align-items: center; gap: 8px; padding-right: 10px; }
.rrow-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
}
.rrow-main:hover .rrow-title { text-decoration: underline; text-decoration-color: var(--line-strong); }
.rrow .req-icon {
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--ink-3);
}
.rrow.ok .req-icon { background: var(--ok); }
.rrow.danger .req-icon, .rrow.unclear .req-icon, .rrow.action .req-icon { background: var(--danger); }
.rrow.muted .req-icon { background: var(--bg-2); color: var(--ink-3); border: 1px solid var(--line-strong); }
.rrow.pending .req-icon { background: var(--bg-2); animation: ai-pulse 1.1s ease-in-out infinite; }
/* While a check is written: a rule still waiting shimmers, and each result fades in where it lands. */
.rrow.pending .rrow-status {
  color: transparent; user-select: none; min-width: 92px; border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--line) 50%, var(--bg-2) 75%) 0 0 / 200% 100%;
  animation: elig-shimmer 1.4s linear infinite;
}
.rrow.landed { animation: elig-land .6s ease-out; }
.rrow.landed .req-icon, .rrow.landed .rrow-status { animation: elig-pop .35s ease-out; }
@keyframes elig-shimmer { to { background-position: -200% 0; } }
@keyframes elig-land { from { background: var(--accent-soft); } to { background: transparent; } }
@keyframes elig-pop { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: none; } }
.elig-check-bar { display: block; height: 3px; border-radius: 2px; background: var(--bg-2); overflow: hidden; }
.elig-check-bar i { display: block; height: 100%; background: var(--accent); transition: width .3s ease-out; }
.elig-run-count { margin-left: 8px; }
/* A change of language: the last language's words stay, dimmed, and the new ones fade in over them. */
.elig.switching :is(.rrow-title, .elig-hero-main, .elig-ov-headline, .elig-ov, .rrow-detail, .elig-grpt) {
  opacity: .45; transition: opacity .2s;
}
.elig.lang-in :is(.rrow-title, .elig-hero-main, .elig-ov-headline, .elig-ov, .rrow-detail, .elig-grpt, .elig-check-v) {
  animation: elig-lang-in .45s ease-out;
}
@keyframes elig-lang-in { from { opacity: .45; } to { opacity: 1; } }
html.lang-switching #view { opacity: .55; transition: opacity .15s; }
#view.lang-in { animation: elig-lang-in .3s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .rrow.pending .rrow-status { animation: none; }
  .rrow.landed, .rrow.landed .req-icon, .rrow.landed .rrow-status, .elig.lang-in *, #view.lang-in { animation: none; }
}
.rrow-title { flex: 1; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.rrow.danger .rrow-title, .rrow.unclear .rrow-title, .rrow.action .rrow-title { font-weight: 650; }
.rrow.open .rrow-title { white-space: normal; }
.rrow-ko { flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.rrow-status { flex: none; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.rrow-status.ok { color: var(--ok); }
.rrow-status.danger, .rrow-status.unclear, .rrow-status.action { color: var(--danger); }
.rrow-detail { padding: 0 14px 14px 44px; display: flex; flex-direction: column; gap: 6px; }
.rrow-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.rrow-boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.rbox { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rbox-k { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.rbox-fact { font-weight: 650; font-size: 14px; overflow-wrap: anywhere; }

.echat { margin: 0 12px 12px 44px; padding: 12px; background: var(--surface-2); border-radius: var(--radius); display: flex; flex-direction: column; gap: 8px; }
.echat-quote { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.echat-quote mark { background: #FFF3BF; color: var(--ink); }
.ebub { max-width: min(78%, 640px); padding: 8px 11px; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.ebub.k { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 3px 12px 12px 12px; }
.ebub.me { align-self: flex-end; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 12px 3px 12px 12px; }
.ebub.no { border-color: var(--danger-line); color: var(--danger); }
.ebub.ok { border-color: var(--ok-line); color: var(--ok); }
.ebub.busy { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.ebub.busy .tab-dot { margin: 0; }
.ebub.propose { display: flex; flex-direction: column; gap: 8px; max-width: min(92%, 680px); }
.efact {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline;
  padding: 9px 11px; border: 1px solid var(--accent-line); border-radius: var(--radius); background: var(--surface);
}
.efact-lvl { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 2px 6px; border-radius: var(--radius); }
.efact-what { color: var(--ink-2); }
.efact-val { font-size: 14px; }
.efact-reach, .efact-quote { grid-column: 1 / -1; font-size: 12px; color: var(--ink-2); }
.efact-quote { color: var(--ink-3); font-style: italic; }
.efact-next { color: var(--ink-2); }
.echat-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.echat-form { display: flex; gap: 8px; align-items: center; }
.echat-input {
  flex: 1; min-width: 0; font: inherit; font-size: 13.5px; padding: 8px 12px; margin: 0;
  border: 1px solid var(--border-input); border-radius: 18px; background: var(--surface); color: var(--ink);
}
.echat-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

@media (max-width: 720px) {
  .rrow-boxes { grid-template-columns: 1fr; }
  .rrow-detail { padding-left: 14px; }
  .echat { margin-left: 12px; }
  .ebub, .ebub.propose { max-width: 100%; }
  .rrow-ko { display: none; }
}

/* The three checks, the groups, search and the status filter. */
.elig-checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.elig-check {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; text-align: left; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); font: inherit; color: var(--ink);
}
.elig-check:hover { border-color: var(--accent-line); }
.elig-check.on { border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); background: var(--accent-soft); }
.elig-check-k { display: flex; align-items: baseline; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.elig-check-v { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 650; }
.elig-check-n { font-size: 12.5px; color: var(--ink-2); min-height: 1em; }
.elig-glyph {
  flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--ink-3);
}
.elig-glyph.ok { background: var(--ok); } .elig-glyph.danger { background: var(--danger); }
.elig-glyph.muted { background: var(--bg-2); color: var(--ink-3); border: 1px solid var(--line-strong); }
.elig-toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
.elig-search-wrap {
  flex: 0 1 280px; min-width: 180px; display: flex; align-items: center; gap: 6px; padding: 0 10px;
  border: 1px solid var(--border-input); border-radius: var(--radius); background: var(--surface); color: var(--ink-3);
}
.elig-search { flex: 1; min-width: 0; border: 0; padding: 7px 0; margin: 0; font: inherit; font-size: 13.5px; background: none; color: var(--ink); }
.elig-search:focus { outline: none; }
.elig-search-wrap input.elig-search, .elig-search-wrap input.elig-search:focus { border: 0; box-shadow: none; outline: none; background: none; }
.elig-search-wrap:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.elig-fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.elig-fchip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font: inherit; font-size: 12.5px; color: var(--ink-2);
}
.elig-fchip .elig-count-icon { width: 15px; height: 15px; font-size: 9px; }
.elig-fchip.ok .elig-count-icon { background: var(--ok); }
.elig-fchip.danger .elig-count-icon, .elig-fchip.unclear .elig-count-icon, .elig-fchip.action .elig-count-icon { background: var(--danger); }
.elig-fchip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.elig-fchip-n { font-variant-numeric: tabular-nums; color: var(--ink-3); }
.elig-elsewhere { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.elig-grp + .elig-grp { margin-top: 10px; }
.elig-grph {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; width: 100%; padding: 6px 2px; margin-bottom: 4px;
  border: 0; background: none; font: inherit; text-align: left; cursor: pointer; color: var(--ink);
}
.elig-chev { width: 12px; color: var(--ink-3); }
.elig-grpt { font-weight: 700; font-size: 13.5px; }
.elig-grp.fix .elig-grpt, .elig-grp.you .elig-grpt { color: var(--danger); }
.elig-grpn { flex-basis: 100%; padding-left: 20px; font-size: 12.5px; color: var(--ink-2); }
@media (max-width: 720px) { .elig-checks { grid-template-columns: 1fr; } }

/* The project for this call (views/call_project.js): one choice for the whole call page. */
.cproj { position: relative; margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--accent-line);
  border-radius: var(--radius); background: var(--accent-soft); }
.cproj-k { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
/* The call's status for the chosen project, in the header (views/opportunity.js paintStatus()): a pill-shaped list in
   the status's own tone; blank, dashed and locked until a project is chosen. */
.status-dd-host { position: relative; display: inline-flex; }
.status-dd { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px 0 10px;
  font: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.status-dd:hover:not(:disabled) { border-color: var(--accent); }
.status-dd:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.status-dd.unset { border-style: dashed; color: var(--ink-3); font-weight: 600; }
.status-dd.st-EVALUATING { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.status-dd.st-UNDER_REVIEW, .status-dd.st-SHORTLISTED, .status-dd.st-PREPARING, .status-dd.st-SUBMITTED {
  background: var(--info-bg); color: var(--info); border-color: var(--info); }
.status-dd.st-WON { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.status-dd.st-LOST, .status-dd.st-REJECTED, .status-dd.st-WITHDRAWN { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.status-dd.blocked { cursor: not-allowed; border-style: dashed; background: var(--surface-2); color: var(--ink-3); min-width: 64px; justify-content: space-between; }
.status-dd-blank { letter-spacing: 0; }
/* In the project section the list matches the project picker's height, and opens towards the page's middle. */
.cproj-status .status-dd { height: 44px; padding: 0 12px 0 14px; font-size: 12.5px; min-width: 150px; justify-content: space-between; }
.cproj-status .status-menu { left: auto; right: 0; }
@media (max-width: 720px) {
  .cproj-status .status-dd-host, .cproj-status .status-dd { width: 100%; }
  .cproj-status .status-menu { left: 0; right: auto; }
}
.status-dd-chev { display: inline-flex; opacity: .8; }
.status-dd[aria-expanded="true"] .status-dd-chev { transform: rotate(180deg); }
.status-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg, 0 8px 24px rgba(15, 23, 42, .14));
  display: flex; flex-direction: column; gap: 2px; text-transform: none; letter-spacing: 0; }
.status-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 6px;
  font-size: 12px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.status-menu-head .iconbtn.small-icon { width: 24px; height: 24px; color: var(--accent); }
.status-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 6px 8px;
  border: 0; border-radius: var(--radius); background: none; font: inherit; text-align: left; cursor: pointer; }
.status-opt:hover, .status-opt:focus-visible { background: var(--surface-2); outline: none; }
.status-opt.on { background: var(--accent-soft); }
.status-tick { color: var(--accent); font-weight: 700; }
.status-opt.clear { margin-top: 2px; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); color: var(--danger); font-size: 13px; }
/* The project for this call and, beside it, where the organisation stands on the call (views/opportunity.js). */
.cproj-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 24px; align-items: start; }
.cproj-pick { min-width: 0; }
.cproj-status .cproj-k { display: flex; align-items: center; gap: 4px; min-height: 18px; margin-bottom: 4px; }
.cproj-status .cproj-k label { cursor: pointer; }
.cproj-status .iconbtn.small-icon { width: 22px; height: 22px; color: var(--accent); }
.cproj-status-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cproj-status-select { min-width: 180px; padding: 9px 32px 9px 12px; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--ink); background-color: var(--surface); border: 1px solid var(--border-input); border-radius: var(--radius); }
.cproj-status-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 720px) { .cproj-grid { grid-template-columns: minmax(0, 1fr); } .cproj-status-select { width: 100%; } }
.cproj-row { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.cproj-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; max-width: 100%; padding: 8px 12px;
  border: 1px solid var(--border-input); border-radius: var(--radius); background: var(--surface);
  font: inherit; color: var(--ink); text-align: left; cursor: pointer; box-shadow: 0 1px 2px rgba(15, 18, 26, .06);
}
.cproj-btn:hover:not(:disabled) { border-color: var(--accent); }
.cproj-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cproj-btn.static { cursor: default; box-shadow: none; }
.cproj-btn.choose { border-style: dashed; border-color: var(--accent); }
.cproj-title { font-size: 15px; font-weight: 650; min-width: 0; overflow-wrap: break-word; }
.cproj-title.unset { color: var(--accent); }
.cproj-meta { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.cproj-meta .tab-dot { margin: 0 2px 0 0; }
.cproj-att { color: var(--danger); font-weight: 600; }
.cproj-chev { display: inline-flex; color: var(--ink-3); margin-left: 2px; }
/* The chosen project's relevance, beside the button: the band as a meter and its word, why on hover, anchored to the box's right edge so a long reason
   stays on the page. */
.cproj-rel {
  --rel: var(--ink-3); --rel-bg: var(--surface-2);
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px;
  border: 1px solid var(--rel); border-radius: var(--radius); background: var(--rel-bg); color: var(--rel);
}
.cproj-rel.s-vlow { --rel: var(--danger); --rel-bg: var(--danger-bg); }
.cproj-rel.s-low { --rel: var(--warn); --rel-bg: var(--warn-bg); }
.cproj-rel.s-mid { --rel: var(--info); --rel-bg: var(--info-bg); }
.cproj-rel.s-high, .cproj-rel.s-vhigh { --rel: var(--ok); --rel-bg: var(--ok-bg); }
.cproj-rel-meter { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; }
.cproj-rel-meter i { width: 4px; border-radius: 1px; background: currentColor; opacity: .22; }
.cproj-rel-meter i:nth-child(1) { height: 6px; } .cproj-rel-meter i:nth-child(2) { height: 9px; }
.cproj-rel-meter i:nth-child(3) { height: 12px; } .cproj-rel-meter i:nth-child(4) { height: 15px; }
.cproj-rel-meter i:nth-child(5) { height: 18px; }
.cproj-rel-meter i.on { opacity: 1; }
.cproj-rel-txt { display: flex; flex-direction: column; line-height: 1.15; }
.cproj-rel-k { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.cproj-rel-v { font-size: 15px; font-weight: 700; white-space: nowrap; }
.cproj-rel-i { display: inline-flex; opacity: .7; }
.cproj-rel:hover .cproj-rel-i, .cproj-rel:focus-visible .cproj-rel-i { opacity: 1; }
.cproj-rel[data-tip]::after { left: auto; right: 0; transform: none; max-width: min(380px, calc(100vw - 48px)); }
@media (max-width: 720px) { .cproj-rel[data-tip]::after { left: 0; right: auto; } }
.cproj-btn[aria-expanded="true"] .cproj-chev { transform: rotate(180deg); }
.cproj-note { font-size: 12.5px; color: var(--ink-2); }
.cproj-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.cproj-dot.ok { background: var(--ok); } .cproj-dot.danger { background: var(--danger); } .cproj-dot.muted { background: var(--ink-3); }
.cproj-dot.none { background: none; border: 2px dashed var(--accent-line); width: 8px; height: 8px; }
.cproj-dot.running { animation: ai-pulse 1.1s ease-in-out infinite; }
.cproj-pop {
  position: absolute; z-index: 30; left: 16px; top: calc(100% - 6px); width: min(560px, calc(100% - 32px));
  max-height: 360px; overflow-y: auto; padding: 6px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(15, 18, 26, .16);
}
.cproj-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; border-radius: var(--radius);
  background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
}
.cproj-opt:hover, .cproj-opt:focus-visible { background: var(--surface-2); outline: none; }
.cproj-opt.on { background: var(--accent-soft); }
.cproj-opt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cproj-opt-title { font-weight: 600; overflow-wrap: break-word; }
.cproj-opt-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cproj-tick { color: var(--accent); font-weight: 700; }
.cproj-new { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 10px; border-top: 1px solid var(--line);
  font-weight: 600; text-decoration: none; }
@media (max-width: 720px) {
  .cproj-pop { left: 8px; width: calc(100% - 16px); }
  .cproj-btn { width: 100%; flex-wrap: wrap; row-gap: 2px; }
  .cproj-btn .cproj-title { flex: 1 1 calc(100% - 60px); }
  .cproj-btn .cproj-meta { order: 3; flex-basis: 100%; padding-left: 20px; }
}

/* Eligibility: the project or the organisation alone; the way on to the Partners tab. */
.elig-view { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; align-self: flex-start; }
.elig-view button { padding: 6px 12px; border: 0; border-left: 1px solid var(--line-strong); background: var(--surface);
  font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.elig-view button:first-child { border-left: 0; }
.elig-view button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.elig-view-hint { margin: 0; color: var(--ink-2); }

/* The Partners tab: one team card (views/consortium.js), its parts from eligibility.js. */
.team-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.team-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.team-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.team-status-v { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; }
.team-body { display: flex; flex-direction: column; gap: 14px; }
.team-numbers .cons-team-line { font-weight: 600; font-size: 13.5px; }
.tlist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); }
.trow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line); }
.trow:first-child { border-top: 0; }
.trow-av {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px;
}
.trow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.trow-name { font-weight: 650; overflow-wrap: break-word; }
.trow-sub { font-size: 12.5px; color: var(--ink-2); }
.trow-status { width: auto; margin: 0; }
.trow-remove { flex: none; padding: 0; }
.team-add { display: flex; flex-direction: column; gap: 8px; }
.team-add-k { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.team-add .echat { margin: 0; }
.team-add-more { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.team-asks .rlist { margin-top: 4px; }
.cons-step-title { font-size: 15px; margin: 6px 2px -4px; }
.cons-next-body { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.elig-check-go { color: var(--accent); font-weight: 600; }
@media (max-width: 720px) { .trow { flex-wrap: wrap; } .trow-main { flex-basis: calc(100% - 42px); } }
.prop-project { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

/* The project fact sheet (views/project_facts.js) and the way to it from Eligibility's "Our fact". */
.pfs header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pfs-count { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.pfs-note { margin: 0 0 12px; max-width: 80ch; }
.pfs-group + .pfs-group { margin-top: 14px; }
.pfs-group-t { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 6px; }
.pfs-rows { display: grid; grid-template-columns: 260px minmax(0, 1fr); margin: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.pfs-rows dt, .pfs-rows dd { margin: 0; padding: 9px 12px; border-top: 1px solid var(--line); font-size: 13.5px; }
.pfs-rows dt:first-of-type, .pfs-rows dt:first-of-type + dd { border-top: 0; }
.pfs-rows dt { color: var(--ink); font-weight: 600; display: flex; flex-direction: column; gap: 2px; }
.pfs-hint { font-weight: 400; font-size: 12px; color: var(--ink-2); }
.pfs-rows dd { display: flex; flex-direction: column; gap: 6px; }
.pfs-rows dd.none .pfs-val { color: var(--ink-3); }
.pfs-rows .focus { background: var(--accent-soft); }
.pfs-main { min-width: 0; overflow-wrap: break-word; }
.pfs-trust { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.fact-tag.muted { color: var(--ink-2); border-color: var(--line-strong); background: var(--bg-2); }
@media (max-width: 720px) { .pfs-rows { grid-template-columns: 1fr; } .pfs-rows dd { border-top: 0; padding-top: 0; } }
.rbox-go { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
@media (max-width: 720px) { .pfs-rows { grid-template-columns: 1fr; } .pfs-rows dd { border-top: 0; padding-top: 0; } }
/* Saved answers, their trust (confirmed or not, by whom) and the live re-check (views/eligibility.js). */
.rrow-status.checking { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
.rrow-status.checking .tab-dot { margin: 0; }
.fact-trust { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.fact-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 1px 6px;
  border-radius: var(--radius); border: 1px solid; }
.fact-tag.ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.fact-tag.danger { color: var(--danger); border-color: var(--danger-line); background: var(--danger-bg); }
.ebub.saved { display: flex; flex-direction: column; gap: 8px; max-width: min(92%, 680px); border-color: var(--ok-line); }
.saved-k { font-weight: 650; color: var(--ok); }
.saved-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.recheck-list { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }
.elig-gaps ul { margin: 8px 0 0; padding-left: 20px; font-size: 13.5px; line-height: 1.55; }
.elig-gaps li { margin-bottom: 4px; }
.elig-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 0 2px; }

@media (max-width: 720px) {
  .elig-hero-body { flex-direction: column; gap: 12px; }
  .elig-ov { grid-template-columns: 1fr; gap: 2px; }
  .elig-ov dd { margin-bottom: 8px; }
}

/* ── Detail panels ────────────────────────────────────────────────────────────────────── */

.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 7px 14px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; word-break: break-word; }

@media (max-width: 480px) {
  /* A fixed 150px label column is still readable narrower than this — it is the value next
     to it, often a euro figure or a date range, that has nowhere left to give. Stacked, both
     get the full width back. */
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
}

/* On a phone the strip scrolls sideways on its own rather than widening the page. */
.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px;
  overflow-x: auto; scrollbar-width: thin;
}
.tabs button {
  flex: none; padding: 8px 14px; border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--ink-2); font: inherit; font-weight: 500; cursor: pointer;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { color: var(--ink-3); font-weight: 400; }

/* ── Live-generation mode switch ──────────────────────────────────────────────────────── */

.gen-notice { display: flex; align-items: center; gap: 6px; }

.mode-switch {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px);
}
.mode-switch button {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: 0; border-radius: var(--radius);
  background: none; color: var(--ink-2); font: inherit; font-weight: 500; cursor: pointer;
}
.mode-switch button.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.gen-box {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 48px 20px; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2);
}
.gen-box .gen-icon { color: var(--accent); }
.gen-box .gen-icon svg { width: 26px; height: 26px; }
.gen-box p { margin: 0; color: var(--ink-2); }

/* The measure is a property of the text, not of the card. A tender description set across a
   900px panel is technically legible and practically unreadable — the eye loses the line on
   the way back. 68ch is roughly 11 words. */
.prose {
  font-size: 14px; line-height: 1.65; white-space: pre-wrap; word-break: break-word;
  max-width: var(--measure);
}
.prose.wide { max-width: none; }
.prose.clamped { max-height: 340px; overflow: hidden; position: relative; }
.prose.clamped::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 60px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--surface));
}

/* ── Comments and files ───────────────────────────────────────────────────────────────── */

.comment { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: 0; }
.comment.reply { margin-left: 34px; }
.comment .who { font-weight: 600; font-size: 13px; }
.comment .when { color: var(--ink-3); font-size: 11px; margin-left: 6px; }
.comment .text { white-space: pre-wrap; margin-top: 2px; }
.comment .acts { margin-top: 4px; }

.filerow {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.filerow:last-child { border-bottom: 0; }
.filerow .meta { flex: 1; min-width: 0; }
.filerow .name { font-weight: 500; display: block; overflow-wrap: anywhere; }
.filerow .sub  { font-size: 11px; color: var(--ink-3); }

.dropzone {
  padding: 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius);
  text-align: center; color: var(--ink-3); font-size: 13px; cursor: pointer;
}
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* File preview (components.js openPreview): a PDF in the browser's own viewer, an image fitted. */
.modal.preview-modal { max-width: min(1100px, 96vw); display: flex; flex-direction: column; overflow: hidden; }
.modal.preview-modal > header h2 { overflow-wrap: anywhere; }
.modal.preview-modal > .body { flex: 1; min-height: 0; padding: 0; background: var(--surface-2); }
.preview-stage { display: grid; place-items: center; min-height: 50vh; }
.preview-frame { display: block; width: 100%; height: 76vh; border: 0; background: #fff; }
.preview-image { display: block; max-width: 100%; max-height: 76vh; margin: 16px auto; object-fit: contain; }
.preview-wait { display: grid; gap: 10px; width: min(420px, 80%); }
.preview-stage .empty { padding: 40px 20px; }

/* ── Login ────────────────────────────────────────────────────────────────────────────── */

/* The photograph is dimmed almost to a texture, not used as an image. Two reasons: a login
   screen has to hold white body text at AA contrast wherever the photo happens to be light,
   and this is the front door of a public administration — it should read as institutional,
   not as a travel page. The solid near-black underneath is not a fallback detail: it is what the
   screen looks like on a ministry network that blocks the image host, and it still looks
   finished. */
.login-wrap {
  min-height: 100vh;
  display: grid; place-items: center; padding: 24px;
  background-color: var(--rail-900);
  background-image:
    linear-gradient(rgba(11, 14, 18, .86), rgba(11, 14, 18, .93)),
    url('https://images.unsplash.com/photo-1718260775649-b925159be5a0?q=80&w=1470');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--rail-ink);
}

.login-inner { width: 100%; max-width: 420px; }

/* The badge, at a size that carries. It is the platform's mark on a screen that has nothing
   else on it, so at 22px it looked like a favicon that had wandered in. */
.login-badge { margin-bottom: 8px; }
/* The brand book's wordmark file: about 3.6 to 1, with its own clear space; at least 120 px wide. */
.login-wordmark { display: block; height: 64px; width: auto; }

.login-kicker {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--rail-ink-3); margin-bottom: 26px;
}

.login-card {
  padding: 26px;
  background: var(--surface);
  border-radius: var(--radius);
  /* One of the two places a shadow is earned: this really is a sheet lifted off a photograph,
     and there is no border colour that would read against an arbitrary image. */
  box-shadow: 0 18px 48px rgba(4, 12, 26, .5);
  color: var(--ink);
}
.login-card .tagline { color: var(--ink-3); font-size: 13px; margin-bottom: 20px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }

.login-foot {
  margin-top: 16px; text-align: center; font-size: 12px;
}
.login-foot a { color: var(--accent); }

/* Below the card: the same institutional pair as the sidebar, so the flags are the first and
   last thing a user sees, and the language control, because it has to be reachable BEFORE
   there is a session to remember a preference in. */
.login-institutional {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .14);
}
.login-institutional .flags { padding: 0; }
.login-institutional .langswitch { padding: 0; }
.login-institutional .langswitch button { min-width: 62px; }

.login-poweredby {
  margin-top: 18px; text-align: center; font-size: 11px;
  color: var(--rail-ink-3);
}

/* ── Feedback ─────────────────────────────────────────────────────────────────────────── */

.alert {
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 12px;
  border: 1px solid transparent;
}
.alert.error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.alert.info  { background: var(--info-bg);   color: var(--info);   border-color: var(--info-line); }
.alert.warn  { background: var(--warn-bg);   color: var(--warn);   border-color: var(--warn-line); }

.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); }
.empty strong { display: block; color: var(--ink-2); margin-bottom: 4px; font-weight: 600; }
.empty.load-failed { padding: 28px 20px; }
.empty.load-failed .btn { margin-top: 10px; }

/* Skeleton rows rather than a spinner: the page keeps its shape while it loads, so nothing
   jumps when the data lands. */
.skel { background: var(--muted-bg); border-radius: var(--radius); height: 12px;
        animation: pulse 1.1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }

.toast-host { position: fixed; right: 16px; bottom: 16px; z-index: 100;
              display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 10px 14px; border-radius: var(--radius);
  background: var(--ink); color: #fff; font-size: 13px;
  box-shadow: 0 6px 20px rgba(22,32,43,.22); max-width: 340px;
}
.toast.error { background: var(--danger); }

.modal-back {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center; padding: 20px;
  background: rgba(22,32,43,.38);
}
.modal {
  width: 100%; max-width: 560px; max-height: 88vh; overflow: auto;
  background: var(--surface); border-radius: var(--radius);
}
.modal > header, .modal > footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px;
}
.modal > header { border-bottom: 1px solid var(--line); }
/* The invitation's result grows the dialog: anchored at the top, nothing above it moves (layout shift). */
.modal-back:has(> .invite-modal) { place-items: start center; padding-top: 8vh; }
.modal > footer { border-top: 1px solid var(--line); justify-content: flex-end; }
.modal .body { padding: 18px; }

.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.mono  { font-family: var(--mono); font-size: 12px; }
.right { text-align: right; }
.row   { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

@media print {
  .topbar, .filters, .page-actions, .tabs, .toast-host { display: none !important; }
  main { max-width: none; padding: 0; }
  .card { border: 0; }
}


/* ══════════════════════════════════════════════════════════════════════════════════════════
   DEADLINE FILTER
   A popover, not another select in the row: a date range is two inputs plus a set of presets,
   and flattening that into a dropdown either loses the custom range or makes the filter bar
   twice as tall for a control most people use once a week.
   ══════════════════════════════════════════════════════════════════════════════════════════ */

.popwrap { position: relative; display: inline-flex; }
.popbtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer;
}
.popbtn:hover { border-color: var(--ink-3); }
.popbtn.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.popbtn .caret { color: var(--ink-3); font-size: 10px; }

.pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 65;
  width: 268px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 8px 28px rgba(16, 24, 32, .16);
}
.pop h4 { font-size: 12px; letter-spacing: 0; color: var(--ink-3); }
.pop-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.pop-presets button {
  padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink-2);
  font: inherit; font-size: 12px; cursor: pointer;
}
.pop-presets button:hover { border-color: var(--ink-3); color: var(--ink); }
.pop-presets button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pop-range { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.pop-range .field { min-width: 0; }
.pop-range input[type=date] { min-width: 0; }
.pop-foot { display: flex; gap: 8px; margin-top: 12px; }
.pop-foot .btn { flex: 1; justify-content: center; }
.pop-note { font-size: 11.5px; color: var(--ink-3); margin-top: 10px; }


/* ══════════════════════════════════════════════════════════════════════════════════════════
   MONITORED SOURCES
   ══════════════════════════════════════════════════════════════════════════════════════════ */

/* Health is the only column anyone scans, so it is a dot plus a word rather than a coloured
   row: a table where whole rows are tinted red is unreadable the moment two of them are. */
.health { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.health::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3);
}
.health.ok::before        { background: var(--ok); }
.health.silent::before    { background: var(--warn); }
.health.failing::before   { background: var(--danger); }
.health.never_run::before { background: var(--ink-3); }
.health.paused::before    { background: var(--ink-3); }
.health.retired::before   { background: var(--line-strong); }
.health.retired { color: var(--ink-3); }

.scopetag {
  display: inline-block; padding: 1px 7px; border-radius: var(--radius);
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--ink-2);
}
.scopetag.own { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }


/* ══════════════════════════════════════════════════════════════════════════════════════════
   CHAT
   Two panes: the threads on the left, the open one on the right. Below the breakpoint the
   list collapses and the thread takes the screen, because a 360px-wide two-pane chat is two
   unusable panes rather than one usable one.
   ══════════════════════════════════════════════════════════════════════════════════════════ */

.chatwrap {
  display: grid; grid-template-columns: 300px 1fr; gap: 14px;
  height: calc(100vh - 168px); min-height: 460px;
}
.chatlist, .chatmain {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.chatlist-scroll { overflow-y: auto; flex: 1; }
.threadrow {
  display: flex; flex-direction: column; gap: 3px;
  padding: 11px 13px; border-bottom: 1px solid var(--line);
  color: var(--ink); cursor: pointer; border-left: 3px solid transparent;
}
.threadrow:hover { background: var(--surface-2); text-decoration: none; }
.threadrow.active { background: var(--accent-soft); border-left-color: var(--accent); }
.threadrow-top { display: flex; align-items: baseline; gap: 8px; }
.threadrow-name { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.threadrow-when { font-size: 11px; color: var(--ink-3); flex: none; }
.threadrow-last {
  font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.threadrow-unread {
  flex: none; min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 600;
}

.chathead {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.chatscroll { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 3px; }
.chatday {
  align-self: center; margin: 10px 0 6px;
  padding: 2px 10px; border-radius: var(--radius); background: var(--muted-bg);
  font-size: 11px; color: var(--ink-2);
}
.bubble {
  max-width: min(620px, 76%); align-self: flex-start;
  /* The one place asymmetry is allowed: three corners at the system radius and one square
     corner pointing at its sender. That is the whole visual grammar of a chat bubble, and it
     survives without importing a second, rounder radius to get it. */
  padding: 8px 12px; border-radius: var(--radius) var(--radius) var(--radius) 0;
  background: var(--muted-bg); color: var(--ink); font-size: 13.5px;
}
.bubble.mine {
  align-self: flex-end; background: var(--accent); color: #fff;
  border-radius: var(--radius) var(--radius) 0 var(--radius);
}
/* White, underlined. A tinted blue link on a blue ground fails contrast in both directions. */
.bubble.mine a { color: #fff; text-decoration: underline; }
.bubble-who { font-size: 11px; font-weight: 600; color: var(--ink-3); margin-bottom: 2px; }
.bubble-when { font-size: 10.5px; opacity: .7; margin-top: 3px; display: block; }
.bubble-ref {
  display: block; margin-top: 6px; padding: 5px 8px;
  border-radius: var(--radius); background: rgba(255, 255, 255, .55);
  font-size: 12px;
}
.bubble.mine .bubble-ref { background: rgba(255, 255, 255, .16); }
.chatcompose {
  display: flex; gap: 8px; align-items: flex-end;
  padding: 12px 16px; border-top: 1px solid var(--line);
}
.chatcompose textarea { flex: 1; resize: none; }

@media (max-width: 860px) {
  .chatwrap { grid-template-columns: 1fr; height: auto; }
  .chatlist { max-height: 320px; }
  .chatmain { min-height: 420px; }
}


/* ══════════════════════════════════════════════════════════════════════════════════════════
   AGENT WORKSPACE
   ══════════════════════════════════════════════════════════════════════════════════════════ */

/* The demonstration banner is not a footnote. It is the first thing in the panel and it stays
   there while the flows run, because the whole risk of a convincing mock is that somebody
   forgets it is one. */
.demo-banner {
  padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn);
  font-size: 12px; line-height: 1.45;
}

.agent-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.agent-tabs button {
  padding: 9px 14px; border: 0; background: none; cursor: pointer;
  color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.agent-tabs button:hover { color: var(--ink); }
.agent-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

.agent-body { padding: 14px 0 0; display: flex; flex-direction: column; gap: 12px; }
.agent-intro { font-size: 13px; color: var(--ink-2); }

/* Each step appears as the script advances. The spinner is a text glyph rather than an
   animation frame loop: it is a demo of latency, not a real one. */
.agent-steps { display: flex; flex-direction: column; gap: 6px; }
.agent-step {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-2);
}
.agent-step.done { color: var(--ink); }
.agent-step .tick { flex: none; width: 15px; text-align: center; font-weight: 700; }
.agent-step.running .tick { color: var(--accent); }
.agent-step.done .tick { color: var(--ok); }

.planstep {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.planstep + .planstep { margin-top: 8px; }
.planstep-n {
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 700;
}
.planstep-title { font-size: 13.5px; font-weight: 600; }
.planstep-note { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.planstep-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; display: flex; gap: 12px; flex-wrap: wrap; }

.finding {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); border-left-width: 3px;
}
.finding + .finding { margin-top: 8px; }
.finding.high   { border-left-color: var(--danger); }
.finding.medium { border-left-color: var(--warn); }
.finding.low    { border-left-color: var(--line-strong); }
.finding-what { font-size: 13.5px; font-weight: 600; }
.finding-why  { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }

.qa { display: flex; flex-direction: column; gap: 10px; }
.qa-q {
  align-self: flex-end; max-width: 82%;
  padding: 8px 12px; border-radius: var(--radius) var(--radius) 0 var(--radius);
  background: var(--accent); color: #fff; font-size: 13.5px;
}
.qa-a {
  align-self: flex-start; max-width: 92%;
  padding: 10px 13px; border-radius: var(--radius) var(--radius) var(--radius) 0;
  background: var(--muted-bg); font-size: 13.5px;
}
.qa-cite {
  display: block; margin-top: 8px; padding: 7px 10px;
  border-left: 3px solid var(--accent-line); background: var(--surface);
  font-size: 12px; color: var(--ink-2);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink-2);
  font: inherit; font-size: 12px; cursor: pointer; text-align: left;
}
.chips button:hover { border-color: var(--accent-line); color: var(--accent); }

/* CPV codes. Inline codes show their label on hover; a code not in the official list is in the
   warning colour everywhere (inline and as a tag). The picker is: chosen codes as tags,
   a search box with a result list under it, and (projects) suggestions that toggle on click. */
.cpv-code { text-decoration: underline dotted var(--ink-3); text-underline-offset: 3px; cursor: help; }
.cpv-code.unknown { color: var(--warn); text-decoration-color: var(--warn); }
.cpv-dash { margin: 0 6px; color: var(--ink-3); }

.cpv-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cpv-tags:empty { display: none; }
.cpv-tag {
  display: inline-flex; align-items: center; max-width: 100%; padding: 3px 2px 3px 8px;
  border: 1px solid var(--accent-line); border-radius: var(--radius); background: var(--brand-soft);
  font-size: 12px; color: var(--ink);
}
.cpv-tag .cpv-label { overflow-wrap: anywhere; }
.cpv-tag button {
  margin-left: 4px; padding: 0 6px; border: 0; background: none; color: var(--ink-3);
  font-size: 15px; line-height: 1; cursor: pointer;
}
.cpv-tag button:hover { color: var(--ink); }
.cpv-tag.unknown { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.cpv-warn { color: var(--warn); margin: -2px 0 8px; }

.cpv-search { position: relative; }
.cpv-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 5;
  max-height: 260px; overflow: auto; padding: 4px 0;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface);
  box-shadow: 0 6px 18px rgba(15, 18, 26, 0.12);
}
.cpv-result {
  display: block; width: 100%; padding: 6px 10px; border: 0; background: none;
  font: inherit; font-size: 13px; color: var(--ink); text-align: left; cursor: pointer;
}
.cpv-result:hover { background: var(--brand-soft); }
.cpv-result.unknown { color: var(--warn); }
.cpv-result-note { padding: 6px 10px; font-size: 12px; color: var(--ink-3); }

.cpv-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.cpv-actions .btn-ai { flex: none; }

/* The AI action button: a white pill with a blue-green-yellow ring and a sparkle, so a model's
   suggestion is recognisable at a glance. The ring is the border box painted with a gradient
   under a white padding box. */
.btn-ai, .ai-badge {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  border: 2px solid transparent; border-radius: 999px;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(110deg, #3db3c9 0%, #3fa9e6 40%, #5fcf8a 75%, #e8c93a 100%) border-box;
}
.btn-ai {
  padding: 5px 15px 5px 11px;
  box-shadow: 0 2px 8px rgba(15, 18, 26, 0.12);
  font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer;
  transition: box-shadow .15s ease;
}
.btn-ai:hover { box-shadow: 0 3px 14px rgba(15, 18, 26, 0.20); }
.btn-ai:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-ai:disabled { cursor: progress; }
.btn-ai .ico { display: block; }
.btn-ai.busy .ico { animation: ai-pulse 1s ease-in-out infinite; }
@keyframes ai-pulse { 50% { opacity: .35; transform: scale(.85); } }
@media (prefers-reduced-motion: reduce) { .btn-ai.busy .ico { animation: none; } }
.cpv-actions .hint { margin-top: 0; }
.cpv-suggest { display: grid; gap: 4px; margin-top: 8px; }
.cpv-suggest:empty { display: none; }
.cpv-sugg {
  display: flex; align-items: baseline; width: 100%; padding: 5px 8px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius); background: none;
  font: inherit; font-size: 13px; color: var(--ink); text-align: left; cursor: pointer;
}
.cpv-sugg:hover, .org-sugg:hover { border-color: var(--accent-line); }
.cpv-sugg.on, .org-sugg.on { border-style: solid; border-color: var(--accent-line); background: var(--brand-soft); }
.cpv-sugg-mark, .sugg-mark { flex: none; width: 18px; font-weight: 600; color: var(--accent); }

.draftbox {
  padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); font-size: 13.5px; line-height: 1.6; white-space: pre-wrap;
}

/* With the panel spanning the page, the progress log and its result sit side by side: the
   steps are a narrow column of short lines and the result is a wide one, and stacking them
   pushes the thing you actually want to read below the fold. */
@media (min-width: 1100px) {
  .agent-split { display: grid; grid-template-columns: 290px 1fr; gap: 18px; align-items: start; }
}
.agent-split .agent-steps { position: sticky; top: 66px; }


/* ══════════════════════════════════════════════════════════════════════════════════════════
   CHARTS
   Inline SVG and plain HTML bars. The palette lives in charts.js because it is data-encoding,
   not decoration: which hue a mark takes is decided by what the series MEANS, and that
   decision belongs next to the code that draws it.
   ══════════════════════════════════════════════════════════════════════════════════════════ */

.chart-card .body { padding-top: 12px; }
.chart-note { font-size: 12px; color: var(--ink-3); margin-bottom: 10px; }
.chart-host { position: relative; }

/* The column chart draws in real pixels and re-draws on resize, so this height is the only
   thing that sets its size: a wide card gives wider columns, never a taller chart, and the
   4px corner on a bar stays a 4px corner instead of being stretched into an ellipse. */
.chart-svg { display: block; width: 100%; height: 190px; }
.chart-hit { cursor: default; }
.chart-hit:hover, .chart-hit:focus-visible { fill: rgba(37, 71, 160, .06); }
.chart-hit:focus { outline: none; }
.chart-hit:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.hbar:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius-sm); }

.chart-tip {
  position: absolute; z-index: 30; pointer-events: none;
  display: flex; flex-direction: column; gap: 1px;
  min-width: 92px; max-width: 260px; padding: 7px 10px;
  background: var(--ink); color: #fff; border-radius: var(--radius-sm);
  font-size: 12px; line-height: 1.4;
  box-shadow: 0 4px 14px rgba(16, 24, 32, .22);
}
.chart-tip .small { color: var(--rail-ink-2); font-size: 11.5px; }

/* ── Horizontal bars ──────────────────────────────────────────────────────────────────── */

.hbars { display: flex; flex-direction: column; gap: 4px; }
.hbar {
  display: grid; grid-template-columns: minmax(88px, 34%) 1fr auto;
  gap: 12px; align-items: center;
  padding: 6px 6px; border-radius: var(--radius-sm); color: var(--ink);
}
a.hbar:hover { background: var(--surface-2); text-decoration: none; }
.hbar-label { min-width: 0; display: flex; flex-direction: column; }
.hbar-name {
  font-size: 12.5px; font-weight: 500; overflow-wrap: anywhere; }
.hbar-sub { font-size: 11px; color: var(--ink-3); }
/* The track is the full scale, drawn one step off the surface. Without it a short bar floats
   with nothing to be short against, and the reader cannot see it is 2 out of 9. */
.hbar-track { height: 14px; background: var(--muted-bg); border-radius: var(--radius); overflow: hidden; }
.hbar-fill {
  display: block; height: 100%;
  /* Rounded at the data end only, square at the baseline — the same rule as the columns. */
  border-radius: 0 var(--radius) var(--radius) 0;
}
.hbar-value {
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
  min-width: 22px; text-align: right;
}

/* ── The emphasis key ─────────────────────────────────────────────────────────────────── */

/* Two colours means the reader is told which is which in words, not left to infer it. */
.chart-key { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.chart-key span { display: inline-flex; align-items: center; gap: 6px;
                  font-size: 11.5px; color: var(--ink-2); }
.chart-key i { width: 10px; height: 10px; border-radius: var(--radius); display: inline-block; }

/* ── Conversations on the dashboard ───────────────────────────────────────────────────── */

.convrow {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink);
}
.convrow:last-child { border-bottom: 0; }
.convrow:hover { text-decoration: none; }
.convrow:hover .convrow-name { color: var(--accent); }
.convrow-body { flex: 1; min-width: 0; }
.convrow-top { display: flex; align-items: baseline; gap: 8px; }
.convrow-name { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.convrow-when { font-size: 11px; color: var(--ink-3); flex: none; }
.convrow-last {
  font-size: 12px; color: var(--ink-2); margin-top: 1px; overflow-wrap: anywhere; }


/* ══════════════════════════════════════════════════════════════════════════════════════════
   RENDERED SOURCE MARKUP
   Eligibility and award criteria arrive as HTML written by a funding portal. `.prose.html`
   switches off the pre-wrap that plain text needs: with it on, every newline the source left
   between two tags becomes a blank line on screen.

   Everything here is scoped under `.prose.html` and re-states the few element styles that
   matter, because the incoming markup carries no classes of ours — the sanitiser strips the
   source's `class` attributes, so a portal's own stylesheet names cannot collide with the
   application's.
   ══════════════════════════════════════════════════════════════════════════════════════════ */

.prose.html { white-space: normal; }
.prose.html > :first-child { margin-top: 0; }
.prose.html > :last-child { margin-bottom: 0; }

.prose.html p { margin: 0 0 10px; }
.prose.html h1, .prose.html h2, .prose.html h3,
.prose.html h4, .prose.html h5, .prose.html h6 {
  /* A source's <h1> is a heading inside our card, not a page title. All six levels are
     flattened to one weight and two sizes so a scraped document cannot out-shout the
     card heading above it. */
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  margin: 16px 0 6px; letter-spacing: 0;
}
.prose.html ul, .prose.html ol { margin: 0 0 10px; padding-left: 22px; }
.prose.html li { margin-bottom: 4px; }
.prose.html li > p { margin-bottom: 4px; }

.prose.html dl { margin: 0 0 10px; }
.prose.html dt { font-weight: 600; margin-top: 8px; }
.prose.html dd { margin: 0 0 4px; }

.prose.html blockquote {
  margin: 10px 0; padding: 2px 0 2px 12px;
  border-left: 3px solid var(--accent-line); color: var(--ink-2);
}
.prose.html hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.prose.html code { font-family: var(--mono); font-size: 12.5px; background: var(--muted-bg);
                   padding: 1px 4px; border-radius: var(--radius); }
.prose.html pre { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2);
                  border: 1px solid var(--line); border-radius: var(--radius-sm);
                  padding: 10px; overflow-x: auto; white-space: pre; }
.prose.html pre code { background: none; padding: 0; }

/* A source table can be far wider than the card. It scrolls inside its own box rather than
   pushing the page sideways. */
/* A table is data, not prose, so it is the one child that may break the 68ch measure. */
.prose.html table {
  display: block; width: max-content; max-width: 100%; overflow-x: auto;
  border-collapse: collapse; font-size: 13px; margin: 0 0 10px;
}
.prose.html th, .prose.html td {
  border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: top;
}
.prose.html th { background: var(--surface-2); font-weight: 600; }

/* A link into a third-party document is marked as leaving, because in this context it
   usually is the actual call document and the user should know they are going there. */
.prose.html a[target="_blank"]::after {
  content: ' ↗'; font-size: .85em; color: var(--ink-3);
}

/* The definition list a non-string value is rendered as. */
.prose.html > .kv, .rt > .kv { margin: 0; }

/* ══════════════════════════════════════════════════════════════════════════════════════════
   FORMATTED TEXT — format.js
   The reading rules R1–R9 (documented at the top of format.js) made visible. One typographic
   system for every long text: the call as published, its translation, the AI summary, a
   project's description and the eligibility findings. Quiet on purpose — hierarchy comes from
   spacing and weight, colour is reserved for the accent rule and the figures.
   ══════════════════════════════════════════════════════════════════════════════════════════ */

.fmt {
  --fmt-measure: var(--measure);
  font-size: 14px; line-height: 1.65; color: var(--ink);
  white-space: normal; word-break: break-word; overflow-wrap: anywhere;
}
.fmt.wide { --fmt-measure: 88ch; }
.fmt > p, .fmt > ul, .fmt > ol, .fmt > h3, .fmt > h4, .fmt > blockquote, .fmt > dl,
.fmt .msg-body > p, .fmt .msg-body > ul { max-width: var(--fmt-measure); }
.fmt > :first-child { margin-top: 0 !important; }
.fmt > :last-child { margin-bottom: 0; }

/* R1 */
.fmt p { margin: 0 0 12px; }
.fmt p.intro { margin-bottom: 6px; }

/* R2 — two levels, never louder than the card title. The upper level is an eyebrow with a
   hairline above it: it separates sections of a long call without shouting. */
.fmt h3.sec {
  font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-2); margin: 26px 0 10px; padding-top: 14px; border-top: 1px solid var(--line);
}
.fmt h4.sec {
  font-size: 14px; font-weight: 650; color: var(--ink); margin: 22px 0 6px;
  display: flex; align-items: center; gap: 8px;
}
.fmt h4.sec::before {
  content: ""; width: 3px; height: 14px; border-radius: 1px; background: var(--accent); flex: none;
}
.fmt > h3.sec + h4.sec { margin-top: 4px; }

/* R3 — a bullet is a small accent square, not the UA disc: it reads as the product's list,
   not the portal's. Ordered lists keep numbers, set in the muted ink. */
.fmt ul { list-style: none; margin: 0 0 12px; padding: 0; }
.fmt ul > li { position: relative; padding-left: 18px; margin-bottom: 6px; }
.fmt ul > li::before {
  content: ""; position: absolute; left: 3px; top: .66em;
  width: 5px; height: 5px; background: var(--accent); border-radius: 1px; opacity: .8;
}
.fmt ol { margin: 0 0 12px; padding-left: 24px; }
.fmt ol > li { margin-bottom: 6px; padding-left: 4px; }
.fmt ol > li::marker { color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.fmt li > ul, .fmt li > ol { margin: 6px 0 0; }
.fmt li > p { margin: 0 0 4px; }

/* R4, R5 */
.fmt .lead-label, .fmt strong { font-weight: 650; color: var(--ink); }
.fmt .fig { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }

.fmt a { color: var(--accent); text-underline-offset: 2px; }
.fmt a[target="_blank"]::after { content: ' ↗'; font-size: .85em; color: var(--ink-3); }

.fmt blockquote {
  margin: 10px 0; padding: 2px 0 2px 12px;
  border-left: 3px solid var(--accent-line); color: var(--ink-2);
}
.fmt hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.fmt code { font-family: var(--mono); font-size: 12.5px; background: var(--muted-bg);
            padding: 1px 4px; border-radius: var(--radius); }
.fmt dl { margin: 0 0 12px; }
.fmt dt { font-weight: 600; margin-top: 8px; }
.fmt dd { margin: 0 0 4px; }
.fmt > .kv { margin: 0; }

.fmt .table-scroll { max-width: 100%; overflow-x: auto; margin: 0 0 14px; }
.fmt table { border-collapse: collapse; font-size: 13px; width: max-content; min-width: 50%; }
.fmt th, .fmt td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.fmt th { background: var(--surface-2); font-weight: 600; }

/* R8 — the section map. */
.text-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.text-toc button {
  font: inherit; font-size: 12px; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 9px; cursor: pointer;
}
.text-toc button:hover { color: var(--accent); border-color: var(--accent-line); }
.fmt h3.sec, .fmt h4.sec { scroll-margin-top: 80px; }

/* The AI summary: its first paragraph is the one-sentence answer, so it is set a step larger. */
.fmt.lead > p:first-child { font-size: 15px; line-height: 1.6; }
.fmt.lead ul > li { margin-bottom: 7px; }

/* Portal news items. */
.msg-list { display: flex; flex-direction: column; gap: 12px; }
.msg { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
.msg-date { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; padding-top: 2px; }
.msg-body > :last-child { margin-bottom: 0; }

/* The EC budget table. */
.budget-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px;
               background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.budget-grid > div { background: var(--surface); padding: 10px 12px; }
.budget-grid .k { font-size: 11.5px; color: var(--ink-3); margin-bottom: 3px; }
.budget-grid .v { font-weight: 650; font-variant-numeric: tabular-nums; }
.budget-others { margin-top: 12px; font-size: 13px; }
.budget-others summary { cursor: pointer; color: var(--ink-2); }
.budget-others table { margin-top: 8px; border-collapse: collapse; font-size: 12.5px; width: 100%; }
.budget-others th, .budget-others td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.budget-others td.num, .budget-others th.num { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .msg { grid-template-columns: 1fr; gap: 2px; }
}

/* ── The drafting assistant ──────────────────────────────────────────────────────────────
   The panel spans the page above the section editor. Its job is to make the machine's state
   legible at a glance: where it is, what it is waiting for, what it has spent. */

.card.agent > header { align-items: center; gap: 12px; flex-wrap: wrap; }

.spend { display: flex; align-items: center; gap: 8px; }
.spend-bar { width: 120px; height: 6px; border-radius: 3px; background: var(--line);
             overflow: hidden; }
.spend-bar > div { height: 100%; background: var(--accent); transition: width .4s ease; }
.spend-bar > div.over { background: var(--danger); }

/* The step rail. Horizontal on a desktop, and allowed to wrap rather than scroll: a clerk on a
   1280px council machine should see all nine steps at once, because the point of the rail is
   that the whole shape of the run is visible before it starts. */
.steprail { display: flex; flex-wrap: wrap; gap: 4px 0; list-style: none;
            margin: 0 0 16px; padding: 0; }
.steprail li { display: flex; align-items: center; gap: 6px; flex: 1 1 auto;
               font-size: 12px; color: var(--ink-3); white-space: nowrap; padding-right: 10px; }
.steprail .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line);
                 flex: none; }
.steprail li.done { color: var(--ink-2); }
.steprail li.done .dot { background: var(--ok); }
.steprail li.here .dot,
.steprail li.running .dot { background: var(--accent); }
.steprail li.here, .steprail li.running { color: var(--ink); font-weight: 600; }
.steprail li.running .dot { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.agent-intro { color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.agent-working { display: flex; gap: 12px; align-items: flex-start; padding: 14px;
                 border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); }
.spinner { width: 16px; height: 16px; flex: none; margin-top: 2px; border-radius: 50%;
           border: 2px solid var(--line); border-top-color: var(--accent);
           animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* In a button it takes the button's own ink, so it shows on a primary fill as well. */
.btn .spinner { width: 12px; height: 12px; margin-top: 0;
                border-color: currentColor; border-top-color: transparent; }

/* The action zone is bordered and tinted because it is the one part of the screen that is a
   question. Everything else on the page can be read later; this cannot. */
.agent-ask { border: 1px solid var(--accent); border-radius: 8px; padding: 16px;
             background: var(--bg-2); }
.agent-ask > h3 { margin: 0 0 6px; font-size: 15px; }

/* ── The plan ── */
.plandoc { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-top: 10px;
           background: var(--bg); }
.plandoc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
                margin-bottom: 6px; }
.plansections { margin: 6px 0 0; padding-left: 20px; font-size: 13px; color: var(--ink-2); }
.plansections li { margin-bottom: 5px; }
.plansection-heading { color: var(--ink); font-weight: 500; }

/* ── Fact cards ── */
.factcard { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-top: 10px;
            background: var(--bg); }
.factcard.muted { opacity: .6; }
.factcard-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.factcard-body { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
                 margin-top: 10px; }
.factcard-body .field { flex: 1 1 220px; margin: 0; }
.fact-label { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.fact-question { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; }
.fact-why { font-size: 12.5px; color: var(--ink-3); font-style: italic; margin-top: 2px; }
.checkline { display: flex; align-items: center; gap: 6px; font-size: 12.5px;
             color: var(--ink-2); padding-bottom: 8px; }
.checkline input { width: auto; margin: 0; }

.factrow { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0;
           border-bottom: 1px solid var(--line); }
.factrow:last-child { border-bottom: 0; }
.fact-value { text-align: right; max-width: 45%; word-break: break-word; }

/* ── Reference tabs ── */
.agent-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line);
              margin: 18px 0 0; overflow-x: auto; }
.agent-tabs button { background: none; border: 0; border-bottom: 2px solid transparent;
                     padding: 8px 12px; font: inherit; font-size: 13px; color: var(--ink-3);
                     cursor: pointer; white-space: nowrap; }
.agent-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent);
                                           font-weight: 600; }
.agent-refbody { padding-top: 14px; }

.reqtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.reqtable th { text-align: left; font-size: 11.5px; text-transform: uppercase;
               letter-spacing: .04em; color: var(--ink-3); padding: 6px 8px;
               border-bottom: 1px solid var(--line); }
.reqtable td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.reqtable tr.unmet td { background: color-mix(in srgb, var(--danger) 6%, transparent); }
.reqtable blockquote { margin: 4px 0 0; padding-left: 8px; border-left: 2px solid var(--line);
                       color: var(--ink-3); font-style: italic; }

.checkblock { border: 1px solid var(--line); border-radius: 8px; padding: 12px;
              margin-bottom: 10px; }

/* Findings are laid out the same way wherever they appear, so a blocker looks identical in the
   action zone and in the checks tab. */
.finding { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0;
           border-bottom: 1px solid var(--line); }
.finding:last-child { border-bottom: 0; }
.finding-what { font-weight: 600; font-size: 13.5px; }
.finding-why { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }

.transcript { max-height: 460px; overflow-y: auto; }
.comment.ask { background: color-mix(in srgb, var(--accent) 7%, transparent); border-radius: 6px;
               padding: 6px; }
.comment.error { background: color-mix(in srgb, var(--danger) 8%, transparent);
                 border-radius: 6px; padding: 6px; }

.docheading { font-size: 13px; text-transform: uppercase; letter-spacing: .05em;
              color: var(--ink-3); margin: 18px 0 8px; }
.filerow.muted { opacity: .55; }

@media (max-width: 720px) {
  .steprail li { flex: 1 1 45%; }
  .fact-value { max-width: 100%; text-align: left; }
  .factcard-head { flex-direction: column; }
}

/* ============================================================================================
   September review additions. Grouped here so the diff reads as one piece; each block names
   the screen it serves.
   ============================================================================================ */

/* ── Icons ────────────────────────────────────────────────────────────────────────────── */

.ico { display: block; flex: none; }
.ico-wrap { display: grid; place-items: center; }
.navicon .ico { width: 18px; height: 18px; }
.btn .ico { width: 15px; height: 15px; }

/* ── The rail folds to its icons (desktop) ───────────────────────────────────────────── */

.railtoggle {
  align-self: flex-end;
  display: grid; place-items: center;
  width: 30px; height: 30px; margin: 6px 0 10px;
  border: 1px solid var(--rail-line); border-radius: var(--radius);
  background: none; color: var(--rail-ink-3); cursor: pointer;
}
.railtoggle:hover { color: #fff; border-color: rgba(255, 255, 255, .3); }
.navtip { display: none; }

@media (min-width: 941px) {
  .sidebar, .shell { transition: width .18s ease, margin-left .18s ease; }
  html.rail-collapsed { --sidebar-w: 68px; }
  html.rail-collapsed .sidebar { padding: 16px 10px 12px; }
  html.rail-collapsed .crest { justify-content: center; padding: 0 0 14px; }
  html.rail-collapsed .crest-plate { width: 44px; height: 44px; padding: 4px; }
  html.rail-collapsed .crest-fallback { font-size: 14px; }
  html.rail-collapsed .crest-text,
  html.rail-collapsed .navlabel,
  html.rail-collapsed .flags,
  html.rail-collapsed .langswitch,
  html.rail-collapsed .userbtn-text { display: none; }
  html.rail-collapsed .navgroup-label { height: 1px; padding: 0; margin: 4px 10px 6px;
                                        background: var(--rail-line); font-size: 0; }
  html.rail-collapsed .sidenav { overflow: visible; }
  html.rail-collapsed .sidenav a { justify-content: center; padding: 10px 0; position: relative; }
  html.rail-collapsed .navicon { opacity: .9; }
  html.rail-collapsed .navbadge { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px;
                                  font-size: 10px; padding: 0 4px; }
  html.rail-collapsed .railtoggle { align-self: center; }
  html.rail-collapsed .userbtn { justify-content: center; padding: 6px 0; }
  html.rail-collapsed .dropdown { left: 0; right: auto; width: 220px; }
  /* The label travels as a tooltip to the right of the icon. */
  html.rail-collapsed .navtip {
    position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
    padding: 5px 9px; border-radius: var(--radius); white-space: nowrap;
    background: var(--rail-900); color: #fff; font-size: 12.5px; font-weight: 500;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3); pointer-events: none; z-index: 80;
  }
  html.rail-collapsed .sidenav a:hover .navtip,
  html.rail-collapsed .sidenav a:focus-visible .navtip { display: block; }
}
@media (max-width: 940px) { .railtoggle { display: none; } }

/* ── Links that must be seen: "← back" and a document's source ───────────────────────── */

/* These were `.small.muted` — 12px at 60% ink, grey on white, the one link on a screen people
   are looking for. Now the accent colour at reading size, with an arrow that is part of the
   link rather than a character in its text. */
.backlink {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px;
  font-size: 14px; font-weight: 600; color: var(--accent);
}
.backlink .ico { width: 15px; height: 15px; }
.srclink {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap;
}
.srclink .ico { width: 13px; height: 13px; }

/* ── Tooltips ─────────────────────────────────────────────────────────────────────────── */

/* Hover or keyboard focus shows the explanation; touch gets it on tap (focus). Pure CSS, so a
   tooltip costs no script and cannot outlive the element it explains.
   A hidden tip is display: none, not just transparent: an invisible 280px box still counts as
   page width, and one near the right edge made the whole page scroll sideways. @starting-style
   and allow-discrete keep the fade in and out; a browser without them shows and hides at once.
   The centring is `transform` and the rise is `translate`, so an edge-anchored tip can drop
   the centring without restating every state. */
[data-tip] { position: relative; cursor: help; }
button[data-tip], a[data-tip] { cursor: pointer; }
[data-tip]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-tip]::after {
  content: attr(data-tip); display: none;
  position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 90;
  width: max-content; max-width: 280px; padding: 7px 10px;
  transform: translateX(-50%); translate: 0 4px;
  background: var(--rail-800); color: #fff; border-radius: var(--radius);
  font-size: 12px; font-weight: 400; line-height: 1.45; letter-spacing: 0; text-transform: none;
  text-align: left; white-space: normal; box-shadow: 0 6px 18px rgba(11, 26, 51, .25);
  opacity: 0; pointer-events: none;
  transition: opacity .12s ease, translate .12s ease, display .12s allow-discrete;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { display: block; opacity: 1; translate: none; }
@starting-style { [data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 0; translate: 0 4px; } }
@media (hover: none) {
  [data-tip]:focus::after { display: block; opacity: 1; translate: none; }
  @starting-style { [data-tip]:focus::after { opacity: 0; translate: 0 4px; } }
}

/* ── Errors that used to be silent ────────────────────────────────────────────────────── */

.error-state strong { color: var(--danger); }
.error-state .small { max-width: 60ch; margin: 4px auto 0; }

/* ── The opportunity: summary, documents, reader ──────────────────────────────────────── */

/* The summary arrives block by block; each new block rises in once. Nothing types. */
.summary-skel { display: flex; flex-direction: column; gap: 9px; padding: 4px 0 14px; }
.summary-skel .skel { height: 11px; }
.skel.w90 { width: 90%; } .skel.w80 { width: 80%; } .skel.w70 { width: 70%; }
.fresh { animation: rise-in .38s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes rise-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fresh { animation: none; } }

.filerow-actions { display: flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap;
                   justify-content: flex-end; }
@media (max-width: 720px) { .filerow { flex-wrap: wrap; } .filerow-actions { width: 100%; justify-content: flex-start; } }
.reader-frame { flex: 1; width: 100%; border: 0; background: var(--surface-2); }

/* Other topics of the same call: title and what it is about first, the figures beside it. */
.topiclist { display: flex; flex-direction: column; margin-top: 10px; }
.topicrow {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 280px); gap: 18px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.topicrow-head { display: flex; flex-direction: column; gap: 2px; }
.topicrow-title { font-weight: 600; color: var(--ink); }
a.topicrow-title { color: var(--accent); }
.topicrow-about { margin: 6px 0 0; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.topicrow-facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; font-size: 12.5px; }
.topicrow-facts dt { color: var(--ink-3); }
.topicrow-facts dd { margin: 0; }
@media (max-width: 720px) { .topicrow { grid-template-columns: 1fr; gap: 8px; } }

/* ── Our position: a labelled control, not a row of filter pills ─────────────────────── */

.position {
  margin: 0 0 16px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.position-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.position-label { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.position-note { font-size: 12.5px; color: var(--ink-2); flex: 1; min-width: 200px; }
.iconbtn.small-icon { width: 28px; height: 28px; }
.segmented {
  position: relative; display: flex; flex-wrap: wrap; gap: 0;
  border: 1px solid var(--border-input); border-radius: var(--radius); overflow: visible;
  width: fit-content; max-width: 100%;
}
/* The buttons run to the page edge and wrap onto several rows on a phone, so a tip centred on
   its button would hang off the screen. Their tips hang from the control instead: the first
   four from its left edge, the last four from its right. */
.segmented button[data-tip] { position: static; }
.segmented button[data-tip]::after { left: 0; transform: none; }
.segmented button[data-tip]:nth-last-child(-n+4)::after { left: auto; right: 0; }
.segmented button {
  padding: 7px 12px; border: 0; border-right: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13px; cursor: pointer;
}
.segmented button:last-child { border-right: 0; }
.segmented button:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.segmented button.on { background: var(--accent); color: #fff; font-weight: 600; }
.segmented button:disabled { cursor: default; }
.segmented button:disabled:not(.on) { color: var(--ink-3); }

/* ── Eligibility: the call's own words ────────────────────────────────────────────────── */

.req.no-anim { transition: none; }
.excerpt {
  display: flex; flex-direction: column; gap: 8px; margin-top: 8px;
  padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.excerpt.none { color: var(--ink-2); font-size: 13px; }
.excerpt-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--ink-2); }
.excerpt-match {
  padding: 1px 7px; border-radius: var(--radius); border: 1px solid var(--line-strong);
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.excerpt-match.verbatim { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.excerpt-match.closest { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.excerpt-where { font-weight: 600; color: var(--ink); }
.excerpt-cite { color: var(--ink-2); }
.excerpt-cite::before { content: '· '; }
.excerpt-text {
  margin: 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--accent-line);
  font-size: 13.5px; line-height: 1.6; color: var(--ink); max-width: 95ch;
}
.excerpt-text mark { background: #FFF1B8; color: inherit; padding: 0 1px; border-radius: 2px; }
.excerpt-ctx { color: var(--ink-2); }
.excerpt-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.gaplist { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.gap { padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.gap:first-child { padding-top: 0; border-top: 0; }
.gap-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Proposals ────────────────────────────────────────────────────────────────────────── */

.inline-field { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.linker { display: flex; align-items: center; justify-content: space-between; gap: 12px;
          flex-wrap: wrap; width: 100%; margin-top: 8px; }
.picklist { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; margin-top: 8px; }
.pickrow {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); font: inherit; font-size: 13px; cursor: pointer;
}
.pickrow:hover { border-color: var(--accent-line); }
.pickrow.on { border-color: var(--accent); background: var(--accent-soft); }
.pickrow-title { font-weight: 600; color: var(--ink); }
.agent-title { display: inline-flex; align-items: center; gap: 8px; }
.avatar.agent-avatar { background: var(--rail-800); }
.avatar.system-avatar { background: var(--bg-2); color: var(--ink-3); }
.gen-notice .ico { width: 16px; height: 16px; color: var(--accent); }

/* ── Start screen: "Prepara una proposta" ─────────────────────────────────────────────── */

.start-call { display: flex; flex-direction: column; gap: 3px; }
.start-call-title { font-weight: 600; font-size: 15px; color: var(--ink); line-height: 1.35; }
.start-call-actions { gap: 12px; margin-top: 10px; flex-wrap: wrap; justify-content: space-between; }
.projpicks { display: flex; flex-direction: column; gap: 6px; }
.projpick {
  display: flex; align-items: flex-start; gap: 10px; margin: 0;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; font-weight: 400;
}
.projpick:hover { border-color: var(--accent-line); }
.projpick.on { border-color: var(--accent); background: var(--accent-soft); }
.projpick input { width: auto; margin: 3px 0 0; flex: none; }
.projpick-body { flex: 1; min-width: 0; }
.projpick-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.projpick-title { font-weight: 600; color: var(--ink); }
.projpick-head > :not(.projpick-title) { flex: none; white-space: nowrap; }
.projpick-title { min-width: 0; }
.warn-text { color: var(--warn); }
.start-submit { width: 100%; justify-content: center; margin: 4px 0 6px; }
.start-reason { font-size: 12.5px; color: var(--ink-2); text-align: center; }
.start-kv { margin: 0; }
.start-kv dd { line-height: 1.45; }
.ok-text { color: var(--ok); font-weight: 600; }
/* The phone keeps the main action under the thumb: a bar fixed to the bottom of the screen,
   the same button and reason as the summary card, which hides its own copy at this width. */
.start-bar { display: none; }
@media (max-width: 720px) {
  .start { padding-bottom: 96px; }
  .start-submit-wide { display: none; }
  .start-bar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line-strong);
  }
  .start-bar .start-submit { margin: 0 0 4px; }
}
.start-profile-line { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.start-needs { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }

/* ── First login (design b1) ──────────────────────────────────────────────────────────── */

.welcome-hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  margin-bottom: 16px; overflow: hidden;
}
.welcome-main { padding: 26px 28px 28px; display: grid; gap: 12px; align-content: start; }
.welcome-main .pill { justify-self: start; }
.welcome-main h2 { font-size: 24px; letter-spacing: -.015em; color: var(--ink); }
.welcome-main p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); max-width: 54ch; }
.welcome-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 4px; }
.welcome-cta { padding: 9px 18px; font-size: 14px; }
.welcome-steps {
  margin: 0; padding: 26px 28px; list-style: none; display: grid; gap: 18px; align-content: center;
  background: var(--surface-2); border-left: 1px solid var(--line);
}
.welcome-steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; }
.welcome-steps b {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line-strong); font-size: 13px; color: var(--ink-2);
}
.welcome-steps li:first-child b { background: var(--accent); border-color: var(--accent); color: #fff; }
.welcome-steps strong { display: block; font-size: 14px; }
.welcome-steps strong .welcome-live { display: inline; }
.welcome-steps span { font-size: 12.5px; color: var(--ink-3); }
.welcome-live { font-weight: 700; color: var(--ink); }
.welcome-now { margin-bottom: 14px; }
.welcome-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gap); }
.welcome-after { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
@media (max-width: 1180px) { .welcome-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .welcome-hero { grid-template-columns: 1fr; }
  .welcome-steps { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .welcome-main, .welcome-steps { padding: 18px 16px; }
  .welcome-main h2 { font-size: 20px; }
  .welcome-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── New project (design c1) ──────────────────────────────────────────────────────────── */

/* The steps, the strength card and "what happens" sit left of the form on a wide screen and
   follow it on a phone, where the step list turns into one row that scrolls sideways. */
.np-grid {
  display: grid; gap: 12px var(--gap); align-items: start;
  grid-template-columns: 250px minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  grid-template-areas: "steps main" "strength main" "next main";
}
.np-stepcard { grid-area: steps; }
.np-main { grid-area: main; scroll-margin-top: 64px; }
.np-strengthcard { grid-area: strength; }
.np-nextcard { grid-area: next; }

.np-steps { margin: 0; padding: 6px; list-style: none; display: grid; gap: 2px; }
.np-steps button, .np-steps .np-stepitem {
  width: 100%; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: center;
  padding: 9px 10px; border: 0; border-left: 3px solid transparent; border-radius: var(--radius);
  background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
}
.np-steps button:hover { background: var(--surface-2); }
.np-steps .np-stepitem { cursor: default; }
.np-n {
  width: 22px; height: 22px; border-radius: var(--radius); border: 1.5px solid var(--border-strong);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: var(--ink-3);
  background: var(--surface);
}
.np-steps li.done .np-n { background: var(--ok); border-color: var(--ok); color: #fff; }
.np-steps li.skipped .np-n { border-style: dashed; }
.np-steps li.on button, .np-steps li.on .np-stepitem { background: var(--accent-soft); border-left-color: var(--accent); }
.np-steps li.on .np-n { background: var(--accent); border-color: var(--accent); color: #fff; }
.np-l { font-size: 13px; font-weight: 600; line-height: 1.25; }
.np-o { display: block; font-size: 11px; font-weight: 400; color: var(--ink-3); }

.np-main > header { background: var(--surface-2); flex-wrap: wrap; }
.np-main > header h2 { font-size: 15px; color: var(--ink); }
.np-body { padding: 18px 18px 6px; min-height: 360px; }
.np-why { font-size: 12.5px; color: var(--ink-3); margin: 0 0 14px; max-width: 70ch; }
.np-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2);
}
.np-push { margin-left: auto; }
.np-reason { padding: 0 16px 12px; font-size: 12.5px; color: var(--ink-2); text-align: right; background: var(--surface-2); }

/* A list typed as chips (keywords, topics, areas): chosen values, the input, one-click offers. */
.np-tags { display: grid; gap: 8px; }
.np-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.np-chips:empty { display: none; }
.np-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--line-strong); font: inherit; font-size: 12.5px; color: var(--ink);
}
.np-chip button { border: 0; background: none; padding: 0 2px; color: var(--ink-3); cursor: pointer; font-size: 15px; line-height: 1; }
.np-chip button:hover { color: var(--danger); }
.np-toggle { cursor: pointer; background: var(--surface); }
.np-toggle:hover { border-color: var(--accent-line); color: var(--accent); }
.np-toggle.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); font-weight: 600; }

.np-euro { position: relative; }
.np-euro input { padding-left: 26px; }
.np-euro::before {
  content: "€"; position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--ink-3); pointer-events: none;
}
.np-gap {
  display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; margin-bottom: 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px;
}
.np-gap b { font-variant-numeric: tabular-nums; }
.np-files { margin-top: 10px; }
.np-files .filerow.np-gone .name { text-decoration: line-through; color: var(--ink-3); }

/* Place: a search over the official places, picked ones as chips above it. */
.np-combo { position: relative; }
.np-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20;
  display: grid; padding: 4px; max-height: 320px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(15, 18, 26, .12);
}
.np-result {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline;
  padding: 7px 10px; border: 0; border-radius: var(--radius); background: none; font: inherit;
  color: var(--ink); text-align: left; cursor: pointer;
}
.np-result.on, .np-result:hover { background: var(--accent-soft); }
.np-result-name { font-size: 13px; font-weight: 600; }
.np-result-meta { grid-column: 1; font-size: 12px; color: var(--ink-3); }
.np-result-code { grid-column: 2; grid-row: 1; font-size: 11.5px; color: var(--ink-3); }
.np-result.np-add { border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.np-result.np-add .np-result-name { color: var(--accent); }
.np-chip.np-custom { border-style: dashed; background: var(--surface); }
.np-warn { color: var(--warn); margin: -4px 0 12px; }

/* The Edit dialog: the same sections as tabs, with the strength card beside them. */
.modal.np-modal { max-width: 960px; display: flex; flex-direction: column; overflow: hidden; }
.modal.np-modal > .body { flex: 1; min-height: 0; overflow-y: auto; }
.np-edit-note { margin-bottom: 14px; }
.np-edit { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.np-edit-side { display: flex; flex-direction: column; gap: 12px; }
.np-edit-main { min-height: 440px; }
.np-filetype { width: 190px; flex: none; }

.np-review-row {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 12px; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.np-review-row > span:nth-child(2) { overflow-wrap: anywhere; }
.np-review-k { color: var(--ink-3); }
.np-review-miss { color: var(--ink-3); font-style: italic; }
.np-review-note { margin: 12px 0; }

/* Profile strength: four free checks, no AI. */
.np-strength { display: grid; gap: 8px; }
.np-strength-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.np-strength-head strong { font-size: 13px; }
.np-strength-level { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.np-strength-level.weak { color: var(--danger); }
.np-strength-level.fair { color: var(--warn); }
.np-strength-level.strong { color: var(--ok); }
.np-strength-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.np-strength-bar i { height: 6px; border-radius: 2px; background: var(--surface-2); border: 1px solid var(--line-strong); }
.np-strength-bar.weak i.on { background: var(--danger); border-color: var(--danger); }
.np-strength-bar.fair i.on { background: var(--warn); border-color: var(--warn); }
.np-strength-bar.strong i.on { background: var(--ok); border-color: var(--ok); }
.np-strength-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; font-size: 12.5px; }
.np-strength-list li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 7px; color: var(--ink-3); }
.np-strength-list li::before {
  content: ""; width: 12px; height: 12px; margin-top: 2px; border-radius: 2px; border: 1.5px solid var(--border-strong);
}
.np-strength-list li.ok { color: var(--ink); }
.np-strength-list li.ok::before { content: "✓"; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; background: var(--ok); border-color: var(--ok); }
.np-strength-note { font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: 8px; }
.np-next { display: grid; gap: 6px; font-size: 12.5px; color: var(--ink-2); }

@media (max-width: 940px) {
  .np-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none;
             grid-template-areas: "steps" "main" "strength" "next"; }
  .np-steps { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .np-steps button, .np-steps .np-stepitem { border-left: 0; border-bottom: 3px solid transparent; }
  .np-steps li.on button, .np-steps li.on .np-stepitem { border-bottom-color: var(--accent); }
  .np-o { display: none; }
}
@media (max-width: 940px) {
  .np-edit { grid-template-columns: minmax(0, 1fr); }
  .np-edit-side .np-strengthcard { display: none; }
  .np-edit-main { min-height: 0; }
}
@media (max-width: 720px) {
  .np-body { padding: 14px 14px 4px; min-height: 0; }
  .np-review-row { grid-template-columns: minmax(0, 1fr) auto; }
  .np-review-row > span:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .np-filetype { width: 100%; }
  .np-files .filerow { flex-wrap: wrap; }
}

/* ── Comune profile ───────────────────────────────────────────────────────────────────── */

.pfilters { margin: 4px 0 12px; }
.orgprofile .pfilters .segmented button.on:hover { background: var(--accent); color: #fff; }
.pfact {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.pfact:last-child { border-bottom: 0; }
.pfact.focus { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.pfact-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pfact-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pfact-label { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.pfact-value { font-size: 14px; color: var(--ink); white-space: pre-line; word-break: break-word; }
.pfact-source { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--ink-2); }
.pfact-kind { font-weight: 600; color: var(--ink-2); }
.pfact-more summary { cursor: pointer; font-size: 12px; color: var(--ink-2); }
.pfact-more .excerpt-text { margin-top: 6px; font-size: 13px; }
.pfact-conflicts { margin: 6px 0 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.pfact-actions { display: flex; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.pfact-edit { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.pfact-edit .field { margin: 0; }
.pneeds-list { display: flex; flex-direction: column; }
.pneed { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.pneed-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pneed-label { font-weight: 600; font-size: 13.5px; }
@media (max-width: 720px) {
  .orgprofile .pfilters .segmented {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; overflow: hidden;
  }
  .orgprofile .pfilters .segmented button { min-height: 40px; border: 0; }
  .orgprofile .pfilters .segmented button:nth-child(odd) { border-right: 1px solid var(--line-strong); }
  .orgprofile .pfilters .segmented button:nth-child(-n+2) { border-bottom: 1px solid var(--line-strong); }
  .orgprofile .pfilters .segmented button:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }
  .orgprofile .pfilters .segmented button:focus-visible { outline: 2px solid currentColor; outline-offset: -4px; }
  .pfact { flex-direction: column; gap: 8px; padding: 12px; }
  /* The column's align-items: flex-start would size the text block to its content, and a
     one-line (nowrap) value then widened it past the screen: stretch it across the row. */
  .pfact-main { align-self: stretch; }
  .pfact-actions { justify-content: flex-start; }
  .pneed { flex-direction: column; gap: 6px; }
}

/* Profile polish: values an officer reads at a glance. */
.pfact-items { margin: 2px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.pfact-items li + li { margin-top: 2px; }
.pfact-period { font-size: 12px; color: var(--ink-3); }
.btn.link.pfact-toggle { padding: 0; margin-top: 2px; font-size: 12.5px; }
.pfold {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 16px;
  border: 0; border-top: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left;
}
.pfold:hover { color: var(--ink); }
.pfold-caret { width: 10px; }
.psection { font-size: 15px; margin: 22px 0 8px; }
.orgprofile .kv { margin: 0; }

/* ── The consortium builder (views/consortium.js) ─────────────────────────────────────── */
/* A consortium member: name and details first; the status and Remove wrap below on a narrow screen. */
.filerow.member { flex-wrap: wrap; }
.filerow.member .meta { flex: 1 1 220px; }
.filerow.member .name { white-space: normal; }
.card > header h2 .count { color: var(--ink-3); font-weight: 400; }

/* Suggested partners (consortium.js): one button in the AI ring until it is clicked, a moment over
   the steps the ranking stands on, then two tabs across the card's header: Suggested partners (its
   title in the ring of the project form's "Suggest codes") and Partner network. */
.ai-badge .ico { display: block; }
.suggest-head { padding: 0 16px; min-width: 0; }
.suggest-tabs { display: flex; align-self: stretch; gap: 18px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.suggest-tab { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 12px 2px; border: 0;
  border-bottom: 2px solid transparent; background: none; font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--ink-2); white-space: nowrap; cursor: pointer; }
.suggest-tab:hover { color: var(--ink); }
.suggest-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.suggest-tab .ai-badge { padding: 2px 12px 2px 9px; font-size: 13px; font-weight: 600; color: var(--ink); }
.suggest-tab-icon { display: inline-flex; color: var(--accent); }
.suggest-tab .count { font-family: var(--mono); font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.suggest-note { margin: 16px 16px 0; }

.sugg-start { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 56px 16px 60px; text-align: center; }
.sugg-start h3 { margin: 4px 0 0; font-size: 18px; font-weight: 600; text-wrap: balance; }
.sugg-start p { margin: 0; max-width: 58ch; font-size: 13.5px; color: var(--ink-2); }
/* The ring of .btn-ai around a circle: the mark of a model at work. */
.sugg-orb { display: inline-grid; place-items: center; flex: none; width: 64px; height: 64px; border: 2px solid transparent;
  border-radius: 50%; color: var(--accent);
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              linear-gradient(110deg, #3db3c9 0%, #3fa9e6 40%, #5fcf8a 75%, #e8c93a 100%) border-box; }
.btn-ai.sugg-go { margin-top: 8px; padding: 10px 24px 10px 18px; font-size: 15px; }

.sugg-think { display: flex; flex-direction: column; gap: 14px; max-width: 520px; margin: 0 auto; padding: 40px 16px 20px; }
.sugg-think-head { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.sugg-think-head .sugg-orb { width: 34px; height: 34px; }
.sugg-think-head .sugg-orb .ico { animation: ai-pulse 1s ease-in-out infinite; }
.sugg-progress { height: 4px; overflow: hidden; border-radius: 2px; background: var(--bg-2); }
.sugg-progress i { display: block; width: 0; height: 100%; transition: width .35s ease;
  background: linear-gradient(110deg, #3db3c9 0%, #3fa9e6 40%, #5fcf8a 75%, #e8c93a 100%); }
.sugg-steps { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.sugg-steps li { display: flex; align-items: baseline; gap: 10px; color: var(--ink-3); transition: color .2s; }
.sugg-steps .tk { flex: none; width: 14px; text-align: center; font-weight: 700; }
.sugg-steps li.run { color: var(--ink); }
.sugg-steps li.run .tk::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); animation: ai-pulse 1s infinite; }
.sugg-steps li.done { color: var(--ink-2); }
.sugg-steps li.done .tk { color: var(--ok); }
.sugg-steps li.done .tk::before { content: '✓'; }
.sugg-skeleton { display: grid; gap: 8px; padding: 6px 16px 22px; }
.sugg-skeleton div { height: 58px; border: 1px dashed var(--line-strong); border-radius: var(--radius);
  background: linear-gradient(90deg, transparent 0%, var(--bg-2) 50%, transparent 100%) 0 0 / 200% 100%;
  animation: sugg-shimmer 1.3s linear infinite; }
@keyframes sugg-shimmer { to { background-position: -200% 0; } }
@keyframes sugg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* The banner over a scored call's list (eu_orgs.js): the AI ring as a hairline, a headline, four
   facts that are each a shortcut to their filter, and the mix of the 25 at the top. */
.sugg-insight { margin: 16px 16px 0; padding: 14px 16px 12px; border: 1.5px solid transparent; border-radius: var(--radius);
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              linear-gradient(110deg, #3db3c9 0%, #3fa9e6 40%, #5fcf8a 75%, #e8c93a 100%) border-box;
  animation: sugg-in .5s ease both; }
.sugg-insight-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.sugg-insight-kicker .ico { display: block; }
.sugg-insight h3 { margin: 4px 0 12px; max-width: 100ch; font-size: 15.5px; font-weight: 600; line-height: 1.45; }
.sugg-insight h3 em { font-style: normal; color: var(--accent); }
.sugg-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sugg-fact { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  transition: border-color .15s, background .15s; }
.sugg-fact:hover { border-color: var(--accent-line); background: var(--brand-soft); }
.sugg-fact.on { border-color: var(--accent); background: var(--brand-soft); }
.sugg-fact .n { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sugg-fact .l { font-size: 12px; color: var(--ink-2); }
.sugg-fact .b { font-size: 11.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.sugg-fact .act { margin-top: 2px; font-size: 11px; font-weight: 600; color: var(--accent); }
.sugg-mix { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 11px; font-size: 12.5px; color: var(--ink-2); }
.sugg-mix b { font-weight: 600; color: var(--ink); }
.sugg-mix-bar { display: flex; width: 180px; height: 8px; overflow: hidden; border-radius: 2px; background: var(--bg-2); }
.sugg-mix-bar i, .sugg-mix-key i { display: inline-block; height: 100%; }
.sugg-mix-key { display: inline-flex; align-items: center; gap: 5px; }
.sugg-mix-key i { width: 8px; height: 8px; border-radius: 2px; }
@media (max-width: 900px) { .sugg-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* The list's controls on one bar: the search, then "Show only", "Filter or sort by" and the filters
   on, their names in one column so the switches and the column menus read as one set. */
.eu-controls { display: grid; grid-template-columns: 124px minmax(0, 1fr); align-items: center; gap: 10px 12px;
  margin: 14px 16px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.eu-controls .eu-toolbar-top { grid-column: 1 / -1; }
.eu-controls .eu-toolbar-top input[type=search] { flex: 1 1 240px; min-width: 0; }
.eu-controls-label { align-self: start; padding-top: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.eu-controls .fswitches, .eu-controls .eu-chips { min-width: 0; }
.eu-rank-note { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 10px 16px 8px;
  font-size: 12.5px; color: var(--ink-3); }
.eu-rank-note .btn.link { padding: 0; }
.eu-suggest .eu-suggestions { padding: 0 16px; }
.eu-suggest .eu-suggestions.is-busy::before { left: 16px; }
.eu-more { padding: 18px 16px 22px; }
.eu-more .eu-pager { flex-direction: column; justify-content: center; gap: 8px; margin: 0; }
.eu-more-icon { display: inline-flex; color: var(--accent); }

/* An organisation's fit rank (eu_orgs.js rankBadge): its place in the call's default list, the same
   whatever the sort or filters. The top 25 in the accent's tint; a dashed dash when it has none. */
.org-rank { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 22px; padding: 0 5px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface);
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.org-rank.top { border-color: var(--accent-line); background: var(--brand-soft); color: var(--accent); font-weight: 500; }
.org-rank.none { border-style: dashed; color: var(--ink-3); }

/* A suggested partner (eu_orgs.js): the dashed row of a suggested CPV code, solid and tinted once in
   the consortium. On the left its rank and under it "+" to add it, a red "−" once it is in; who it
   is; and why it is suggested on the right. */
.eu-suggestions { display: grid; gap: 6px; }
.org-sugg {
  display: grid; grid-template-columns: 22px 22px minmax(0, 1fr) auto; gap: 2px 10px; align-items: start;
  padding: 8px 10px; border: 1px dashed var(--line-strong); border-radius: var(--radius); font-size: 13px;
}
.org-sugg.ranked { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 4px 12px; animation: sugg-in .4s ease both; }
.org-sugg-left { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sugg-slot { display: flex; }
.sugg-mark { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.sugg-add, .sugg-remove { padding: 0; border: 1px solid var(--accent-line); border-radius: var(--radius); background: var(--surface);
  font: inherit; font-size: 17px; font-weight: 600; line-height: 1; color: var(--accent); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s; }
.sugg-add:hover { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.sugg-remove { border-color: var(--danger-line); background: var(--danger-bg); color: var(--danger); }
.sugg-remove:hover { border-color: var(--danger); background: var(--danger); color: #fff; }
.sugg-add:disabled, .sugg-remove:disabled { cursor: progress; }
.org-sugg-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.org-sugg-name { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding-top: 1px; }
.org-sugg-name .eu-tags { margin: 0; }
.org-sugg-sub { font-size: 12px; color: var(--ink-3); }
.org-sugg-why { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; padding-top: 3px;
  font-size: 12px; color: var(--ink-2); text-align: right; white-space: nowrap; }
/* Adding or removing: the mark turns into a spinner until the consortium has changed. */
.org-sugg.is-adding .sugg-add, .org-sugg.is-adding .sugg-remove { position: relative; color: transparent; }
/* ::before, as ::after is the button's tooltip. */
.org-sugg.is-adding .sugg-add::before, .org-sugg.is-adding .sugg-remove::before { content: ''; position: absolute; top: 50%;
  left: 50%; width: 10px; height: 10px; margin: -7px 0 0 -7px; border: 2px solid var(--accent-line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite; }
.org-sugg.is-adding .sugg-remove::before { border-color: var(--danger-line); border-top-color: var(--danger); }
/* The column menus open from a bar of their buttons: the suggestions have no header row. */
.eu-sortbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.eu-sortbar .colhead { padding: 3px 8px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); font-size: 12px; color: var(--ink-2); }
.eu-sortbar .colhead:hover { border-color: var(--line-strong); }
.eu-sortbar .colhead.sorted, .eu-sortbar .colhead.filtered { border-color: var(--accent-line); color: var(--accent); }
/* The call's fit leads the bar, tinted and set off from the other columns by a hairline. */
.eu-sortbar .colhead-fit { position: relative; margin-right: 9px; border-color: var(--accent-line); background: var(--brand-soft);
  font-weight: 600; color: var(--accent); }
.eu-sortbar .colhead-fit:hover { border-color: var(--accent); }
.eu-sortbar .colhead-fit + .colhead { position: relative; }
.eu-sortbar .colhead-fit + .colhead::before { content: ''; position: absolute; top: 3px; bottom: 3px; left: -9px;
  border-left: 1px solid var(--line-strong); }
@media (max-width: 640px) {
  .org-sugg { grid-template-columns: 22px minmax(0, 1fr); }
  .org-sugg.ranked { grid-template-columns: 44px minmax(0, 1fr); }
  .org-sugg-why { grid-column: 2; align-items: flex-start; text-align: left; white-space: normal; }
  .eu-controls { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .eu-controls-label { margin-top: 6px; padding-top: 0; }
  .suggest-tabs { gap: 10px; }
  /* One line that scrolls; width 0 + min-width 100% so its length never widens the page. */
  .eu-sortbar { flex-wrap: nowrap; width: 0; min-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .eu-sortbar > * { flex: none; }
}

/* Partner network (partner_network.js): the commune in the middle, its partners around it and their
   partners outside them, as an SVG map that glides to the circle clicked; the lists beside it. */
.pn { display: grid; gap: 12px; padding: 14px 16px 18px; }
.pn-loading { display: grid; place-items: center; gap: 10px; padding: 70px 16px; font-size: 13.5px; color: var(--ink-2); }
.pn-loading .sugg-orb { width: 44px; height: 44px; }
.pn-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; }
.pn-crumbs button { max-width: 240px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font: inherit; font-size: 12.5px; color: var(--ink-2); cursor: pointer; overflow-wrap: anywhere; }
.pn-crumbs button:hover { border-color: var(--accent-line); color: var(--accent); }
.pn-crumbs button.cur { border-color: var(--accent); background: var(--brand-soft); color: var(--accent); font-weight: 600; cursor: default; }
.pn-crumbs .sep { color: var(--ink-3); }
.pn-note { max-width: 100ch; margin: 0; font-size: 13px; color: var(--ink-2); }
.pn-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 14px; }
.pn-stage { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius);
  background: radial-gradient(circle at 50% 50%, var(--brand-soft) 0, transparent 62%), var(--surface); }
.pn-stage svg { display: block; width: 100%; height: auto; }
.pn-edge { stroke: rgba(37, 71, 160, .22); opacity: 0; transition: opacity .5s .25s; }
.pn-edge.main { stroke: var(--accent); stroke-opacity: .55; }
.pn-stage.hovering .pn-edge:not(.hot) { opacity: .25 !important; }
.pn-stage.hovering .pn-edge.hot { stroke: var(--accent); stroke-opacity: 1; }
.pn-node { cursor: pointer; transition: transform .6s cubic-bezier(.2, .8, .2, 1), opacity .4s; }
.pn-node:focus { outline: none; }
.pn-dot { fill: var(--surface); stroke: rgba(15, 18, 26, .35); stroke-width: 1.6; }
.pn-node.won .pn-dot { stroke: var(--ok); }
.pn-node.bridge .pn-dot { stroke-dasharray: 3 2; }
.pn-node.mine .pn-dot { fill: var(--brand-soft); stroke: var(--accent); }
.pn-node.focus .pn-dot { stroke: var(--accent); stroke-width: 3; }
.pn-node.in .pn-dot, .pn-node.you .pn-dot { fill: var(--accent); stroke: var(--accent); }
.pn-node.you .pn-dot { stroke-width: 3; }
.pn-node:hover .pn-dot, .pn-node:focus-visible .pn-dot { stroke-width: 3; }
.pn-node text { font-family: var(--font); font-size: 11px; fill: var(--ink); paint-order: stroke; stroke: var(--surface);
  stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.pn-node text.strong { font-weight: 600; }
.pn-node text.pn-rank { font-family: var(--mono); font-size: 9.5px; fill: var(--accent); }
.pn-node text.pn-rank.none { fill: var(--ink-3); }
.pn-node text.pn-in { fill: #fff; stroke: none; font-size: 11px; font-weight: 700; }
.pn-tip { position: absolute; z-index: 5; display: flex; flex-direction: column; gap: 1px; max-width: 260px; padding: 7px 10px;
  border-radius: var(--radius); background: var(--ink); color: #fff; font-size: 12px; line-height: 1.4; pointer-events: none;
  box-shadow: 0 8px 28px rgba(15, 18, 26, .16); }
.pn-tip span { font-size: 11.5px; color: var(--rail-ink-2); }
.pn-tip .pn-tip-hint { color: #9fb6ef; }
.pn-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 12px; border-top: 1px solid var(--line);
  background: var(--surface); font-size: 11.5px; color: var(--ink-2); }
.pn-legend span { display: inline-flex; align-items: center; gap: 5px; }
.pn-legend i { display: inline-block; width: 10px; height: 10px; border: 1.5px solid var(--ink-3); border-radius: 50%; background: var(--surface); }
.pn-legend i.mine { border-color: var(--accent); background: var(--brand-soft); }
.pn-legend i.in { border-color: var(--accent); background: var(--accent); }
.pn-legend i.won { border-color: var(--ok); }
.pn-legend i.bridge { border-style: dashed; border-color: var(--accent); }
.pn-legend-rank { font-family: var(--mono); font-weight: 500; color: var(--accent); }
.pn-side { display: grid; max-height: 640px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.pn-side section { padding: 12px 14px; border-top: 1px solid var(--line); }
.pn-side section:first-child { border-top: 0; }
.pn-side h4 { display: flex; justify-content: space-between; margin: 0 0 8px; font-size: 10.5px; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-3); }
.pn-lede { margin: -2px 0 10px; font-size: 12.5px; color: var(--ink-2); }
.pn-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 7px 0;
  border-top: 1px solid var(--line); }
.pn-item:first-of-type { border-top: 0; }
.pn-item .org-rank { min-width: 0; width: 100%; }
.pn-item-main { min-width: 0; }
.pn-go { display: block; max-width: 100%; padding: 0; border: 0; background: none; font: inherit; font-size: 13px;
  font-weight: 600; color: var(--accent); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.pn-go:hover { text-decoration: underline; }
.pn-item-sub { font-size: 11.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.pn-focus .pn-item-sub { margin: 3px 0 8px; font-size: 12.5px; white-space: normal; }
.pn-focus-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.pn-focus-tags .eu-tags { margin: 0; }
.pn-focus-name { display: block; margin-top: 8px; padding: 0; border: 0; background: none; font: inherit; font-size: 15px;
  font-weight: 600; line-height: 1.35; color: var(--accent); text-align: left; cursor: pointer; }
.pn-focus-name:hover { text-decoration: underline; }
.pn-focus-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pn-path { margin-top: 10px; padding: 8px 10px; border-radius: var(--radius); background: var(--bg-2); font-size: 12.5px; color: var(--ink-2); }
/* Add or take out, one button: "+ Add", then "✓ Added", which says "× Remove" under the pointer. */
.pn-toggle { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 92px; height: 28px;
  padding: 0 10px; border: 1px solid var(--accent-line); border-radius: var(--radius); background: var(--surface);
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--accent); white-space: nowrap; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s; }
.pn-toggle.small { min-width: 0; height: 24px; padding: 0 8px; font-size: 12px; }
.pn-toggle:hover { border-color: var(--accent); background: var(--accent); color: #fff; }
.pn-toggle .alt { display: none; }
.pn-toggle.in { border-color: var(--accent-line); background: var(--brand-soft); color: var(--accent); }
.pn-toggle.in:hover, .pn-toggle.in:focus-visible { border-color: var(--danger-line); background: var(--danger-bg); color: var(--danger); }
.pn-toggle.in:hover .main, .pn-toggle.in:focus-visible .main { display: none; }
.pn-toggle.in:hover .alt, .pn-toggle.in:focus-visible .alt { display: inline; }
.pn-toggle.busy { color: transparent; pointer-events: none; }
.pn-toggle.busy::before { content: ''; position: absolute; width: 12px; height: 12px; border: 2px solid var(--accent-line);
  border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@media (max-width: 1000px) { .pn-grid { grid-template-columns: minmax(0, 1fr); } .pn-side { max-height: none; } }
@media (prefers-reduced-motion: reduce) {
  .sugg-insight, .org-sugg.ranked, .pn-node, .pn-edge, .sugg-skeleton div, .sugg-steps li.run .tk::before,
  .sugg-think-head .sugg-orb .ico { animation: none; transition: none; }
}

/* On/off filters (ui.js filterSwitch): small chips in a row, a switch in each. On, the chip takes the
   accent's tint, so which filters shape the list reads at a glance. */
.fswitches { display: flex; flex-wrap: wrap; gap: 6px; }
.fswitch {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px 0 8px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.fswitch:hover { border-color: var(--ink-3); color: var(--ink); }
.fswitch[aria-checked=true] { border-color: var(--accent-line); background: var(--brand-soft); color: var(--accent); }
.fswitch[aria-checked=true]:hover { border-color: var(--accent); }
.fswitch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fswitch-track { position: relative; flex: none; width: 24px; height: 14px; border: 1px solid var(--border-input);
  border-radius: 7px; background: var(--surface-2); transition: background .15s, border-color .15s; }
.fswitch-thumb { position: absolute; top: 2px; left: 2px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-3); transition: transform .15s, background .15s; }
.fswitch[aria-checked=true] .fswitch-track { border-color: var(--accent); background: var(--accent); }
.fswitch[aria-checked=true] .fswitch-thumb { transform: translateX(10px); background: #fff; }
@media (prefers-reduced-motion: reduce) { .fswitch, .fswitch-track, .fswitch-thumb { transition: none; } }

/* A block refreshing in place (ui.js busy): what is there stays, faded and still, and a short bar
   runs along its top, so a filter change or an Add never blanks the list or moves the page. */
.is-busy { position: relative; }
.is-busy > * { opacity: .5; pointer-events: none; transition: opacity .15s ease; }
.is-busy::before { content: ''; position: absolute; z-index: 2; top: -1px; left: 0; width: 30%; height: 2px;
  background: var(--accent); animation: busy-run 1.1s ease-in-out infinite; }
@keyframes busy-run { from { left: 0; width: 10%; } 50% { width: 35%; } to { left: 90%; width: 10%; } }
@media (prefers-reduced-motion: reduce) { .is-busy::before { animation: none; width: 100%; opacity: .5; } }

/* EU participants (views/eu_orgs.js): a name opens the profile; tags under it; the full list
   and its pages; the profile modal, wider than a form. */
.btn.link.eu-name { padding: 0; font-weight: 600; text-align: left; white-space: normal; }
.eu-tags { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin: 3px 0 1px; }
.eu-tags:empty { display: none; }
.eu-site { display: inline-flex; color: var(--ink-3); }
.eu-site:hover { color: var(--accent); }
.eu-list { scroll-margin-top: 64px; }
.eu-list td:first-child { min-width: 240px; }
.eu-pager { justify-content: flex-end; margin-top: 12px; }
/* The full list (eu_orgs.js): a toolbar (name search, the call's scope, the count, the active
   filters as chips and, at phone width, the column buttons), then a table whose every header
   opens that column's menu, as in a spreadsheet. */
/* nowrap: in a wrapping column the rows are measured before they stretch, and a grid of tiles
   reserves the height of its narrowest layout. */
.filters.eu-toolbar { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 10px; }
.eu-toolbar-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.filters .eu-toolbar-top input[type=search] { flex: 1 1 240px; min-width: 0; }
.eu-resultbar { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.eu-count { font-size: 13px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.eu-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.eu-chips:empty { display: none; }
.eu-chip { display: inline-flex; align-items: center; border: 1px solid var(--accent); border-radius: 999px;
  background: var(--surface); overflow: hidden; }
.eu-chip button { background: none; border: 0; font: inherit; font-size: 12.5px; color: var(--accent); cursor: pointer; }
.eu-chip-text { padding: 4px 4px 4px 11px; text-align: left; }
.eu-chip-x { padding: 2px 10px 4px 6px; font-size: 16px; line-height: 1; }
.eu-chip button:hover { text-decoration: underline; }
.eu-colbar { display: none; }
.eu-colbar-label { width: 100%; font-size: 12px; color: var(--ink-3); }
@media (max-width: 720px) {
  .eu-colbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .eu-resultbar { width: 100%; margin-left: 0; justify-content: space-between; }
}

/* A column header is one button: its name, the sort arrow when it sorts the list, and a funnel
   that is faint until hovered and solid while the column is filtered. */
.colhead {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 0; margin: 0;
  background: none; border: 0; font: inherit; text-transform: inherit; letter-spacing: inherit;
  color: var(--ink-3); cursor: pointer;
}
.colhead:hover, .colhead[aria-expanded=true] { color: var(--ink); }
.colhead-icon { display: inline-flex; opacity: .35; }
.colhead:hover .colhead-icon, .colhead[aria-expanded=true] .colhead-icon { opacity: .8; }
.colhead.sorted { color: var(--accent); }
.colhead.filtered .colhead-icon { opacity: 1; color: var(--accent); }
.colhead-sort { font-size: 11px; }
th.num .colhead { justify-content: flex-end; }
/* Numbers and dates stay on one line; names, types, countries and headers wrap, so every column
   fits a laptop screen without a sideways scroll. */
.eu-table td.num, .eu-table td.tight { white-space: nowrap; }
.eu-list .eu-table td:first-child { min-width: 200px; }
.eu-table .colhead { white-space: normal; text-align: left; }
.eu-table th.num .colhead { text-align: right; }
/* When the columns do not fit (a laptop with the sidebar open), the table scrolls sideways inside
   its card with the organisation's name pinned on the left and Add on the right, as frozen panes
   in a spreadsheet. Sideways only: the wrap is the scroll container (see thead th above). */
@media (min-width: 721px) {
  .eu-table tr > :first-child, .eu-table tr > :last-child { position: sticky; z-index: 1; background: var(--surface); }
  .eu-table thead tr > :first-child, .eu-table thead tr > :last-child { background: var(--surface-2); }
  .eu-table tr > :first-child { left: 0; box-shadow: inset -1px 0 0 var(--line); }
  .eu-table tr > :last-child { right: 0; box-shadow: inset 1px 0 0 var(--line); }
}

/* The column menu: the feed's popover, fixed to the screen under its header. */
.pop.colmenu { position: fixed; z-index: 80; overflow-y: auto; }
.colmenu h4 { margin: 0; }
.colmenu-sort { margin: 6px 0 14px; }
.colmenu .field { margin: 8px 0 0; }
.colmenu-bulk { gap: 14px; margin-top: 6px; }
.colmenu-list {
  display: flex; flex-direction: column; gap: 1px; max-height: 240px; overflow-y: auto;
  margin-top: 6px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius);
}
.colmenu-list.short { max-height: none; }
.colmenu-check {
  display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 5px 6px; border-radius: 4px;
  font-size: 13px; font-weight: 400; cursor: pointer;
}
.colmenu-check:hover { background: var(--surface-2); }
.colmenu-check input { flex: none; width: auto; margin: 2px 0 0; }
.colmenu-value { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.colmenu-help { font-size: 11.5px; color: var(--ink-3); }
.colmenu-count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
/* The organisation profile (eu_orgs.js openProfile): who it is and a one-paragraph summary on
   top, then Overview / Recent projects / Works most with as tabs, so nothing is a long scroll.
   Header and footer stay put; only the middle scrolls, so Add is always in reach. */
.modal.eu-profile { max-width: 780px; display: flex; flex-direction: column; overflow: hidden; }
.modal.eu-profile > .body { flex: 1; min-height: 0; overflow-y: auto; padding-top: 14px; }
.modal.eu-profile > header h2 { font-size: 17px; line-height: 1.3; }
.eu-profile-top { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.eu-profile-sub { margin: 0; font-size: 13px; color: var(--ink-3); }
.eu-profile-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; }
.eu-profile-badges .eu-tags { margin: 0; }
.eu-profile-badges a { display: inline-flex; align-items: center; gap: 4px; }
.eu-summary { margin: 2px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); max-width: 66ch; }
.eu-profile-fit { margin: 0; }
/* The partner page's EU record (eu_orgs.js euRecordCard): the figures and the summary, full width
   above the catalogue card, so a partner's track record is the first thing seen. */
.card.eu-record-card { margin-bottom: 14px; }
.eu-record-body { display: flex; flex-direction: column; gap: 12px; }
.eu-record-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.eu-record-line .eu-tags { margin: 0; }
.eu-record-line .eu-summary { margin: 0; flex: 1 1 320px; }
.eu-record-source { margin: 0; }
.eu-record-source a { display: inline-flex; align-items: center; gap: 4px; }
.eu-profile-tab { display: flex; flex-direction: column; gap: 20px; padding-top: 14px; }
.eu-h { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.eu-tip { cursor: help; font-size: 12px; text-transform: none; color: var(--ink-3); }
.eu-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface-2); }
.eu-stat { padding: 12px 14px; min-width: 0; }
.eu-stat + .eu-stat { border-left: 1px solid var(--line); }
.eu-stat .v { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink);
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.eu-stat .k { margin-top: 2px; font-size: 11.5px; color: var(--ink-3); }
.eu-profile-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; }
.eu-bars { display: flex; flex-direction: column; gap: 6px; }
.eu-bar { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 3.6em; align-items: center; gap: 10px;
  font-size: 13px; }
.eu-bar-label { color: var(--ink); overflow-wrap: anywhere; }
.eu-bar-track { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.eu-bar-fill { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.eu-bar-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.eu-bar-more { margin: 2px 0 0; font-size: 12px; color: var(--ink-3); }
.eu-record { padding-top: 14px; border-top: 1px solid var(--line); }
.eu-record .kv { grid-template-columns: 170px minmax(0, 1fr); }
.eu-projects, .eu-copartners { list-style: none; margin: 0; padding: 0; }
.eu-projects li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.eu-projects li:last-child, .eu-copartners li:last-child { border-bottom: 0; }
.eu-project-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.eu-project-name { font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.eu-project-date { font-size: 12px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.eu-project-title { margin-top: 2px; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.eu-project-meta { margin-top: 5px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  font-size: 12px; color: var(--ink-3); }
.eu-copartners li { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--line); }
.eu-copartner-name { min-width: 0; display: flex; flex-direction: column; }
.eu-copartner-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 12.5px; }
@media (max-width: 720px) {
  .modal-back:has(.eu-profile) { padding: 0; }
  .modal.eu-profile { max-width: none; height: 100%; max-height: none; border-radius: 0; }
  .eu-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eu-stat:nth-child(3) { border-left: 0; }
  .eu-stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .eu-profile-cols, .eu-copartners li { grid-template-columns: minmax(0, 1fr); }
  .eu-record .kv { grid-template-columns: 130px minmax(0, 1fr); }
}

/* ── Project page (views/project.js): an overview, the matches as a review split, the record ── */

.pj-progress {
  display: grid; gap: 8px; padding: 12px 14px; margin-bottom: 14px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius);
}
.pj-progress.done { background: var(--ok-bg); border-color: var(--ok-line); }
.pj-progress-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.pj-progress-top strong { font-weight: 600; }
.pj-progress-count { margin-left: auto; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pj-progress-note { font-size: 12px; color: var(--ink-2); }
.pj-bar { height: 5px; border-radius: 2px; background: var(--accent-line); overflow: hidden; }
.pj-bar i { display: block; height: 100%; background: var(--accent); transition: width .4s linear; }
.pj-progress.done .pj-bar { background: var(--ok-line); }
.pj-progress.done .pj-bar i { background: var(--ok); }
.pj-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--accent); animation: pj-pulse 1.1s ease-in-out infinite; }
.pj-progress.done .pj-dot { animation: none; background: var(--ok); }
@keyframes pj-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* The overview: three counts, then the profile with what it still lacks, in one row. */
.pj-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.5fr); gap: 12px; margin-bottom: 14px; }
.pj-ov {
  display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; color: var(--ink); text-align: left;
}
.pj-ov-link { cursor: pointer; transition: border-color .15s; }
.pj-ov-link:hover { border-color: var(--accent-line); }
.pj-ov-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pj-ov-k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.pj-ov-v { display: flex; align-items: baseline; gap: 8px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.pj-ov-n { font-size: 12px; color: var(--ink-3); }
.pj-ov-profile .pj-ov-v { font-size: 15px; letter-spacing: 0; }
.pj-ov-of { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.pj-ov-profile .np-strength-bar { margin: 3px 0 4px; }
.pj-ov-todo { display: flex; flex-wrap: wrap; gap: 5px; }

.pj-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); font: inherit; font-size: 12px;
}
.pj-chip.add { background: none; border-style: dashed; color: var(--accent); cursor: pointer; }
.pj-chip.add:hover { border-color: var(--accent); }
.pj-chip-x { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); cursor: pointer; }
.pj-chip-x span { font-size: 14px; line-height: 1; }
.pj-chip-x:hover { border-color: var(--accent); }

/* The toolbar: search, score bands, sort and a Filters popover; the active filters under it. */
.pj-toolbar { margin-bottom: 10px; padding: 10px 12px; }
.pj-toolbar input[type=search] { flex: 1 1 240px; min-width: 180px; }
.pj-bands { display: flex; flex-wrap: wrap; gap: 6px; }
.pj-bands button {
  padding: 5px 11px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12.5px; cursor: pointer;
}
.pj-bands button .n { margin-left: 5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pj-bands button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pj-bands button.on .n { color: inherit; opacity: .8; }
.pj-push { flex: 1; }
.pj-sort { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.pj-sort select { width: auto; min-width: 0; }
.pj-filterbtn { gap: 7px; }
.pj-filter-n {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
}
.pop.pj-pop { left: auto; right: 0; width: 310px; }
.pop.pj-pop.pj-pop-left { left: 0; right: auto; }
.pj-active { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -2px 0 10px; }

/* The split: the grouped list, and the picked call in a panel that stays in view. */
.pj-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 14px; align-items: start; }
.pj-list { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pj-side { position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow-y: auto; min-width: 0; }

.pj-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pj-group-head {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 14px; border: 0;
  background: var(--surface-2); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  text-align: left; cursor: pointer;
}
.pj-group-head:hover { color: var(--ink); }
.pj-group-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pj-group.open .pj-group-head { border-bottom: 1px solid var(--line); }
.pj-group-caret { width: 12px; font-size: 11px; color: var(--ink-3); }
.pj-group-n {
  margin-left: auto; min-width: 24px; padding: 0 7px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); font-size: 11.5px; text-align: center; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.pj-group-empty { padding: 12px 14px; font-size: 12.5px; color: var(--ink-3); }
/* "To review": the AI's own section, ringed like .btn-ai (the CPV "Suggest codes" button). */
.pj-group[data-group="review"] {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(110deg, #3db3c9 0%, #3fa9e6 40%, #5fcf8a 75%, #e8c93a 100%) border-box;
  box-shadow: 0 2px 8px rgba(15, 18, 26, 0.08);
}
.pj-group[data-group="review"] > .pj-group-head { background: var(--surface); color: var(--ink); }
.pj-group-ai { display: inline-flex; color: var(--ink); }
.pj-group-ai .ico { display: block; }
/* A call just moved here (views/project.js flashGroup): the header warms gently, the count
   swells once. Soft on purpose: it points, it does not shout. */
.pj-group-head.pj-landed { animation: pj-landed 2.2s ease-in-out; }
.pj-group-head.pj-landed .pj-group-n { animation: pj-count 0.9s ease-in-out; }
@keyframes pj-landed {
  0% { background: var(--surface-2); box-shadow: inset 2px 0 0 transparent; }
  25%, 45% { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent-line); }
  100% { background: var(--surface-2); box-shadow: inset 2px 0 0 transparent; }
}
@keyframes pj-count {
  50% { transform: scale(1.12); border-color: var(--accent-line); color: var(--accent); }
}


.pj-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start;
  width: 100%; padding: 11px 14px 11px 11px; border: 0; border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent; background: var(--surface); font: inherit; color: var(--ink);
  text-align: left; cursor: pointer;
}
.pj-group-rows > :last-child { border-bottom: 0; }
.pj-row:hover { background: var(--surface-2); }
.pj-row.on { background: var(--accent-soft); border-left-color: var(--accent); }
.pj-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pj-row-score { min-width: 76px; padding-top: 1px; }
.pj-row-score .score { white-space: nowrap; }
.pj-row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pj-row-title {
  font-size: 13.5px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.pj-row-meta { font-size: 12px; color: var(--ink-3); }
.pj-row-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pj-row.pj-stale { opacity: .6; }
.pj-row.pj-new { animation: pj-rise .38s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes pj-rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.pj-stage {
  display: inline-block; padding: 0 6px; border: 1px solid; border-radius: var(--radius-sm);
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}
.pj-stage.prev { color: var(--ink-3); background: var(--surface-2); border-color: var(--line-strong); }

.pj-panel {
  display: flex; flex-direction: column; gap: 14px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.pj-panel-empty { padding: 34px 20px; }
.pj-panel-ref { font-family: var(--mono); font-size: 11.5px; letter-spacing: .02em; color: var(--ink-3); overflow-wrap: anywhere; }
.pj-panel-title { margin: -8px 0 0; font-size: 18px; line-height: 1.3; color: var(--ink); }
.pj-panel-score { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pj-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.pj-fact {
  display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 9px 11px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.pj-fact .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.pj-fact .v { font-size: 13px; font-weight: 600; overflow-wrap: break-word; }
.pj-fact .v .small { display: block; font-weight: 400; }
.pj-decided { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pj-lbl { margin: 0 0 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.pj-why { padding: 12px 14px; border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface-2); }
.pj-why-text { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink); }
.pj-note { margin-top: 6px; font-size: 11.5px; color: var(--ink-3); }
.pj-about-text { font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.pj-about-text.clamped {
  max-height: 9.5em; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent);
}
/* the call's own headings, at panel size: a label, not a section break */
.pj-about-text .fmt h3.sec, .pj-about-text .fmt h4.sec {
  margin: 8px 0 3px; padding-top: 0; border-top: 0; font-size: 12px; font-weight: 700;
  letter-spacing: 0; text-transform: none; color: var(--ink);
}
.pj-about-text .fmt h4.sec::before { display: none; }
.pj-about-text .fmt :is(p, ul, ol) { margin: 0 0 6px; }
.pj-about-text .fmt li { margin-bottom: 3px; }
.pj-about-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 4px; }
.pj-about-foot .pj-note { margin-top: 0; }
.pj-acts { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.pj-skel { display: grid; gap: 7px; }
.pj-skel i {
  display: block; height: 10px; border-radius: 3px;
  background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%;
  animation: pj-shimmer 1.2s linear infinite;
}
.pj-skel i.short { width: 60%; }
@keyframes pj-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.pj-flash { animation: pj-flash 1.4s ease-out; }
@keyframes pj-flash { from { box-shadow: 0 0 0 3px var(--accent-line); } to { box-shadow: 0 0 0 3px transparent; } }

/* The record: details on the left; what the profile lacks, documents and partners beside it. */
.pj-details { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.pj-details-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
/* In the narrow side column a file's buttons go under its name rather than squeezing it. */
.pj-details-side .filerow { flex-wrap: wrap; row-gap: 6px; }
.pj-details-side .filerow .meta { flex: 1 1 170px; }
.pj-details-side .filerow-actions { width: 100%; justify-content: flex-start; padding-left: 40px; }
.pj-checks { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pj-checks li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 9px; align-items: center; font-size: 13px; color: var(--ink-2); }
.pj-check-mark {
  display: grid; place-items: center; width: 16px; height: 16px; border: 1.5px solid var(--border-strong);
  border-radius: 3px; font-size: 10px; font-weight: 700; color: #fff;
}
.pj-checks li.ok { color: var(--ink); }
.pj-checks li.ok .pj-check-mark { background: var(--ok); border-color: var(--ok); }

/* Narrow: no side panel; the picked call opens under its row. */
.pj-inline { padding: 0 10px 12px; border-bottom: 1px solid var(--line); background: var(--accent-soft); }
.pj-inline .pj-panel { padding: 14px; }
@media (max-width: 1180px) {
  .pj-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pj-ov-profile { grid-column: 1 / -1; }
  .pj-details { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1000px) {
  .pj-split { grid-template-columns: minmax(0, 1fr); }
  .pj-side { display: none; }
  .pj-details { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .pj-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pj-row { grid-template-columns: auto minmax(0, 1fr); }
  .pj-row-tags { grid-column: 2; flex-direction: row; align-items: center; }
  .pj-row-tags:empty { display: none; }
  .pj-sort > span { display: none; }
  .pj-push { display: none; }
  .pop.pj-pop { width: min(310px, calc(100vw - 32px)); }
}
@media (prefers-reduced-motion: reduce) { .pj-dot, .pj-row.pj-new, .pj-skel i, .pj-flash, .pj-group-head.pj-landed, .pj-group-head.pj-landed .pj-group-n { animation: none; } }

/* ── Internal notes drawer (project page) ─────────────────────────────────────────────────
   Opened from the header button on any tab: slides in from the right over the page, the page
   dims a little behind it. The notes scroll; the composer stays at the bottom. */
.notes-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 72;
  display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px 0 15px;
  border: 0; border-radius: 24px; background: var(--accent); color: #fff; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 14px;
  box-shadow: 0 8px 24px rgba(11, 26, 51, .22), 0 2px 6px rgba(11, 26, 51, .12);
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.notes-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(11, 26, 51, .26), 0 3px 8px rgba(11, 26, 51, .14); }
.notes-fab:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 3px; }
.notes-fab .ico { color: #fff; }
.notes-fab.on { opacity: 0; transform: scale(.85); pointer-events: none; }
/* Toasts rise above the floating button instead of covering it. */
body:has(.notes-fab) .toast-host { bottom: 84px; }
/* Unread notes: a red count on the button, which pulses once when the page opens. */
.notes-n {
  position: absolute; top: -6px; right: -6px; min-width: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--danger); color: #fff; border: 2px solid var(--surface);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.notes-fab.has-new .notes-n { animation: notes-ping 1.6s ease-out 2; }
@keyframes notes-ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 55%, transparent); }
  100% { box-shadow: 0 0 0 10px transparent; }
}
/* In the drawer: a "New" line before the first unread note, and the unread notes marked. */
.notes-new {
  display: flex; align-items: center; gap: 10px; margin: 16px 0 4px;
  color: var(--danger); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.notes-new::before, .notes-new::after { content: ''; flex: 1; height: 1px; background: color-mix(in srgb, var(--danger) 45%, transparent); }
.notes-feed .comment.new { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); box-shadow: inset 3px 0 0 var(--danger); }
.notes-back {
  position: fixed; inset: 0; z-index: 74; background: rgba(11, 26, 51, .18);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.notes-back.open { opacity: 1; pointer-events: auto; }
.notes-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 75; width: min(440px, 100vw);
  display: flex; flex-direction: column; background: var(--surface);
  border-left: 1px solid var(--line); box-shadow: -18px 0 48px rgba(11, 26, 51, .14);
  transform: translateX(104%); visibility: hidden;
  transition: transform .32s cubic-bezier(.22, .8, .24, 1), visibility 0s linear .32s;
}
.notes-drawer.open { transform: none; visibility: visible; transition: transform .32s cubic-bezier(.22, .8, .24, 1); }
.notes-drawer:focus { outline: none; }
.notes-drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--line);
}
.notes-drawer-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; }
.notes-drawer-head h2 .ico { color: var(--accent); }
.notes-drawer-n:not(:empty) {
  padding: 1px 8px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2);
  font-size: 12px; font-weight: 600;
}
.notes-drawer-sub { margin-top: 3px; color: var(--ink-3); font-size: 12px; }
.notes-close {
  width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2);
  font-size: 20px; line-height: 1; cursor: pointer; transition: background .15s ease;
}
.notes-close:hover { background: var(--surface-2); color: var(--ink); }
.notes-drawer-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.notes-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.notes-feed { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 20px 12px; background: var(--bg-0); }
.notes-feed .empty { margin-top: 40px; }
.notes-feed .comment {
  margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); box-shadow: 0 1px 2px rgba(11, 26, 51, .04);
}
.notes-feed .comment.reply { margin-left: 26px; }
.notes-feed .comment .avatar { flex: none; }
.notes-compose {
  padding: 12px 20px 16px; border-top: 1px solid var(--line); background: var(--surface);
}
.notes-compose textarea {
  width: 100%; resize: vertical; min-height: 64px; border-radius: 10px; padding: 10px 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.notes-compose textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.notes-compose-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.notes-compose-foot select { width: auto; min-width: 140px; }
.notes-hint { margin-left: auto; color: var(--ink-3); font-size: 11px; }
@media (max-width: 600px) {
  .notes-drawer { width: 100vw; border-left: 0; }
  .notes-hint { display: none; }
  .notes-fab { right: 16px; bottom: 16px; width: 52px; height: 52px; padding: 0; justify-content: center; border-radius: 50%; }
  .notes-fab-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .notes-drawer, .notes-drawer.open, .notes-back, .notes-fab { transition: none; }
  .notes-fab.has-new .notes-n { animation: none; }
}

/* ── Field help: the "i" beside a label (ui.js infoTip) ─────────────────────────────────────
   Tap or click opens one line of explanation and an example; on a desktop hovering shows it
   too. The bubble hangs under the whole label row, so it never runs off a narrow column. */
.field-label { position: relative; display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.field-label > label { margin-bottom: 0; }
.infotip { display: inline-flex; }
.infotip-btn {
  width: 18px; height: 18px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%;
  background: var(--surface); color: var(--ink-3); cursor: pointer;
  font: 600 11px/16px Georgia, 'Times New Roman', serif; font-style: italic; text-align: center;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.infotip-btn:hover, .infotip-btn.on { border-color: var(--accent); background: var(--accent); color: #fff; }
.infotip-btn:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
/* a bigger tap target on touch screens, without a bigger circle */
@media (pointer: coarse) { .infotip-btn { position: relative; } .infotip-btn::after { content: ''; position: absolute; inset: -12px; } }
.infotip-bubble {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 25;
  display: flex; flex-direction: column; gap: 4px;
  width: max-content; max-width: min(360px, 100%); padding: 9px 12px;
  border-radius: 8px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 400; line-height: 1.45;
  box-shadow: 0 8px 24px rgba(11, 26, 51, .22);
}
.infotip-bubble[hidden] { display: none; }
.infotip-example { color: rgba(255, 255, 255, .78); }
.infotip-example b { color: #fff; font-weight: 600; }

/* ── Screen reader only text ─────────────────────────────────────────────────────────────── */
.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;
}


/* ══════════════════════════════════════════════════════════════════════════════════════════
   THE ENGINE JOURNEY (views/start.js, views/bid.js): Start to an approved plan
   Design ux-redesign 2026-10-30 in today's Kairos look (owner ruling 30 Oct 2026): Public Sans
   and IBM Plex Mono, the tokens and the one 3px radius above, the dark rail. Taken from the
   design: the phase rail, one focused card at a time, one stable look for the agent's
   proposals (the accent's soft tint), basis in words, the sticky action bar.
   Motion: 150 to 320 ms ease out on transform and opacity only, nothing ambient, and none at
   all under prefers-reduced-motion. Nothing is cut short: titles wrap, no clamp, no ellipsis.
   ══════════════════════════════════════════════════════════════════════════════════════════ */

:root { --kx-ease: cubic-bezier(.2, .7, .2, 1); --kx-bar-h: 72px; --kx-amber: #9A6514; }
/* Focus never hides under the sticky top bar or the sticky action bar (WCAG 2.4.11). */
html:has(.kx-bid), html:has(.kx-start) { scroll-padding-top: 68px; }
html:has(.has-bar .kx-bar) { scroll-padding-bottom: calc(var(--kx-bar-h) + 16px); }

.kx-label {
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 6px;
}
.kx-muted { color: var(--ink-2); }
.kx-small { font-size: 12px; }
.kx-strong { font-weight: 600; color: var(--ink); }
.kx-pad { padding: 18px 20px; }
.kx-pad > .kx-label:first-child { margin-bottom: 10px; }
.kx-pad p { margin: 0 0 8px; }
.kx-pad p:last-child { margin-bottom: 0; }
.kx-gap-top { margin-top: 12px; }
.kx-lede { color: var(--ink-2); font-size: 15px; margin: 6px 0 0; max-width: 70ch; }
.kx-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }

/* Layout: the work and the aside that explains it. */
.kx-work { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.kx-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.kx-aside { display: flex; flex-direction: column; gap: 12px; min-width: 0; position: sticky; top: 68px; }
.kx-aside:empty { display: none; }
.kx-work:has(> .kx-aside:empty) { grid-template-columns: minmax(0, 1fr); }

/* Entrance: screens rise in once; a section opens with a short fade. */
.kx-enter { animation: kx-enter .32s var(--kx-ease) both; }
.kx-enter-row { animation: kx-fade .2s var(--kx-ease) both; }
@keyframes kx-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes kx-fade { from { opacity: 0; } to { opacity: 1; } }

/* Glyphs (icons.js, owner ruling 30 Oct 2026: every mark here is Kairos's own, none from a font,
   a character, a CSS shape or the browser). A glyph sits in .kx-ico, takes its colour from the
   state it marks, and always stands beside its words. */
.kx-ico { display: inline-flex; flex: none; line-height: 0; }
.kx-ico .ico { display: block; }

/* Buttons: 44px targets on touch, a pending state while an intent runs. */
.kx-bid .btn, .kx-start .btn, .kx-drawer .btn, .kx-modal .btn { transition: background-color .15s var(--kx-ease), border-color .15s var(--kx-ease); }
.btn.is-pending, .btn.is-pending:disabled { opacity: .85; cursor: progress; }
/* Pending: the pending glyph turns (transform only); it stands still under reduced motion. */
.kx-spin { animation: kx-spin .9s linear infinite; transform-origin: 50% 50%; }
@keyframes kx-spin { to { transform: rotate(360deg); } }
.kx-bid .btn.link, .kx-start .btn.link { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-line); padding: 6px 0; }
/* A link inside a sentence is told apart by more than colour (axe link-in-text-block; audit U10 retake). */
.start-refusal a { text-decoration: underline; text-underline-offset: 3px; }
.kx-bid .btn.link:hover { text-decoration-color: var(--accent); background: none; }
.kx-bid :focus-visible, .kx-start :focus-visible, .kx-drawer :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Chips: colour always with words. */
.kx-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px 1px 6px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 12px; font-weight: 600; color: var(--ink-2);
}
.kx-chip .kx-ico { color: var(--ink-3); }
.kx-chip.good .kx-ico { color: var(--ok); }
.kx-chip.warn .kx-ico { color: var(--kx-amber); }
.kx-chip.bad .kx-ico { color: var(--danger); }
.kx-pts {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: var(--radius); font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent); white-space: nowrap;
}
.kx-pts.tie { background: var(--bg-2); color: var(--ink-2); white-space: normal; }
.kx-band { font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 1px 8px; border-radius: var(--radius); background: var(--bg-2); }
.kx-band.eligibility { background: var(--warn-bg); color: var(--warn); }
.kx-lang {
  font-family: var(--mono); font-size: 11px; padding: 0 5px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); color: var(--ink-2); background: var(--surface); font-style: normal;
}
.kx-dot { color: var(--ok); align-self: center; }

/* Toggletips: a word you can press; the bubble is placed in the viewport by ui.js. */
.kx-tip-wrap { display: inline; }
.kx-tip {
  display: inline; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: help;
  text-decoration: underline dotted; text-decoration-color: var(--ink-3); text-underline-offset: 3px;
}
.kx-tip[aria-expanded="true"] { text-decoration-style: solid; text-decoration-color: var(--accent); }
@media (pointer: coarse) { .kx-tip { padding: 12px 0; margin: -12px 0; } }
.kx-tip-bubble {
  position: fixed; z-index: 120; padding: 10px 12px; border-radius: var(--radius);
  background: var(--rail-800); color: #fff; font-size: 13px; font-weight: 400; line-height: 1.5; letter-spacing: 0;
  text-transform: none; text-align: left; font-style: normal; box-shadow: 0 8px 24px rgba(11, 26, 51, .25);
  animation: kx-fade .15s var(--kx-ease);
}
.kx-tip-bubble[hidden] { display: none; }

/* Basis in words: Citato, Calcolato, Nessuna fonte, with a glyph that is never the only carrier. */
.kx-basis { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 1px 8px 1px 6px;
  border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.kx-basis .kx-ico { color: var(--ink); }
.kx-bases { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.kx-bases li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 6px; align-items: start; }
.kx-bases .kx-basis { padding: 0; background: none; margin-top: 2px; }

/* The source link and the quote from the call. */
.kx-srclink {
  display: inline-flex; align-items: flex-start; gap: 4px;
  border: 0; background: none; padding: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--accent);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-line); cursor: pointer; text-align: left;
}
.kx-srclink .kx-ico { margin-top: 1px; }
.kx-srclink:hover { text-decoration-color: var(--accent); }
.kx-quote { margin: 10px 0 0; }
.kx-quote blockquote { margin: 0; padding: 4px 0 4px 14px; border-left: 2px solid var(--border-input); font-style: italic; max-width: var(--measure); }
.kx-quote figcaption { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; color: var(--ink-3); font-size: 12px; }
.kx-quote-tr { font-size: 13px; color: var(--ink-2); margin: 8px 0 0; max-width: var(--measure); }
.kx-quote-tr .kx-label { display: block; margin: 0 0 2px; }

/* Banners: what happened, in words. */
.kx-verdict { margin: 12px 0; }
.kx-verdict-item { margin-top: 12px; }
.kx-verdict-more { margin-top: 8px; }
.kx-verdict-more > summary { cursor: pointer; font-weight: 600; }
.kx-verdict-item p { margin: 4px 0; }
.kx-verdict .excerpt-text { margin: 6px 0 0; }
.kx-gap-card { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--line); }
.kx-gap-card > label { display: block; font-size: 15px; line-height: 1.4; margin-bottom: 8px; }
.kx-gap-proposed { margin: 0 0 8px; }
/* The brief's proposals (engine 0.1.20.36): groups of rows to confirm in bulk or edit one. */
.kx-brief-group { margin-top: 20px; }
.kx-brief-group-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.kx-brief-group-h h3 { margin: 0; font-size: 16px; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.kx-brief-group-h h3:focus { outline: none; }
.kx-brief-group-h h3:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kx-brief-rows { list-style: none; margin: 0; padding: 0; }
.kx-brief-row { padding: 12px 0 12px 12px; border-bottom: 1px solid var(--line); border-left: 2px solid transparent; min-width: 0; }
.kx-brief-row.is-suggestion { border-left: 2px dashed var(--line-strong); }
.kx-brief-row.is-confirmed { border-left-color: var(--ok); }
.kx-brief-q, .kx-feedback label.kx-brief-q { display: block; margin: 0 0 4px; line-height: 1.4; font-size: 15px; font-weight: 400; color: var(--ink); }
.kx-brief-label { overflow-wrap: anywhere; }
.kx-brief-basis { display: inline-block; font-size: 12px; line-height: 1.5; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 2px; color: var(--ink-2); font-weight: 400; white-space: normal; }
.kx-brief-basis.is-suggestion { border-style: dashed; }
.kx-brief-basis.is-none { border-color: var(--warn-line); }
.kx-brief-value { margin: 0 0 4px; overflow-wrap: anywhere; min-width: 0; }
.kx-brief-row textarea { width: 100%; box-sizing: border-box; margin: 4px 0; }
.kx-brief-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 6px; }
.kx-brief-done { display: inline-flex; align-items: center; gap: 4px; padding: 4px 0; line-height: 1; font-size: 13px; color: var(--ok); }
.kx-banners:empty { display: none; }
.kx-banners { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.kx-banner {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); animation: kx-fade .24s var(--kx-ease) both;
}
.kx-banner > .kx-ico { margin-top: 1px; color: var(--ink-3); }
.kx-banner.ok { background: var(--ok-bg); border-color: var(--ok-line); }
.kx-banner.ok > .kx-ico { color: var(--ok); }
.kx-banner.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.kx-banner.warn > .kx-ico { color: var(--warn); }
.kx-banner.bad { background: var(--danger-bg); border-color: var(--danger-line); }
.kx-banner.bad > .kx-ico { color: var(--danger); }
.kx-banner.good { background: var(--ok-bg); border-color: var(--ok-line); }
.kx-banner.good > .kx-ico { color: var(--ok); }
.kx-banner.info { background: var(--accent-soft); border-color: var(--accent-line); }
.kx-banner.info > .kx-ico { color: var(--accent); }
.kx-banner-t { font-weight: 600; color: var(--ink); }
.kx-banner-b { color: var(--ink); margin-top: 2px; max-width: 80ch; }
.kx-banner-a { margin-left: auto; flex: none; }
/* A stop with its reason: the engine's words, that nothing is lost, what happens next. */
.kx-banner-next { margin: 6px 0 0; }
.kx-banner .kx-err-code { margin-top: 4px; }
/* A reference for support, closed by default: never the main text (journey audit 9 Nov 2026, B2). */
.kx-support { margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.kx-support summary { cursor: pointer; width: max-content; max-width: 100%; padding: 2px 0; }
.kx-support summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kx-support-ref { margin: 4px 0 0; overflow-wrap: anywhere; }

/* Errors: what happened, its code, nothing lost, one action. */
.kx-err { padding: 12px 14px; border-radius: var(--radius); background: var(--danger-bg); border: 1px solid var(--danger-line); color: var(--ink); margin-bottom: 12px; outline: none; }
.kx-err strong { display: block; color: var(--danger); margin-bottom: 2px; }
.kx-err .kx-err-t { display: flex; gap: 6px; align-items: flex-start; }
.kx-err-t .kx-ico { margin-top: 2px; }
.kx-err ul { margin: 6px 0 0; padding-left: 18px; }
.kx-err p { margin: 6px 0 0; }
.kx-err .btn { margin-top: 10px; }
.kx-err-code { margin-top: 6px; font-size: 12px; color: var(--ink-2); }
.kx-err.refused { background: var(--warn-bg); border-color: var(--warn-line); }
.kx-err.refused strong { color: var(--warn); }
.kx-skel-card { display: flex; flex-direction: column; gap: 10px; min-height: 96px; }

/* The sticky action bar. */
.kx-bar {
  position: sticky; bottom: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  margin: 20px -26px -64px; padding: 12px 26px; min-height: 72px;
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
}
@supports (backdrop-filter: blur(6px)) { .kx-bar { background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px); } }
.kx-bar-note { flex: 1; min-width: 0; color: var(--ink-2); font-size: 13px; }
.kx-bar .btn { min-height: 44px; padding: 10px 18px; font-size: 14px; font-weight: 600; }
.kx-bar.mobile-only { display: none; }

/* ── Start ── */
.kx-start .page-head { margin-bottom: 20px; }
.kx-stepcard { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; padding: 18px 20px; }
.kx-stepn {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 12px;
  border: 1.5px solid var(--border-input); background: var(--surface); color: var(--ink-2);
  transition: background-color .2s var(--kx-ease), color .2s var(--kx-ease), border-color .2s var(--kx-ease);
}
/* A step with what it needs shows the step done glyph in place of its number (shape, not fill alone). */
.kx-stepn-done { display: none; color: var(--ink); }
.kx-stepcard.done .kx-stepn { border-color: transparent; background: none; }
.kx-stepcard.done .kx-stepn-n { display: none; }
.kx-stepcard.done .kx-stepn-done { display: inline-flex; }
.kx-stepbody { min-width: 0; }
.kx-stephead { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.kx-stepbody > h2 { font-size: 17px; margin: 0 0 12px; color: var(--ink); }
.kx-callrow { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.kx-calltitle { font-size: 17px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.kx-callrow p { margin: 2px 0 0; }
.kx-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin: 14px 0; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kx-facts > div { background: var(--surface); padding: 10px 12px; }
.kx-facts dt { font-size: 12px; color: var(--ink-3); }
.kx-facts dd { margin: 2px 0 0; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.kx-who { margin: 0 0 10px; }
.kx-who p { margin: 0; max-width: var(--measure); }
.kx-titlelang { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.kx-labelrow { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.kx-labelrow label { margin: 0; }
.kx-labelrow .kx-tip { font-size: 12px; color: var(--accent); font-weight: 600; }
/* The Start screen's rows that open (who works on the proposal; the portal's notices). The summary is
   one typographic line at the body size: its parts differ in weight and colour only (U5). */
.kx-team, .kx-notices { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.kx-notices { margin-bottom: 10px; }
.kx-team summary, .kx-notices summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; min-height: 32px; list-style: none; }
.kx-team summary::-webkit-details-marker, .kx-notices summary::-webkit-details-marker { display: none; }
/* On the baseline, nudged to the middle of the words; the negative margin keeps the row its height. */
.kx-team summary .kx-ico, .kx-notices summary .kx-ico { align-self: baseline; position: relative; top: 3px; margin-top: -3px; color: var(--ink-2); }
.kx-team .kx-when-open, .kx-team[open] .kx-when-closed,
.kx-notices .kx-when-open, .kx-notices[open] .kx-when-closed { display: none; }
.kx-team[open] .kx-when-open, .kx-notices[open] .kx-when-open { display: inline-flex; }
.kx-notices-body { margin: 6px 0 4px; }
.kx-team-t { font-weight: 600; color: var(--ink); }
.kx-members { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.kx-member { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 10px; align-items: center; }
.kx-member label { margin: 0; font-weight: 500; color: var(--ink); font-size: 13px; }
.kx-filerow .name { white-space: normal; overflow: visible; text-overflow: clip; word-break: break-word; }
.kx-filerole { flex: 0 1 220px; min-width: 0; }
.kx-filerole select[aria-invalid="true"] { border-color: var(--warn); }
.kx-timeline { list-style: none; margin: 0 0 10px; padding: 0; }
.kx-timeline li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; padding: 6px 0; position: relative; font-size: 13px; color: var(--ink-2); }
.kx-timeline li::before { content: ""; position: absolute; left: 7.5px; top: 23px; bottom: -5px; width: 1px; background: var(--line-strong); }
.kx-timeline li:last-child::before { display: none; }
.kx-tl-b { margin-top: 2px; color: var(--ink-3); }
.kx-timeline li.now { color: var(--ink); font-weight: 600; }
.kx-timeline li.now .kx-tl-b { color: var(--accent); }
.kx-needs { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
.kx-profile-line { display: block; font-weight: 600; margin-bottom: 6px; }
.kx-start .kx-err.start-refusal { margin: 0 0 14px; }

/* Tiles: radio and checkbox choices that read as one object. */
.kx-tiles { display: grid; gap: 8px; }
.kx-tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kx-tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kx-tile {
  position: relative; display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--border-input); border-radius: var(--radius); background: var(--surface);
  font-size: 14px; font-weight: 400; color: var(--ink);
  transition: border-color .15s var(--kx-ease), background-color .15s var(--kx-ease), box-shadow .15s var(--kx-ease);
}
.kx-tile:hover { border-color: var(--ink-2); }
.kx-tile.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.kx-tile:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.kx-tile input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--ink); }
.kx-tile input:focus-visible { outline: none; }
.kx-tile-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.kx-tile-t { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; font-weight: 600; }
.kx-tile-t > span:first-child { min-width: 0; }
.kx-tile-d { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.kx-tile-prop { font-size: 12px; font-weight: 600; color: var(--accent); }
.kx-tile.excluded { background: var(--bg-0); }
.kx-proj .score { flex: none; }

/* ── The bid page ── */
.kx-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
/* The title grows into the free width and never shrinks below a readable measure (--kx-head-measure): when the
   dates do not fit beside that, they wrap under the title instead of squeezing it (E2E live 13 Nov 2026 #2). */
.kx-head-main { flex: 1 1 var(--kx-head-measure); min-width: 0; }
.kx-head h1 { margin-top: 4px; line-height: 1.25; }
.kx-head-sub { margin: 6px 0 0; color: var(--ink-2); }
.kx-head-call { display: inline-block; margin-top: 4px; font-size: 13px; }
.kx-head-dates { margin: 0; display: grid; grid-template-columns: auto; justify-items: end; text-align: right; gap: 2px; flex: none; max-width: 100%; }
.kx-head-dates dt { margin: 8px 0 0; }
.kx-head-dates dt:first-child { margin-top: 0; }
.kx-head-dates dd { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--ink); }
/* Close and reopen the proposal (lane WD1): the action under the dates, the dialog's list and its reason. */
.kx-bids header { flex-wrap: wrap; }
.kx-bids-filter-wrap { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.kx-bid-closed .kx-bid-title { color: var(--ink-2); }
.kx-bid-closed-chip { margin-left: 8px; vertical-align: middle; }
.kx-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; flex: 0 1 auto; max-width: 100%; }
.kx-close-what p { margin: 0 0 10px; }
.kx-close-list { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 6px; }
.kx-close-field { display: grid; gap: 6px; }
.kx-close-note { width: 100%; min-height: 72px; resize: vertical; font: inherit; }
.kx-close-dialog { max-width: 520px; }
/* The confirming button of a close is filled red: it stops the agent, so it reads as the serious choice. */
.kx-close-dialog .btn.primary.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.kx-close-dialog .btn.primary.danger:hover { filter: brightness(.92); }
@media (max-width: 720px) {
  .kx-head { flex-direction: column; gap: 12px; }
  .kx-head-main { flex: 0 0 auto; width: 100%; }
  .kx-head-side { align-items: flex-start; }
  .kx-head-dates { justify-items: start; text-align: left; }
}

.kx-rail ol { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.kx-phase { border-right: 1px solid var(--line); }
.kx-phase:last-child { border-right: 0; }
.kx-phase button {
  width: 100%; height: 100%; display: flex; flex-direction: column; gap: 1px; padding: 10px 14px; text-align: left;
  border: 0; background: none; font: inherit; color: var(--ink-2); cursor: pointer; position: relative; min-height: 64px;
  transition: background-color .15s var(--kx-ease);
}
.kx-phase button:disabled { cursor: default; }
.kx-phase button:not(:disabled):hover { background: var(--bg-0); }
.kx-phase button:focus-visible { outline-offset: -3px; }
.kx-phase-n { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: .06em; }
.kx-phase-name { font-weight: 600; font-size: 14px; }
.kx-phase-state { font-size: 12px; color: var(--ink-3); }
.kx-phase.done .kx-phase-name { color: var(--ink); }
.kx-phase.now .kx-phase-name { color: var(--ink); }
.kx-phase.now .kx-phase-state { color: var(--accent); font-weight: 600; }
.kx-phase.later .kx-phase-name, .kx-phase.next .kx-phase-name, .kx-phase.unavailable .kx-phase-name { color: var(--ink-3); font-weight: 500; }
.kx-phase.sel button { background: var(--accent-soft); }
.kx-phase.sel button::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent);
  transform-origin: left; animation: kx-grow .24s var(--kx-ease) both; }
@keyframes kx-grow { from { transform: scaleX(0); } to { transform: none; } }

.kx-status { display: flex; gap: 8px 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 14px 0 18px; min-height: 34px; }
.kx-now { margin: 0; display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: baseline; }
.kx-now strong { color: var(--ink); font-weight: 600; }
.kx-now span { color: var(--ink-2); }
.kx-status-side { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.kx-live { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2); }
.kx-live .kx-ico { color: var(--ink-3); }
.kx-live.ok .kx-ico { color: var(--ok); }
.kx-live.warn .kx-ico { color: var(--kx-amber); }
.kx-live.danger .kx-ico { color: var(--danger); }
.kx-live.info .kx-ico { color: var(--accent); }

/* Elapsed time and milestones. */
.kx-elapsed { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.kx-elapsed .kx-label { margin-bottom: 2px; }
.kx-elapsed-v { font-size: 28px; font-weight: 500; color: var(--ink); line-height: 1.2; min-width: 5ch; font-variant-numeric: tabular-nums; }
.kx-step-typ { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.kx-steps { list-style: none; margin: 0; padding: 0; }
.kx-step { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
/* The step's glyph: done (solid disc, tick cut out), now (ring with a core), waiting (hourglass),
   failed (the error mark), later (an empty ring). The shape carries the state; colour adds to it. */
.kx-step:last-child { border-bottom: 0; padding-bottom: 0; }
.kx-node { margin-top: 1px; color: var(--ink-3); transition: color .2s var(--kx-ease); }
.kx-step.done .kx-node { color: var(--ink); }
.kx-step.now .kx-node, .kx-step.waiting .kx-node { color: var(--accent); }
.kx-step.failed .kx-node { color: var(--danger); }
.kx-step.failed.rule .kx-node { color: var(--kx-amber); }
.kx-step.failed.rule .kx-step-o { color: var(--warn); }
.kx-step.next .kx-step-t, .kx-step.skipped .kx-step-t { color: var(--ink-3); }
.kx-step-t { font-weight: 600; color: var(--ink); }
.kx-step-o { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.kx-step.failed .kx-step-o { color: var(--danger); }
.kx-step-at { color: var(--ink-3); margin-top: 2px; }
.kx-found { list-style: none; margin: 0; padding: 0; }
.kx-found li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kx-found li:last-child { border-bottom: 0; }
.kx-found-l { font-weight: 600; color: var(--ink); }
.kx-found-s { font-size: 12px; color: var(--ink-3); text-align: right; }

/* Questions. */
.kx-qhead { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.kx-qhead h2 { font-size: 18px; color: var(--ink); }
.kx-qhead p { margin: 4px 0 0; max-width: 64ch; }
.kx-segs-wrap { display: flex; gap: 10px; align-items: center; flex: 0 1 280px; min-width: 160px; }
.kx-segs { display: flex; gap: 4px; flex: 1; }
.kx-segs i { flex: 1; height: 4px; border-radius: 2px; background: var(--bg-2); transition: background-color .3s var(--kx-ease); }
.kx-segs i.done { background: var(--ink); }
/* The current question is outlined, not filled: 0/3 reads as nothing done yet (lead review, item 7). */
.kx-segs i.now { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); }
.kx-segs i { height: 6px; border-radius: 3px; }
.kx-segs-n { font-size: 12px; color: var(--ink-2); }
.kx-q { padding: 18px 20px; scroll-margin-top: 72px; }
.kx-q.now { border-color: var(--line-strong); animation: kx-enter .28s var(--kx-ease) both; }
.kx-q-top { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; }
.kx-q-n { font-size: 12px; color: var(--ink-3); }
.kx-q-holder { margin-left: auto; font-size: 12px; color: var(--ink-2); }
.kx-q-title { font-size: 18px; line-height: 1.35; margin: 10px 0 0; color: var(--ink); outline: none; }
.kx-q-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.kx-q-text { margin: 6px 0 0; font-size: 15px; color: var(--ink-2); max-width: var(--measure); }
.kx-q-items { margin: 8px 0 0; color: var(--ink-3); font-size: 12px; }
.kx-prop { margin-top: 14px; padding: 14px 16px; border-radius: var(--radius); background: var(--accent-soft); }
.kx-prop .kx-label { color: var(--ink-2); }
.kx-prop-v { font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; font-variant-numeric: tabular-nums; word-break: break-word; }
.kx-prop-none { font-weight: 600; color: var(--ink); }
/* A long requirement list: counts by what they decide, then the deciding ones, the rest on demand (finding 30). */
.kx-req-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.kx-req-count { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--bg-2, var(--accent-soft)); color: var(--ink); }
.kx-req-count.eligibility { background: var(--accent-soft); }
.kx-req-rest > summary { margin-top: 6px; }
.kx-prop-why { margin: 4px 0 0; color: var(--ink); max-width: var(--measure); }
.kx-prop-src { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 10px; font-size: 13px; }
.kx-prop-src:empty { display: none; }
.kx-field { border: 0; padding: 0; margin: 16px 0 0; min-width: 0; }
.kx-field legend { font-weight: 600; font-size: 14px; color: var(--ink); padding: 0; margin-bottom: 8px; }
.kx-q-edit { margin-top: 12px; max-width: 560px; }
.kx-q-edit:empty { display: none; }
.kx-q-alt { margin-top: 10px; }
.kx-q-other { border: 0; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.kx-q-other legend { font-size: 12px; padding: 0; margin-bottom: 4px; }
.kx-check { display: inline-flex; gap: 8px; align-items: center; margin: 0; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; min-height: 32px; }
.kx-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.kx-why { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.kx-why summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink); list-style: none; display: inline-flex; gap: 6px; align-items: center; min-height: 32px; }
.kx-why summary::-webkit-details-marker { display: none; }
.kx-why summary::marker { content: ""; }
/* The chevron points at the words while closed and down once open. */
.kx-why-x { color: var(--ink-2); transform: rotate(-90deg); transition: transform .2s var(--kx-ease); }
.kx-why[open] .kx-why-x { transform: none; }
.kx-q-acts { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.kx-q-acts .btn { min-height: 44px; padding: 10px 18px; font-size: 14px; font-weight: 600; }
.kx-q-reason { font-size: 13px; color: var(--ink-2); }
.kx-q-reason:empty { display: none; }
.kx-kbd-hint { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.kx-kbd-hint kbd, .kx-bid kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: var(--radius); padding: 0 5px; color: var(--ink-2); background: var(--surface); }
.kx-q.sum, .kx-q.later { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 20px; }
.kx-q.later { color: var(--ink-3); }
.kx-q-sumbody { min-width: 0; }
.kx-sent-context { grid-column: 1 / -1; min-width: 0; padding-top: 10px; border-top: 1px solid var(--line); }
.kx-sent-context > summary { cursor: pointer; font-size: 13px; color: var(--ink-2); }
.kx-answer-files { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.kx-answer-files button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.kx-item-documents { min-width: 0; }
.kx-item-documents .kx-file-list { margin-top: 12px; }
.kx-item-documents .kx-file-row > div { min-width: 0; overflow-wrap: anywhere; }
.kx-q-sumt { font-weight: 600; color: var(--ink-2); overflow-wrap: anywhere; min-width: 0; }
.kx-q.later .kx-q-sumt { color: var(--ink-3); }
/* The call's own sentence under a condition's title: quoted, quieter, whole (live run of 16 Nov 2026). */
.kx-q-sumq { display: block; margin-top: 4px; font-weight: 400; font-size: 13px; color: var(--ink-3); quotes: "C" "D"; }
.kx-q-sumv { color: var(--ink); font-weight: 600; display: flex; gap: 4px 10px; flex-wrap: wrap; align-items: baseline; word-break: break-word; }
.kx-q-sumtag { font-size: 12px; font-weight: 500; color: var(--ink-3); }
span.kx-q-sumtag { display: inline-flex; align-items: center; gap: 4px; }
.kx-q-sumtag.warn { color: var(--warn); }
.kx-after { margin-top: 4px; }
.kx-know { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.kx-know li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.kx-know li:last-child { border-bottom: 0; }
.kx-know li.here { font-weight: 600; color: var(--ink); }

/* Check and send. */
.kx-review h2 { font-size: 18px; color: var(--ink); outline: none; }
.kx-table-wrap { margin-top: 12px; }
.kx-rv { width: 100%; border-collapse: collapse; font-size: 14px; }
.kx-rv th, .kx-rv td { text-align: left; vertical-align: top; padding: 12px 10px; border-bottom: 1px solid var(--line); }
.kx-rv thead th { font-size: 12px; color: var(--ink-3); font-weight: 600; border-bottom-color: var(--line-strong); }
.kx-rv tbody th { font-weight: 600; color: var(--ink); width: 30%; }
.kx-rv-v { font-weight: 600; color: var(--ink); }
.kx-rv td:last-child { text-align: right; }

/* The plan. */
.kx-plansum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kx-plansum > div { background: var(--surface); padding: 14px 16px; }
.kx-plansum-v { font-size: 22px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.kx-plansum-v small { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.kx-plansum-k { font-size: 13px; color: var(--ink-2); }
.kx-secs { display: flex; flex-direction: column; gap: 8px; }
.kx-sec.depth-1 { margin-left: 24px; }
.kx-sec.depth-2 { margin-left: 48px; }
.kx-sec-h {
  width: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr) 170px 16px; gap: 12px; align-items: center;
  padding: 14px 18px; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; min-height: 56px;
  transition: background-color .15s var(--kx-ease);
}
.kx-sec-h:hover { background: var(--bg-0); }
.kx-sec-h:focus-visible { outline-offset: -3px; }
.kx-sec-n { font-size: 13px; color: var(--ink-3); }
.kx-sec-t { font-weight: 600; font-size: 15px; color: var(--ink); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.kx-pg { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); }
.kx-pb { height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; display: block; }
.kx-pb i { display: block; height: 100%; background: var(--ink); transform-origin: left; transition: transform .32s var(--kx-ease); }
/* Open a section: plus; close it: minus (Kairos glyphs), swapped by the button's aria-expanded. */
.kx-sec-x { display: inline-flex; color: var(--ink-2); }
.kx-sec-h[aria-expanded="true"] .kx-when-closed, .kx-sec-h[aria-expanded="false"] .kx-when-open { display: none; }
.kx-sec-b { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; padding: 4px 18px 18px 70px; }
.kx-sec-b[hidden] { display: none; }
.kx-sec-b ul { margin: 0; padding-left: 18px; font-size: 14px; }
.kx-sec-b li { margin: 3px 0; }
.kx-sec-b p { margin: 0; font-size: 14px; }
.kx-pt { color: var(--ink-2); }
.kx-factchips { display: flex; flex-wrap: wrap; gap: 6px; }
.kx-fact { display: inline-flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; padding: 2px 9px; border-radius: var(--radius); border: 1px solid var(--line-strong);
  font-size: 12px; font-weight: 600; color: var(--ink); background: var(--surface); }
.kx-fact .kx-ico { color: var(--ink-3); }
.kx-fact.confirmed .kx-ico { color: var(--ok); }
.kx-fact.to_confirm .kx-ico, .kx-fact.expired .kx-ico { color: var(--kx-amber); }
.kx-fact.missing .kx-ico { color: var(--danger); }
.kx-fact-st { font-weight: 500; color: var(--ink-2); }
.kx-fact-st::before { content: "· "; }
.kx-fact-pg { font-weight: 500; font-size: 11px; color: var(--ink-3); }
/* A long requirement in the call's words wraps inside its chip, beside its mark (plan-input-words). */
.kx-fact-group { margin: 8px 0 4px; }
.kx-fact-group-h { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.kx-settled > summary { cursor: pointer; display: flex; gap: 6px; align-items: center; list-style: none; }
.kx-settled[open] > summary .kx-why-x, .kx-feedback-one[open] > summary .kx-why-x { transform: none; }
.kx-feedback-sec { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.kx-feedback-sec h4 { margin: 0 0 6px; font-size: 14px; color: var(--ink); }
.kx-feedback-points { margin: 0 0 6px; padding-left: 18px; font-size: 14px; }
.kx-feedback-points li { margin: 3px 0; }
.kx-feedback-one { margin-top: 16px; }
.kx-feedback-one select { width: 100%; margin-bottom: 8px; }
.kx-fact-main { display: inline-flex; gap: 6px; align-items: flex-start; min-width: 0; }
.kx-fact-main .kx-ico { flex: none; margin-top: 1px; }
.kx-sec-b .kx-why { margin-top: 4px; font-size: 13px; }
.kx-sec-b .kx-why .kx-quote { margin: 6px 0 2px; }
.kx-sec-b ul.kx-gaps { list-style: none; padding-left: 0; }
.kx-gaps li { display: flex; gap: 6px; align-items: flex-start; }
.kx-gaps .kx-ico { color: var(--kx-amber); margin-top: 2px; }
.kx-feedback h2 { font-size: 17px; color: var(--ink); margin-bottom: 4px; }
.kx-feedback h3 { font-size: 14px; color: var(--ink); margin: 20px 0 4px; }
.kx-feedback label { display: block; margin: 12px 0 6px; }
.kx-feedback textarea { width: 100%; }
.kx-feedback .btn { margin-top: 16px; }
.kx-decisions h2 { font-size: 17px; color: var(--ink); margin-bottom: 4px; }
.kx-dr { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.kx-dr:last-child { border-bottom: 0; padding-bottom: 0; }
.kx-dk { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.kx-dv { font-weight: 600; color: var(--ink); }
.kx-approve-panel .kx-who { list-style: none; margin: 0 0 12px; padding: 0 0 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.kx-who li { display: flex; gap: 10px; align-items: center; }
.kx-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); font-size: 11px; font-weight: 700; color: var(--ink); flex: none; }
.kx-cons { margin: 6px 0 12px; padding-left: 18px; font-size: 14px; }
.kx-cons li { margin: 4px 0; }
.btn.kx-wide { width: 100%; justify-content: center; min-height: 44px; font-size: 14px; font-weight: 600; margin: 4px 0 8px; }
.kx-note { padding: 8px 10px; border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); font-size: 13px; }
.kx-drafting h2 { font-size: 18px; color: var(--ink); margin-bottom: 6px; outline: none; }
/* A line led by its glyph: the approval, the request, drafting started. */
.kx-glyph-line { display: flex; gap: 8px; align-items: flex-start; }
.kx-glyph-line .kx-ico { margin-top: 2px; color: var(--ink-2); }
.kx-drafting h2.kx-glyph-line { align-items: center; }
.kx-drafting h2.kx-glyph-line .kx-ico { margin-top: 1px; color: var(--ok); }

/* Drawers: help and the exact passage of a source. */
.kx-scrim { position: fixed; inset: 0; z-index: 110; background: rgba(11, 14, 18, .32); animation: kx-fade .2s var(--kx-ease); }
.kx-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 111; width: min(460px, 100vw); display: flex; flex-direction: column;
  background: var(--surface); box-shadow: -12px 0 32px rgba(11, 26, 51, .18); animation: kx-slide .26s var(--kx-ease);
}
@keyframes kx-slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.kx-drawer-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.kx-drawer-head .kx-label { grid-column: 1; margin: 0; }
.kx-drawer-head h2 { grid-column: 1; font-size: 17px; color: var(--ink); }
.kx-drawer-x { grid-column: 2; grid-row: 1 / span 2; min-height: 40px; }
.kx-drawer-body { padding: 20px; overflow-y: auto; flex: 1; }
.kx-help-sec + .kx-help-sec { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.kx-help-sec h3 { font-size: 14px; color: var(--ink); margin-bottom: 8px; }
.kx-help-sec p { margin: 8px 0 0; }
.kx-terms { margin: 0; }
.kx-terms dt { font-weight: 600; color: var(--ink); margin-top: 10px; }
.kx-terms dd { margin: 2px 0 0; color: var(--ink-2); }
.kx-passage { margin: 12px 0 16px; padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.kx-passage blockquote { margin: 0; line-height: 1.7; }
.kx-passage mark { background: var(--warn-bg); box-shadow: inset 0 -2px 0 var(--kx-amber); color: var(--ink); padding: 1px 2px; }
.kx-passage figcaption { margin-top: 8px; }

/* Engine bids on the proposals list: where a bid is resumed. */
.kx-bids { margin-bottom: 14px; }
.kx-bidlist { list-style: none; margin: 0; padding: 0; }
.kx-bidlist li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.kx-bidlist li:last-child { border-bottom: 0; }
.kx-bid-main { min-width: 0; }
.kx-bid-title { font-weight: 600; }

/* Items of a question, each answered on its own with its own provenance (RQ-017 G-017-04, 08). */
.kx-item { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 16px; }
.kx-q .kx-prop + .kx-item { border-top: 0; padding-top: 0; }
/* A legend sits in its fieldset's border unless it floats: floated, it reads as a heading above the line. */
.kx-item > legend { float: left; width: 100%; padding: 0; margin: 0 0 8px; }
.kx-item > legend + * { clear: both; }
.kx-item > legend.sr-only { float: none; width: 1px; margin: -1px; }
.kx-item-prov { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; margin: 0 0 10px; }
.kx-item-none { font-weight: 600; color: var(--ink); }
.kx-formula { flex-basis: 100%; padding: 8px 10px; border-radius: var(--radius); background: var(--bg-0); border: 1px solid var(--line); }
.kx-formula .mono { display: block; color: var(--ink); margin-bottom: 4px; }
.kx-formula ul { margin: 0; padding-left: 18px; }
.kx-formula li { margin: 2px 0; }
.kx-item-text { margin: 0; max-width: 560px; }
.kx-item-foot { margin-top: 6px; }
.kx-item-more { font-size: 13px; }
.kx-item-other { border: 0; padding: 4px 0 0; margin: 0; display: flex; flex-wrap: wrap; gap: 2px 18px; }
.kx-item-other[hidden] { display: none; }
.kx-item-kind { margin: 8px 0 0; padding: 8px 10px; border-radius: var(--radius); background: var(--warn-bg); border: 1px solid var(--warn-line);
  color: var(--ink); font-size: 13px; max-width: var(--measure); }
.kx-item-kind[hidden] { display: none; }
.kx-item-foot { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; }
.kx-item-leave { font-size: 13px; }
/* An open item not answered now (RQ-023 G-023-04 round 2): read only, who it waits on, and
   "Rispondo io" where the person may take it. */
.kx-item-rest { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.kx-item-restmain { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.kx-item-l { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
/* Question words (engine 0398, lane QW): each row says what it asks, what answer it takes and why,
   item by item of the call, with the call's words, the document and the page. */
.kx-item-ask { display: block; margin: 0 0 6px; color: var(--ink); font-size: 14px; max-width: var(--measure); overflow-wrap: anywhere; }
.kx-item-expects { margin: 0 0 10px; color: var(--ink-2); font-size: 13px; max-width: var(--measure); }
.kx-item-why { margin-top: 10px; padding-top: 6px; }
.kx-reasons { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 12px; }
.kx-reason { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.kx-reason-top { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.kx-decides { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: var(--radius); background: var(--bg-2); color: var(--ink-2); }
.kx-decides.eligibility { background: var(--warn-bg); color: var(--warn); }
.kx-decides.points { background: var(--info-bg); color: var(--info); }
.kx-reason-sec { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.kx-reason-st { margin: 8px 0 0; font-size: 13px; color: var(--ink); max-width: var(--measure); overflow-wrap: anywhere; }
.kx-reason-st .kx-label { display: block; margin: 0 0 2px; }
.kx-reason .kx-quote { margin-top: 8px; }
.kx-reason .kx-quote blockquote { overflow-wrap: anywhere; }
.kx-context { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.kx-context p { margin: 0 0 6px; max-width: var(--measure); }
.kx-context-title { color: var(--ink); }
.kx-context-meta, .kx-context-fact-meta { color: var(--ink-2); font-size: 12px; }
.kx-context-unknown { color: var(--ink); }
.kx-context-facts { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 9px; }
.kx-context-facts li { display: grid; gap: 3px; min-width: 0; }
.kx-context-fact-name { font-weight: 600; color: var(--ink); }
.kx-context-changed { color: var(--warn); font-size: 12px; }
.kx-context-gaps { margin-top: 10px; }
.kx-context-gaps ul { margin: 4px 0 0; padding-left: 20px; }
.kx-context-note, .kx-context-unavailable { color: var(--ink-2); font-size: 12px; margin: 10px 0 0; overflow-wrap: anywhere; }
.kx-open-doc { margin-top: 8px; display: inline-flex; gap: 6px; align-items: center; min-height: 36px; }
@media (max-width: 480px) {
  .kx-reason { padding: 8px 10px; }
  .kx-open-doc { width: 100%; justify-content: center; min-height: 44px; }
}
.kx-item-st { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.kx-item-st .ico, .kx-item-st svg { flex: none; margin-top: 1px; }
.kx-item-rest.others .kx-item-st { color: var(--warn); font-weight: 600; }
.kx-q-sumitems li.kx-q-sumrest { color: var(--ink-2); }
/* Items answered already, on the open card: label, answer and the "Registrata" tag, spaced. */
.kx-q-done { list-style: none; margin: 14px 0 0; padding: 0; }
.kx-q-done li { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .kx-item-take { min-height: 44px; }
}
.kx-dim { opacity: .45; transition: opacity .15s var(--kx-ease); }
.kx-q-opennote { margin: 14px 0 0; font-size: 13px; color: var(--warn); font-weight: 600; }
.kx-q-opennote[hidden] { display: none; }
.kx-q-sumitems { list-style: none; margin: 2px 0 0; padding: 0; }
.kx-q-sumitems li { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; color: var(--ink); word-break: break-word; }
.kx-rv-q { display: block; font-weight: 600; color: var(--ink); }
.kx-rv-item { display: block; font-weight: 500; color: var(--ink-2); font-size: 13px; }
.kx-rv tr.open td { color: var(--warn); }
.kx-ro-items { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.kx-bid-q { display: block; margin-top: 4px; }
.kx-bid-q:empty { display: none; }
@media (max-width: 720px) {
  .kx-item-other { flex-direction: column; gap: 0; }
  .kx-check { min-height: 44px; }
}

.kx-bar .start-submit { width: auto; margin: 0; flex: none; }
/* A title wraps instead of scrolling out of sight inside a one line field. */
.kx-titlelang textarea { min-height: 0; resize: vertical; field-sizing: content; line-height: 1.45; }

/* The action bar sits at the bottom of the window even when the page is short: the page fills
   the window (less the top bar and main's padding, which the bar's negative margin takes back). */
.kx-start.has-bar, .kx-bid.has-bar { display: flex; flex-direction: column; min-height: calc(100dvh - 140px); }
/* The host is only a mount point: display contents makes the bar a child of the page for its
   sticky containing block, so it sticks to the window bottom along the whole page. */
.kx-bar-host { display: contents; }
.kx-start.has-bar > .kx-bar, .kx-bid.has-bar .kx-bar { margin-top: auto; }
.kx-start.has-bar > .kx-work, .kx-bid.has-bar > .kx-screen { margin-bottom: 20px; }

/* A date field in the interface's language, with the browser's calendar behind a button. */
.kx-date-row { position: relative; display: flex; gap: 6px; align-items: stretch; max-width: 260px; }
.kx-date-row input[type=text] { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.kx-date-pick { flex: none; padding: 0 10px; min-height: 36px; justify-content: center; color: var(--ink-2); }
.kx-date-pick .ico { width: 18px; height: 18px; }

/* Selects and the call search carry Kairos glyphs, not the browser's arrow or clear mark. */
.kx-select { position: relative; display: block; min-width: 0; }
.kx-select select { display: block; line-height: normal; min-height: 33px; appearance: none; -webkit-appearance: none; padding-right: 32px; }
.kx-select > .kx-ico { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--ink-2); }
.kx-search { position: relative; }
.kx-search input[type=search] { padding-right: 40px; }
.kx-search input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.kx-search-x { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
.kx-search-x[hidden] { display: none; }
.kx-start .dropzone { display: flex; align-items: center; justify-content: center; gap: 8px; }
.kx-date-native { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.kx-date-error { margin-top: 4px; font-size: 12px; color: var(--danger); }

/* Audit 2026-10-30 fixes: the score's number beside its band (34), a narrative answer that grows
   (30), a later question that can be answered now (36), a decision's status (28), who approves (8). */
.score .score-n { font-variant-numeric: tabular-nums; font-weight: 500; }
.kx-item-text textarea.kx-grow { field-sizing: content; min-height: 88px; resize: vertical; line-height: 1.5; }
.kx-q-later-side { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.kx-dec-status { margin-left: 8px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.kx-approve-rule { margin: 0 0 10px; font-size: 13px; color: var(--ink); max-width: var(--measure); }
.kx-more { margin-top: 8px; }
/* The start call search (lane U4): the strong match switch, the rule line, rows with the score, the
   best matching project and the deadline; the empty state; a call card's warning. */
.kx-callfilter { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-top: 10px; }
.kx-switch { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; min-height: 32px; }
.kx-switch input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--accent); cursor: pointer; }
.kx-callcount { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.kx-callrule { margin: 6px 0 0; font-size: 12px; line-height: 1.45; color: var(--ink-2); max-width: var(--measure); }
.kx-start .picklist.kx-calllist { max-height: min(60vh, 520px); gap: 6px; }
.kx-callpick { gap: 3px; padding: 10px 12px; width: 100%; }
.kx-callpick:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.kx-callpick-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px 12px; width: 100%; flex-wrap: wrap; }
.kx-callpick-top .pickrow-title { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.kx-callpick-top .score { flex: none; }
.kx-callmeta, .kx-callproj, .kx-calldl { font-size: 12px; line-height: 1.45; color: var(--ink-2); overflow-wrap: anywhere; }
.kx-callproj { color: var(--ink); }
.kx-calldl-k { color: var(--ink-2); }
.kx-calldl .small.muted { color: var(--ink-2); }
.kx-callnone { padding: 10px 2px; font-size: 13px; }
.kx-callnone p { margin: 0 0 6px; }
.kx-callnone .btn { margin-top: 4px; }
.kx-callwarn { margin: 10px 0 2px; }
/* The proposal language: the call's and the workspace's first, the rest searchable. */
.kx-field-label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.kx-titlelang .field + .field { margin-top: 14px; }
.kx-langother { margin-top: 10px; }
.kx-tile-tag { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.kx-langlist { list-style: none; margin: 8px 0 0; padding: 4px; max-height: 240px; overflow-y: auto; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 2px; border: 1px solid var(--line); border-radius: var(--radius); }
.kx-langopt { width: 100%; text-align: left; padding: 7px 10px; border: 0; border-radius: var(--radius); background: none;
  font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; min-height: 32px; }
.kx-langopt:hover { background: var(--bg-0); }
.kx-langopt.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
@media (max-width: 720px) { .kx-langopt { min-height: 44px; } }
.kx-date-error[hidden] { display: none; }
.kx-date input[aria-invalid="true"] { border-color: var(--danger); }

/* Start files (lane UP1, owner ruling 2 Nov 2026): the drop zone, the files with their upload and
   virus check, and the proposal page's Files section. Radius 0, 2 or 4 only; no gradient, no glow. */
.kx-up { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kx-up > p { margin: 0; }
.kx-up-zone {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 72px; padding: 14px 16px;
  border: 1px dashed var(--line-strong); border-radius: 4px; background: var(--surface-2);
  color: var(--ink-2); font-size: 14px; text-align: center; cursor: pointer;
  transition: border-color .15s var(--kx-ease), background-color .15s var(--kx-ease);
}
.kx-up-zone:hover { border-color: var(--accent-line); color: var(--ink); }
.kx-up-zone.over { border-color: var(--accent); border-style: solid; background: var(--accent-soft); color: var(--accent); }
.kx-up-zone .kx-ico { color: var(--accent); flex: none; }
.kx-up-rules { display: flex; flex-direction: column; gap: 2px; margin: 0; font-size: 12px; color: var(--ink-2); max-width: var(--measure); }
.kx-up-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.kx-up-list[hidden] { display: none; }
.kx-up-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: start;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.kx-up-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.kx-up-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.kx-up-name { font-weight: 500; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.kx-up-size { flex: none; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.kx-up-state { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kx-up-line { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.kx-up-line .kx-ico { margin-top: 1px; flex: none; }
.kx-up-line.ok { color: var(--ok); }
.kx-up-line.bad { color: var(--danger); }
.kx-up-line.bad span { color: var(--ink); }
.kx-up-quiet { font-size: 12px; color: var(--ink-2); }
.kx-up-bar { height: 4px; max-width: 320px; border-radius: 2px; background: var(--bg-2); overflow: hidden; }
.kx-up-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s var(--kx-ease); }
.kx-up-row .kx-up-retry { align-self: flex-start; }

.kx-bid > .kx-files { margin-top: 16px; }
.kx-files h2.kx-label { margin: 0 0 4px; }
.kx-files > p { margin: 0 0 10px; }
.kx-file-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.kx-file-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: start;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.kx-file-row:last-child { border-bottom: 0; padding-bottom: 0; }
.kx-file-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.kx-file-name { font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.kx-file-meta { font-size: 13px; color: var(--ink-2); }
.kx-file-scan { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--ink); }
.kx-file-scan .kx-ico { color: var(--ok); margin-top: 1px; flex: none; }
.kx-file-quiet { font-size: 12px; color: var(--ink-2); }
.kx-file-err:empty { display: none; }
.kx-file-err .kx-err { margin: 6px 0 0; }
.kx-file-act { display: flex; align-items: center; justify-content: flex-end; min-height: 32px; }
.kx-file-dl { display: inline-flex; align-items: center; gap: 6px; }
.kx-file-nodl { font-size: 12px; color: var(--ink-2); text-align: right; max-width: 22ch; }
@media (max-width: 720px) {
  .kx-up-zone { flex-direction: column; gap: 6px; }
  .kx-up-row { grid-template-columns: minmax(0, 1fr); }
  .kx-up-row .kx-up-remove { justify-self: start; }
  .kx-file-row { grid-template-columns: minmax(0, 1fr); }
  .kx-file-act { justify-content: flex-start; }
  .kx-file-nodl { text-align: left; max-width: none; }
}

/* ── Narrower screens ── */
@media (max-width: 1180px) {
  .kx-work { grid-template-columns: minmax(0, 1fr); }
  .kx-aside { position: static; }
  .kx-bar.mobile-only { display: flex; }
}
@media (max-width: 720px) {
  .kx-start.has-bar, .kx-bid.has-bar { min-height: calc(100dvh - 116px); }
  .kx-bar { margin: 16px -14px -48px; padding: 10px 14px; flex-wrap: wrap; }
  .kx-bar .btn, .kx-bar .start-submit { flex: 1 1 auto; justify-content: center; }
  .kx-bar-note { flex-basis: 100%; }
  .kx-head { flex-direction: column; gap: 10px; }
  .kx-head-dates { justify-items: start; text-align: left; }
  .kx-rail ol { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kx-phase:nth-child(3) { border-right: 0; }
  .kx-phase:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  /* Four phases (no review and signing yet): two by two. */
  .kx-rail ol.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kx-rail ol.n4 .kx-phase:nth-child(odd) { border-right: 1px solid var(--line); }
  .kx-rail ol.n4 .kx-phase:nth-child(even) { border-right: 0; }
  .kx-rail ol.n4 .kx-phase:nth-child(3) { border-bottom: 0; }
  .kx-phase button { padding: 8px 10px; min-height: 56px; }
  .kx-phase-state { font-size: 11px; }
  .kx-tiles.two, .kx-tiles.three, .kx-grid2 { grid-template-columns: minmax(0, 1fr); }
  .kx-member { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .kx-filerole { flex: 1 1 100%; order: 3; }
  .kx-callrow { flex-direction: column; gap: 8px; }
  .kx-stepcard { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 16px; }
  .kx-pad, .kx-q { padding: 16px; }
  .kx-q-holder { margin-left: 0; flex-basis: 100%; }
  .kx-kbd-hint { display: none; }
  .kx-q-acts .btn { width: 100%; justify-content: center; }
  /* On a phone the open card's action stays in reach: it sticks to the bottom of the window
     while the card is on screen. */
  html:has(.kx-q.now) { scroll-padding-bottom: 96px; }
  .kx-q.now .kx-q-acts { position: sticky; bottom: 0; z-index: 5; margin: 18px -16px -16px; padding: 12px 16px;
    background: var(--surface); border-top: 1px solid var(--line); }
  /* While an answer is being changed, only that form keeps its buttons in reach: the open card's bar does not stick
     under it (audit N1). */
  html:has(.kx-revise) { scroll-padding-bottom: 0; }
  .kx-screen:has(.kx-revise) .kx-q.now .kx-q-acts { position: static; margin: 18px 0 0; padding: 0; border-top: 0; }
  .kx-q.sum, .kx-q.later { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 16px; }
  .kx-q.sum > .kx-q-n, .kx-q.later > .kx-q-n { grid-column: 1 / -1; }
  /* A waiting row names who it waits on: title, then the names and the button on their own line. */
  .kx-q.later.kx-q-waiting { grid-template-columns: minmax(0, 1fr); }
  .kx-q-waiting .kx-q-later-side { justify-content: space-between; }
  .kx-sec-h { grid-template-columns: 34px minmax(0, 1fr) 16px; padding: 12px 14px; }
  .kx-sec-h .kx-pg { grid-column: 2 / 3; grid-row: 2; }
  .kx-sec-x { grid-column: 3; grid-row: 1; }
  .kx-sec-b { grid-template-columns: minmax(0, 1fr); padding: 4px 14px 16px; }
  .kx-sec.depth-1 { margin-left: 12px; }
  .kx-sec.depth-2 { margin-left: 24px; }
  .kx-dr { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .kx-rv thead { display: none; }
  .kx-rv tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .kx-rv th, .kx-rv td { padding: 0; border: 0; width: auto !important; }
  .kx-rv tbody th { grid-column: 1 / -1; }
  .kx-rv td:last-child { grid-column: 2; grid-row: 2 / span 2; align-self: center; }
  .kx-drawer { width: 100vw; }
  .kx-bidlist li { flex-wrap: wrap; }
  .kx-bid .btn, .kx-start .btn { min-height: 44px; }
  .kx-elapsed-v { font-size: 24px; }
  .kx-banner { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 10px; row-gap: 10px; }
  .kx-banner-a { grid-column: 2; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .kx-enter, .kx-enter-row, .kx-q.now, .kx-banner, .kx-drawer, .kx-scrim, .kx-tip-bubble,
  .kx-phase.sel button::after { animation: none !important; }
  .kx-bid *, .kx-start *, .kx-drawer * { transition: none !important; }
  .kx-spin { animation: none; }
  .kx-why-x { transition: none; }
}

/* Live progress (lane LV1, 2 Nov 2026; js/progress.js): the stage bar, the running steps with their
   counters and bars, the activity feed, and the last activity line with its calm quiet note. */
.kx-lp { margin: 0 0 18px; }
.kx-lp-top { display: flex; gap: 6px 16px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.kx-lp-title { font-size: 16px; color: var(--ink); margin: 0; }
.kx-lp-quiet { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; font-size: 12px; color: var(--ink-2); }
.kx-lp-quiet .kx-ico { color: var(--ok); }
.kx-lp-quiet.quiet { color: var(--ink); }
.kx-lp-quiet.quiet .kx-ico { color: var(--kx-amber); }
.kx-lp-quiet-note { flex-basis: 100%; padding: 8px 10px; border: 1px solid var(--warn-line); background: var(--warn-bg);
  border-radius: var(--radius); color: var(--ink); font-size: 13px; }
.kx-lp-stages { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kx-lp-stage { display: flex; align-items: center; gap: 6px; padding: 8px 10px; font-size: 13px; color: var(--ink-3);
  border-right: 1px solid var(--line); min-width: 0; }
.kx-lp-stage:last-child { border-right: 0; }
.kx-lp-stage-name { overflow-wrap: anywhere; }
.kx-lp-stage.done { color: var(--ink-2); }
.kx-lp-stage.done .kx-lp-node { color: var(--ink); }
.kx-lp-stage.now { color: var(--ink); font-weight: 600; background: var(--accent-soft); }
.kx-lp-stage.now .kx-lp-node { color: var(--accent); }
.kx-lp-stage.stopped { color: var(--ink); font-weight: 600; }
.kx-lp-stage.stopped .kx-lp-node { color: var(--kx-amber); }
.kx-lp-node { flex: none; }
.kx-lp-now { margin-top: 14px; }
.kx-lp-empty { margin: 0; }
.kx-lp-steps { list-style: none; margin: 0; padding: 0; }
.kx-lp-step { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kx-lp-step:last-child { border-bottom: 0; }
.kx-lp-step .kx-lp-node { margin-top: 2px; color: var(--accent); }
.kx-lp-step.done .kx-lp-node { color: var(--ink); }
.kx-lp-step-head { display: flex; gap: 4px 12px; justify-content: space-between; flex-wrap: wrap; align-items: baseline; }
.kx-lp-step-name { font-weight: 600; color: var(--ink); }
.kx-lp-count { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.kx-lp-step-words { font-size: 13px; color: var(--ink-2); margin-top: 2px; overflow-wrap: anywhere; }
.kx-lp-step-extra { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.kx-lp-bar { height: 6px; border-radius: 3px; background: var(--bg-2); margin-top: 6px; overflow: hidden; }
.kx-lp-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s var(--kx-ease); }
.kx-lp-step.done .kx-lp-bar i { background: var(--ink-2); }
.kx-lp-feed-host { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.kx-lp-feed-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kx-lp-feed-head .kx-label { margin: 0; }
.kx-lp-paging { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: 12px; }
.kx-lp-paging[hidden] { display: none; }
.kx-lp-paging [aria-disabled="true"] { opacity: .55; cursor: default; }
.kx-lp-elapsed::before { content: '·'; margin-inline-end: 6px; }
@media (max-width: 720px) {
  .kx-question-jump, .kx-lp-history-button, .kx-lp-paging button { min-height: 44px; }
  .kx-lp-elapsed { flex-basis: 100%; }
  .kx-lp-elapsed::before { content: none; }
}
.kx-lp-feed { list-style: none; margin: 8px 0 0; padding: 0; }
.kx-lp-entry { display: grid; grid-template-columns: 7ch minmax(0, 1fr); gap: 10px; padding: 5px 0; font-size: 13px; color: var(--ink-2); }
.kx-lp-entry:first-child { color: var(--ink); animation: kx-enter .28s var(--kx-ease) both; }
.kx-lp-feed.history .kx-lp-entry:first-child { animation: none; }
.kx-lp-at { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* The start's live panel comes into view below the sticky header when Start is pressed. */
.kx-start-live, .kx-start-still { scroll-margin-top: 80px; }
.kx-lp-words { overflow-wrap: anywhere; }
.kx-lp-entry.item_skipped .kx-lp-reason, .kx-lp-entry.failed .kx-lp-reason { color: var(--warn); }
@media (max-width: 720px) {
  .kx-lp-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kx-lp-stage { gap: 4px; padding-inline: 6px; }
  .kx-lp-stage:nth-child(3) { border-right: 0; }
  .kx-lp-stage:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .kx-lp-entry { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .kx-lp-bar i { transition: none; }
  .kx-lp-entry:first-child { animation: none; }
}
.kx-lp [hidden] { display: none !important; }
.kx-lp-toggle { margin-left: auto; }

/* ── Release 0.1.14 ───────────────────────────────────────────────────────────────────────
   One bar on the bid page: the phase rail's current phase carries the agent's live stage and the
   running step's progress (views/bid.js paintRailLive); the live panel draws no bar of its own. */
.kx-phase { display: flex; flex-direction: column; min-width: 0; }
.kx-phase button { flex: 1 1 auto; height: auto; }
.kx-phase-live { padding: 0 14px 10px; font-size: 12px; color: var(--ink-2); min-width: 0; }
.kx-phase.sel .kx-phase-live { background: var(--accent-soft); }
.kx-phase { position: relative; }
/* With a live line, the selected phase's underline moves under the whole cell. */
.kx-phase.sel:has(.kx-phase-live:not(:empty)) button::after { display: none; }
.kx-phase.sel:has(.kx-phase-live:not(:empty))::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--accent); transform-origin: left; animation: kx-grow .24s var(--kx-ease) both; }
@media (prefers-reduced-motion: reduce) { .kx-phase.sel::after { animation: none !important; } }
.kx-phase-live:empty { display: none; }
/* The live line under the rail: its words whole, wrapping (recheck 2: nothing cut). */
.kx-phase-live .kx-phase-live-words { display: block; overflow-wrap: anywhere; }
.kx-phase-live-bar.idle { visibility: hidden; }
.kx-phase-live-top { display: flex; gap: 2px 8px; flex-wrap: wrap; align-items: baseline; justify-content: space-between; }
.kx-phase-live-stage { font-weight: 600; color: var(--ink); }
.kx-phase-live-count { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.kx-phase-live-words { margin-top: 2px; overflow-wrap: anywhere; overflow-wrap: anywhere; }
.kx-phase-live-bar { height: 4px; border-radius: 2px; background: var(--bg-2); margin-top: 6px; overflow: hidden; }
.kx-phase-live-bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .4s var(--kx-ease); }
@media (max-width: 720px) {
  .kx-phase-live { padding: 0 10px 8px; font-size: 11px; }
  .kx-phase-live-words { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .kx-phase-live-bar i { transition: none; }
}

/* A start that is still running: said plainly while the screen follows it. */
.kx-start-still { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--accent-soft); color: var(--ink); font-size: 14px; }
.kx-start-still[hidden] { display: none; }

/* Try again on a failed run, and its refusal. */
.kx-retry-refusal { margin-top: 8px; }
.kx-retry-run .kx-ico { margin-right: 6px; }
.kx-retry-run[aria-busy=true]:disabled { opacity: 1; cursor: progress; }
.kx-banner-list { display: flex; flex-direction: column; gap: 10px; }

/* The question designer: the verdict before the questions and the designed card. */
.kx-ready { border-left: 3px solid var(--line-strong); }
.kx-ready.good { border-left-color: var(--ok); }
.kx-ready.warn { border-left-color: var(--warn); }
.kx-ready.bad { border-left-color: var(--danger); }
.kx-ready-h { font-size: 20px; line-height: 1.3; margin: 0 0 8px; }
.kx-ready-sum { margin: 0 0 12px; color: var(--ink-2); line-height: 1.5; }
.kx-ready-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; }
.kx-ready-list p { margin: 4px 0 0; }
.kx-ready-next { margin: 0 0 12px; font-weight: 600; }
.kx-ready-time { margin: 0; color: var(--ink-2); }
.kx-ready-held { margin: 8px 0 0; padding-left: 18px; }
.kx-prop-tag { display: inline-block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.kx-suggest { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.kx-designed-answer { margin: 12px 0; }
.kx-designed-text textarea { width: 100%; }
.kx-honest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.kx-honest button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

/* A given answer changed, an open point answered later (facts spec, answer-revision). */
.kx-q.sum.sent .kx-not-stated, .kx-q.sum.sent .kx-history { grid-column: 1 / -1; }
/* Which file is in use, when and by whom (a document answer); the earlier ones are in the history. */
.kx-q.sum.sent .kx-file-in-use { grid-column: 1 / -1; margin: 4px 0 0; color: var(--ink); overflow-wrap: anywhere; }
.kx-open-item .kx-replace { grid-column: 1 / -1; }
.kx-not-stated { margin-top: 8px; color: var(--ink); }
.kx-not-stated p { margin: 4px 0 0; color: var(--ink); }
.kx-q-changes.many { grid-column: 1 / -1; justify-content: flex-start; }
.kx-q-changes { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.kx-history-list { margin: 6px 0 0; padding-left: 18px; }
.kx-revise { display: grid; gap: 12px; }
.kx-revise h3, .kx-revise p { margin: 0; }
.kx-revise textarea { width: 100%; }
.kx-open-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.kx-open-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 12px; align-items: start;
  padding-top: 12px; border-top: 1px solid var(--line); }
.kx-open-item:first-child { padding-top: 0; border-top: 0; }
.kx-open-what p { margin: 0 0 2px; overflow-wrap: anywhere; }
.kx-open-item .kx-revise { grid-column: 1 / -1; }
.kx-given > summary { cursor: pointer; }
.kx-given .kx-q { margin-top: 12px; }
@media (max-width: 720px) {
  .kx-open-item { grid-template-columns: minmax(0, 1fr); }
  .kx-open-item .btn { width: 100%; justify-content: center; min-height: 44px; }
  .kx-open-chip { justify-self: start; }
  .kx-revise .kx-q-acts .btn { flex: 1 1 auto; min-height: 44px; }
  .kx-q-changes { justify-content: flex-start; width: 100%; }
  .kx-q-changes .btn { min-height: 44px; }
}

/* Release 0.1.17: the agent's proposals, the rules that do not apply, a held proposal, an unclear page limit. */
.kx-proposals h2, .kx-sa-ask h2 { margin: 0 0 6px; }
.kx-prop-list, .kx-sa-list, .kx-sa-applies { list-style: none; margin: 12px 0 0; padding: 0; }
.kx-prop-item { padding: 16px 0; border-top: 1px solid var(--border); }
.kx-prop-item:first-child { border-top: 0; padding-top: 4px; }
.kx-prop-t { margin: 0 0 4px; font-size: 16px; }
.kx-prop-acts, .kx-sa-acts, .kx-hold-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.kx-sa-acts p { flex-basis: 100%; margin: 0; }
.kx-sa-group { margin-top: 10px; }
.kx-sa-applies li { padding: 2px 0; font-weight: 600; }
.kx-sa-rule { padding: 12px 0; border-top: 1px solid var(--border); }
.kx-sa-rule p { margin: 4px 0 0; max-width: var(--measure); }
.kx-sa > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; flex-wrap: wrap; }
.kx-plansum-note { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-2); font-weight: 400; }
.kx-hold + .kx-hold { margin-top: 10px; }
.kx-prop-note { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.kx-prop-note p { margin: 0; }
.kx-decl h2 { margin: 0 0 6px; }
.kx-decl-theme { margin-top: 16px; }
.kx-decl-theme h3 { margin: 0; font-size: 15px; }
.kx-decl-list { list-style: none; margin: 6px 0 0; padding: 0; }
.kx-decl-item { padding: 10px 0; border-top: 1px solid var(--border); }
.kx-decl-item > p { margin: 0 0 4px; max-width: var(--measure); }
.kx-decl-item .btn.link { min-height: 44px; padding-left: 0; }
.kx-above { display: flex; gap: 6px; align-items: flex-start; margin: 8px 0 0; color: var(--ink-2); }
.kx-not-asked li { padding: 6px 0; }

/* Release 0.1.17: finished parts of the plan folded on a phone, with one summary line each. */
.kx-fold > .kx-fold-s { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-weight: 600; list-style: none; }
.kx-fold > .kx-fold-s::-webkit-details-marker { display: none; }
.kx-fold[open] > .kx-fold-s { margin-bottom: 10px; }
.kx-fold[open] > .kx-fold-s .kx-why-x { transform: rotate(90deg); }
@media (min-width: 641px) { .kx-fold > .kx-fold-s { display: none; } .kx-fold[open] > .kx-fold-s { margin-bottom: 0; } }
.kx-plansum-act { display: block; padding-left: 0; margin-top: 4px; text-align: left; }

/* Blind review, 10 Nov: "does not hold for us" is a real button with a 44 px target. */
.kx-decl-item .kx-not-held { min-height: 44px; margin-top: 6px; }
.kx-sa-status:empty, .kx-decl-status:empty { display: none; }

/* One label for keeping a rule; the pressed state shows it is kept. */
.kx-keep { min-height: 44px; }
.kx-keep[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }

/* UI quality audit, blocking items (10 Nov 2026). */
.kx-cond-words { margin: 12px 0 4px; }
.kx-cond-words .kx-quote { margin-top: 6px; }
.kx-more-host { margin-top: 16px; }
.kx-more > summary { cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; }
.kx-more-body { padding: 8px 0; }
.kx-hold-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.kx-rail-line { display: none; }
@media (max-width: 720px) {
  .kx-head-dates dt:not(:first-of-type), .kx-head-dates dd:not(:first-of-type) { display: none; }
  .kx-rail-line { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 12px; border: 1px solid var(--border-input); border-radius: var(--radius); background: var(--surface);
    font: inherit; font-weight: 600; color: var(--ink); text-align: left; }
  .kx-rail:not(.open) > ol { display: none; }
  .kx-rail.open .kx-rail-line .kx-why-x { transform: rotate(90deg); }
  .kx-rail > ol { margin-top: 8px; }
}

/* UI quality audit, important items and polish (10 Nov 2026). */
/* I4: the phone approve bar never covers what the person types */
.kx-bid:has(textarea:focus, input:focus) .kx-bar { display: none; }
.kx-todo { margin: 12px 0; }
.kx-todo ol { list-style: none; margin: 6px 0 0; padding: 0; }
.kx-todo li { display: flex; gap: 6px; align-items: center; min-height: 44px; }
.kx-todo li.done { color: var(--ink-2); }
/* I6: collapsed rows on a phone never break one word a line; a real task is not greyed */
.kx-q.later { color: var(--ink-2); }
@media (max-width: 720px) {
  .kx-q.later { grid-template-columns: minmax(0, 1fr); }
  .kx-q-later-side { justify-content: space-between; }
}
/* I7: a section title is a heading with no heading look of its own */
.kx-sec-title { margin: 0; font: inherit; }
/* I12: tap targets of 44 px on touch screens */
@media (pointer: coarse) {
  .backlink, .kx-srclink, .kx-why > summary, .kx-support > summary, .kx-tip { min-height: 44px; display: inline-flex; align-items: center; }
  .kx-srclink { padding: 12px 0; }
}
/* I14: no empty tinted bar */
.kx-note:empty { display: none; }
/* I15: secondary buttons with a 3:1 boundary */
.btn { border-color: var(--border-input); }
.kx-usual { margin: 0 0 8px; }
.kx-extras > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 6px; padding: 0 4px; color: var(--ink); }
.kx-leave-host:empty { display: none; }
/* P1: sentences in the body font, not mono capitals */
.kx-prop .kx-label, .kx-prop-tag, .kx-item-scope .kx-label { font-family: inherit; text-transform: none; letter-spacing: 0; }
/* P5: the sidebar's focus ring is the app's */
.sidebar :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* P7: card text keeps the reading measure on a wide screen */
.kx-proposals p, .kx-sa-ask p, .kx-decl p, .kx-prop-v { max-width: var(--measure); }
.skip-nav { position: absolute; }
/* I13: the approved plan prints as a record: no navigation, bars or side parts */
/* The print of a plan is a record (recheck 2): actions and navigation go, the plan's own words stay. A section's
   title is a toggle on screen and a heading on paper; a value in a toggletip prints as its words. */
.kx-print-head { display: none; }
@media print {
  .sidebar, .topbar, .kx-rail, .kx-status, .kx-banners, .kx-bar-host, .kx-extras, .kx-extras-wide, .kx-more-host, .kx-aside,
  .kx-lp, .kx-leave-host, .btn, .kx-print, .backlink, .skip-nav, .kx-why-x, .kx-sec-x, .kx-tip-bubble,
  .kx-feedback, .kx-todo, .kx-approve-panel .btn, figcaption .kx-srclink { display: none !important; }
  .kx-print-head { display: block; margin: 0 0 16px; padding: 0 0 12px; border-bottom: 1px solid #000; }
  .kx-print-head p { margin: 2px 0; }
  .kx-sec-b[hidden] { display: block !important; }
  button { all: unset; display: inline; font: inherit; color: inherit; }
  button.kx-sec-h { display: grid; font-weight: 700; break-after: avoid; }
  details > summary { list-style: none; }
  details > summary::-webkit-details-marker { display: none; }
  .card, .kx-sec { break-inside: avoid-page; }
}

/* I8: a loading screen keeps its place, so what comes after is not pushed down */
.kx-screen.kx-loading { min-height: 60vh; }

/* P4: what the score means, beside it; the formats one click away */
.kx-score-wrap { display: inline-flex; gap: 6px; align-items: center; }
.kx-score-what { font-size: 12px; color: var(--ink-2); }
.kx-up-formats > summary { cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; }

/* Every line of the activity is shown whole: it wraps, it is never cut (recheck 2). */
.kx-lp-entry .kx-lp-words, .kx-lp-step-words { min-width: 0; overflow-wrap: anywhere; }
.kx-lp-bar.idle { visibility: hidden; }
.kx-lp-step.next .kx-lp-node { color: var(--ink-3); }
.kx-lp-step.next .kx-lp-step-name { font-weight: 400; color: var(--ink-2); }
/* A line still to come: a quiet bar in the place and the height of a feed line. */
.kx-skel { display: inline-block; height: 8px; width: 5ch; border-radius: 4px; background: var(--bg-2); vertical-align: middle; }
.kx-skel.wide { width: min(60%, 28ch); }
.kx-cond-label, .kx-field-label { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
/* Words that are a sentence or a name read in the body font, not in mono capitals (audit P1). */
.kx-gap-proposed-l { font-weight: 600; color: var(--ink); }
/* The folded extras and other actions show they open, as every other summary does (audit N3). */
.kx-more[open] > summary .kx-why-x, .kx-extras[open] > summary .kx-why-x, .kx-up-formats[open] > summary .kx-why-x { transform: none; }
.kx-more > summary::-webkit-details-marker, .kx-extras > summary::-webkit-details-marker { display: none; }
.kx-more > summary, .kx-extras > summary { list-style: none; }
/* Rules of other topics: the chevron beside its title, which wraps beside it, not under it. */
.kx-sa-outside > summary, .kx-sa-listed > summary { flex-wrap: nowrap; align-items: flex-start; gap: 6px; list-style: none; }
.kx-sa-outside > summary::-webkit-details-marker, .kx-sa-listed > summary::-webkit-details-marker { display: none; }
.kx-sa-outside > summary .kx-why-x, .kx-sa-listed > summary .kx-why-x { margin-top: 2px; flex: none; }
.kx-sa-outside[open] > summary .kx-why-x, .kx-sa-listed[open] > summary .kx-why-x { transform: none; }
.kx-sa-outside-t { min-width: 0; }
.kx-follows > summary { cursor: pointer; min-height: 44px; display: flex; align-items: flex-start; gap: 6px; }
.kx-sa-rate { margin-top: 10px; }
.kx-sa-rates h2 { font-size: 16px; margin: 0 0 8px; }
/* Text that can hold a long URL or identifier breaks inside it, so a page never scrolls sideways (final review). */
.kx-q-sumbody, .kx-q-sumv, .kx-q-title, .kx-q-text, .kx-quote, .kx-quote blockquote, .kx-quote figcaption, .kx-srclink,
.kx-sa-rule, .kx-decl-item, .kx-why, .kx-banner-b, .kx-banner-next, .kx-files, .kx-filerow, .kx-up-name, .kx-lp-words,
.kx-gap-proposed, .kx-plansum-k, .kx-dr, .excerpt-text, .pfact-value { overflow-wrap: anywhere; min-width: 0; }
/* The bid's funding rate (release 0.1.18): options as tiles, the settled one with who settled it. */
.kx-rate-options { display: grid; gap: 10px; margin: 12px 0; }
.kx-rate-opt { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; padding: 12px; border: 1px solid var(--line);
  border-radius: 4px; cursor: pointer; min-width: 0; }
div.kx-rate-opt { grid-template-columns: minmax(0, 1fr); cursor: default; }
.kx-rate-opt:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.kx-rate-opt input { margin-top: 3px; width: 18px; height: 18px; }
.kx-rate-opt-b, .kx-rate-settled { min-width: 0; overflow-wrap: anywhere; }
.kx-rate-opt-b p, .kx-rate-settled p { margin: 0 0 6px; }
.kx-rate-tag { display: inline-block; margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--accent); }
.kx-rate-settled { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 4px; }
.kx-rate-defect { margin: 8px 0; padding: 10px 12px; border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: 4px; }

/* The route error page's title is its h1, at the size the strong line had. */
.error-state-title { font-size: 1rem; font-weight: 700; margin: 0; }

/* A data table in a narrow card becomes rows, as on a phone, whatever the page's width: its last column (the actions)
   is never past the card's edge behind a sideways scroll (organisation page, people). The container is the wrap. */
.table-wrap.rows-when-narrow { container-type: inline-size; overflow-x: visible; }
@container (max-width: 720px) {
  .rows-when-narrow table { display: block; width: 100%; border: 0; }
  .rows-when-narrow table thead { display: none; }
  .rows-when-narrow table tbody { display: block; }
  .rows-when-narrow table tbody tr {
    display: block; margin: 0 0 10px; padding: 4px 13px; border: 1px solid var(--line);
    border-radius: var(--radius); background: var(--surface);
  }
  .rows-when-narrow table tbody tr:last-child { margin-bottom: 0; }
  .rows-when-narrow table td {
    display: block; padding: 8px 0; border-bottom: 1px solid var(--line);
    text-align: left; white-space: normal; word-break: break-word;
  }
  .rows-when-narrow table td:last-child { border-bottom: 0; }
  .rows-when-narrow table td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 3px;
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3);
  }
  .rows-when-narrow table td:first-child { padding-bottom: 10px; margin-bottom: 2px; }
  .rows-when-narrow table td:first-child::before { content: none; }
  .rows-when-narrow table td.right { text-align: left; }
}
/* A row's cell with nothing in it (no action on one's own row) shows no bare label. */
@media (max-width: 720px) { .table-wrap table td:empty { display: none; } }
@container (max-width: 720px) { .rows-when-narrow table td:empty { display: none; } }

.kx-msg-pick { display: grid; gap: 6px; margin: 8px 0 12px; }
.kx-msg-pick select { max-width: 100%; }

/* ── The Draft view (mock v1 of 13 Nov 2026, UI-SPEC.md; static/assets/js/draft_view.js) ─────────────────────
   One type scale (11 mono labels, 12, 13, 14 UI, 15 and 16 draft text, 16 section heading, 18 run title, 30 clock),
   one spacing scale (4, 8, 12, 16, 20, 24), Kairos tokens only, one radius. Every place a section takes is reserved
   before its text arrives; the map's tiles keep their height; motion eases and is off under reduced motion. */
.kx-dv { display: flex; flex-direction: column; gap: 12px; min-width: 0; font-variant-numeric: tabular-nums; }
.kx-dv-col { gap: 12px; }
/* On the Draft view the run card carries the live step: the rail's copy of it would grow and shrink above the
   document as steps change, moving the text the person reads. */
.kx-bid:has(.kx-dv) .kx-phase-live { display: none; }
.kx-dv-skel-meta { display: block; height: 18px; margin: 4px 0 8px; }
.kx-dv-q:empty { display: none; }
.kx-dv-run-h { display: flex; gap: 12px 24px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.kx-dv-run-t { min-width: 0; flex: 1 1 320px; }
.kx-dv-title { margin: 0; font-size: 18px; line-height: 1.3; outline: none; }
.kx-dv .kx-dv-sub { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); max-width: 70ch; }
.kx-dv-clock { text-align: right; flex: 0 0 auto; }
.kx-dv-clock > div { display: flex; align-items: baseline; gap: 6px; justify-content: flex-end; }
.kx-dv-clock-v { font-size: 30px; line-height: 1.1; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.kx-dv-clock-of { font-size: 13px; color: var(--ink-2); }
.kx-dv-clock-note { display: block; font-size: 12px; color: var(--ink-2); margin-top: 2px; max-width: 32ch; margin-left: auto; }
.kx-dv.is-over .kx-dv-clock-v, .kx-dv.is-over .kx-dv-clock-note { color: var(--warn); }
.kx-dv-time { margin-top: 16px; }
.kx-dv-bar { position: relative; height: 10px; background: var(--bg-2); border-radius: var(--radius); overflow: hidden; }
.kx-dv-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--brand); border-radius: var(--radius);
  transition: width .6s var(--kx-ease); }
.kx-dv-over { position: absolute; top: 0; bottom: 0; width: 0; background: var(--kx-amber); transition: width .6s var(--kx-ease); }
.kx-dv.is-ready .kx-dv-fill { background: var(--ok); }
.kx-dv-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.kx-dv-stages { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
  font-size: 13px; color: var(--ink-2); }
.kx-dv-stages li { display: flex; gap: 6px; align-items: center; min-width: 0; transition: color .3s var(--kx-ease); }
.kx-dv-stages li .kx-ico { color: var(--ink-3); flex: 0 0 auto; }
.kx-dv-stages li.now { color: var(--brand); font-weight: 600; }
.kx-dv-stages li.now .kx-ico { color: var(--brand); }
.kx-dv-stages li.past { color: var(--ink); }
.kx-dv-stages li.past .kx-ico { color: var(--ok); }
.kx-dv-stages li.missing { color: var(--ink); }
.kx-dv-stages li.missing .kx-ico { color: var(--warn); }
.kx-dv .kx-dv-now { margin: 12px 0 0; font-size: 14px; color: var(--ink); text-wrap: balance; }
.kx-dv-err { margin: 12px 0 0; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.kx-dv-err strong { display: inline; }
.kx-dv-map { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.kx-dv-map:empty { display: none; }
.kx-dv-map li { display: flex; min-width: 0; }
.kx-dv-tile { width: 100%; min-height: 64px; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 4px 8px; align-content: start;
  text-align: left; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; color: var(--ink); cursor: pointer; transition: background-color .3s var(--kx-ease), border-color .3s var(--kx-ease); }
.kx-dv-tile:hover { border-color: var(--brand-line); }
.kx-dv-tile:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.kx-dv-tile-g { color: var(--ink-3); margin-top: 1px; transition: color .3s var(--kx-ease); }
.kx-dv-tile-t { font-size: 13px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.kx-dv-tile-s { grid-column: 2; font-size: 12px; color: var(--ink-2); line-height: 1.3; }
.kx-dv-tile[data-st="st-write"], .kx-dv-tile[data-st="st-retry"] { background: var(--brand-soft); border-color: var(--brand-line); }
.kx-dv-tile[data-st="st-write"] .kx-dv-tile-g, .kx-dv-tile[data-st="st-check"] .kx-dv-tile-g { color: var(--brand); }
.kx-dv-tile[data-st="st-ready"] .kx-dv-tile-g, .kx-dv-tile[data-st="st-asked"] .kx-dv-tile-g, .kx-dv-tile[data-st="st-new"] .kx-dv-tile-g { color: var(--ok); }
.kx-dv-tile[data-st="st-attn"] .kx-dv-tile-g, .kx-dv-tile[data-st="st-retry"] .kx-dv-tile-g { color: var(--kx-amber); }
.kx-dv-tile[data-st="st-person"] .kx-dv-tile-g { color: var(--danger); }
.kx-dv-tile[data-st="st-wait"] .kx-dv-tile-t { font-weight: 500; color: var(--ink-2); }

/* The done summary. */
.kx-dv-done:empty { display: none; }
.kx-dv-done-in { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--line); align-items: start; }
.kx-dv-done-col { min-width: 0; }
.kx-dv-h3 { font-size: 14px; margin: 0 0 8px; }
.kx-dv-done-col .kx-dv-h3 ~ .kx-dv-h3 { margin-top: 16px; }
.kx-dv .kx-dv-small { font-size: 13px; line-height: 1.5; margin: 0 0 8px; }
.kx-dv-weak { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.kx-dv-weak ul { margin: 2px 0 0; padding-left: 18px; color: var(--ink-2); }
.kx-dv-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--brand); cursor: pointer; text-align: left;
  text-decoration: underline; text-underline-offset: 2px; }
.kx-dv-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.kx-dv-copies { display: flex; flex-direction: column; gap: 8px; align-items: stretch; margin-bottom: 8px; }
.kx-dv-copy { justify-content: flex-start; text-align: left; white-space: normal; height: auto; min-height: 40px; }
.kx-dv-copy-n { flex: 1 1 auto; }
.kx-dv-copy-s { font-size: 12px; color: var(--ink-2); flex: 0 0 auto; }
.kx-dv-reason { padding: 8px 12px; background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius); }
.kx-dv-pages { margin-top: 16px; }
.kx-dv-cells { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 8px; }
.kx-dv-cell { width: 12px; height: 16px; border: 1px solid var(--line-strong); border-radius: 1px; background: var(--surface); }
.kx-dv-cell.on { background: var(--brand); border-color: var(--brand); }
.kx-dv-cell.on.past { background: var(--kx-amber); border-color: var(--kx-amber); }
.kx-dv-cell.past:not(.on) { border-style: dashed; }
.kx-dv-overw { color: var(--warn); font-weight: 600; }

/* Document and live log. */
.kx-dv-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.kx-dv-doc { min-width: 0; container-type: inline-size; container-name: kxdoc; }
.kx-dv-doc-h { display: flex; gap: 4px 16px; justify-content: space-between; align-items: baseline; flex-wrap: wrap; }
.kx-dv-doc-h h2 { margin: 0; font-size: 16px; }
.kx-dv .kx-dv-doc-note { font-size: 12px; margin: 0; }
.kx-dv-sec { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); scroll-margin-top: 76px; }
.kx-dv-sec-h { display: flex; gap: 4px 12px; justify-content: space-between; align-items: baseline; flex-wrap: wrap; }
.kx-dv-sec-h h3 { margin: 0; font-size: 16px; line-height: 1.35; display: flex; gap: 8px; outline: none; min-width: 0; overflow-wrap: anywhere; }
.kx-dv-sec-h h3:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.kx-dv-num { font-size: 13px; color: var(--ink-2); padding-top: 2px; }
.kx-dv-tag { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.kx-dv-tag[data-st="st-write"], .kx-dv-tag[data-st="st-check"] { color: var(--brand); }
.kx-dv-tag[data-st="st-ready"], .kx-dv-tag[data-st="st-asked"], .kx-dv-tag[data-st="st-new"] { color: var(--ok); }
.kx-dv-tag[data-st="st-attn"], .kx-dv-tag[data-st="st-retry"] { color: var(--warn); }
.kx-dv-tag[data-st="st-person"] { color: var(--danger); }
.kx-dv .kx-dv-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); margin: 4px 0 0; }
.kx-dv-meta span { display: inline-flex; gap: 4px; align-items: center; }
.kx-dv-meta .over { color: var(--warn); font-weight: 600; }
.kx-dv-sec-b { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px 20px; margin-top: 12px; }
@container kxdoc (min-width: 640px) {
  .kx-dv-sec-b.has-notes { grid-template-columns: minmax(0, 1fr) 220px; }
  .kx-dv-notes { position: sticky; top: 76px; }
}
.kx-dv-sec-main { min-width: 0; }
.kx-dv .kx-dv-text p, .kx-dv .kx-dv-diff { font-size: 15px; line-height: 1.65; margin: 0 0 12px; max-width: var(--measure); overflow-wrap: anywhere; color: var(--ink); }
.kx-dv-text .kx-dv-li { padding-left: 18px; position: relative; }
.kx-dv-text .kx-dv-li::before { content: "\2022"; position: absolute; left: 4px; }
.kx-dv-diff del.chg { background: var(--danger-bg); color: var(--ink); text-decoration-color: var(--danger); }
.kx-dv-diff ins.chg { background: var(--ok-bg); color: var(--ink); text-decoration: none; box-shadow: inset 0 -2px 0 var(--ok-line); }
.kx-dv .kx-dv-meta .kx-dv-unchecked { color: var(--ink); background: var(--bg-2); padding: 0 6px; border-radius: var(--radius); }
.kx-dv-rev { padding: 8px 12px; border-left: 3px solid var(--brand); background: var(--brand-soft); margin: 0 0 12px; font-size: 13px; }
.kx-dv .kx-dv-rev p { margin: 0; }
.kx-dv-rev p + p { margin-top: 4px; }
.kx-dv-table, .kx-dv-person { display: flex; gap: 8px; align-items: flex-start; padding: 12px; border: 1px dashed var(--line-strong);
  border-radius: var(--radius); font-size: 14px; }
.kx-dv .kx-dv-table p, .kx-dv .kx-dv-person p { margin: 0; }
.kx-dv-person { border: 1px solid var(--danger-line); background: var(--danger-bg); }
.kx-dv-person .kx-ico { color: var(--danger); margin-top: 2px; }
.kx-dv-sec-acts { margin-top: 12px; }
/* Ask for a change, in place: the composer right under the section's text, then the section's own word that it is
   being rewritten; the text stays readable (only dimmed a little) until the new version takes its place. */
.kx-dv-ask { margin-top: 12px; padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); max-width: var(--measure); display: grid; gap: 8px; }
.kx-dv-ask[hidden], .kx-dv-ask-st[hidden] { display: none; }
.kx-dv .kx-dv-ask p { margin: 0; }
.kx-dv-ask-l { overflow-wrap: anywhere; }
.kx-dv-ask textarea { width: 100%; min-height: 76px; }
.kx-dv-ask textarea[readonly] { color: var(--ink-2); background: var(--surface-2); }
.kx-dv-ask-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.kx-dv .kx-dv-ask-err { margin: 0; }
.kx-dv-ask-st { margin-top: 12px; max-width: var(--measure); outline: none; }
.kx-dv-ask-st:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.kx-dv-ask-rw { padding: 10px 12px; border-left: 3px solid var(--brand); background: var(--brand-soft); font-size: 13px; display: grid; gap: 4px; }
.kx-dv .kx-dv-ask-rw p { margin: 0; }
.kx-dv .kx-dv-ask-rw-t { display: flex; gap: 6px; align-items: center; font-weight: 600; color: var(--brand); font-size: 14px; }
.kx-dv .kx-dv-ask-qh { margin-top: 4px; }
.kx-dv-ask-q { margin: 0; padding-left: 10px; border-left: 2px solid var(--brand-line); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.kx-dv-sec .kx-dv-sec-main { transition: opacity .3s var(--kx-ease); }
.kx-dv-sec.is-rewriting .kx-dv-sec-main { opacity: .62; }
@media (max-width: 640px) {
  .kx-dv-ask { padding: 10px; }
  .kx-dv-ask-acts .btn { flex: 1 1 auto; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .kx-dv-sec .kx-dv-sec-main { transition: none; } }
.kx-dv-notes.folded summary { display: flex; gap: 6px; align-items: center; min-height: 32px; font-size: 13px; font-weight: 600;
  color: var(--warn); cursor: pointer; list-style: none; }
.kx-dv-notes.folded summary::-webkit-details-marker { display: none; }
.kx-dv-notes.folded[open] summary .kx-why-x { transform: rotate(90deg); }
.kx-dv-notes.folded summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.kx-dv-notes.folded ul { margin-top: 8px; }
.kx-dv-notes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.kx-dv-note { padding: 8px 12px; border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: var(--radius); font-size: 13px; }
.kx-dv-note.k-claim, .kx-dv-note.k-person { border-color: var(--danger-line); background: var(--danger-bg); }
.kx-dv-note.k-unchecked { border-color: var(--line-strong); background: var(--bg-2); }
.kx-dv-note.k-unchecked .kx-dv-note-k { color: var(--ink-2); }
.kx-dv .kx-dv-wait { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; padding: 8px 12px; font-size: 14px;
  background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius); }
.kx-dv-wait .kx-ico { color: var(--warn); margin-top: 2px; }
.kx-dv-waiting:empty { display: none; }
.kx-dv-note.k-table { border-style: dashed; border-color: var(--line-strong); background: var(--surface); }
.kx-dv .kx-dv-note p { margin: 4px 0 0; line-height: 1.45; }
.kx-dv-note-k { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--warn); }
.kx-dv-note.k-claim .kx-dv-note-k, .kx-dv-note.k-person .kx-dv-note-k { color: var(--danger); }
.kx-dv-note.k-table .kx-dv-note-k { color: var(--ink-2); }
.kx-dv-note-lane { display: flex; gap: 4px; align-items: center; font-size: 12px; color: var(--ink-2); }
.kx-dv-note-cav { font-size: 12px; color: var(--ink-2); }

/* A section before its text: the place it will take, reserved. */
.kx-dv-skel { padding: 0 0 8px; }
.kx-dv .kx-dv-skel-w { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--brand); margin: 0 0 8px; }
.kx-dv-skel.paused .kx-dv-skel-w { color: var(--warn); }
.kx-dv-skel-lines i { display: block; height: 11px; margin: 7px 0; border-radius: 2px; max-width: var(--measure);
  background: linear-gradient(90deg, var(--bg-2) 0%, var(--brand-soft) 50%, var(--bg-2) 100%); background-size: 200% 100%;
  animation: kx-dv-shimmer 1.8s linear infinite; }
.kx-dv-skel-lines i.short { width: 62%; }
.kx-dv-sec[data-st="st-wait"] .kx-dv-skel-lines i, .kx-dv-skel.paused .kx-dv-skel-lines i { animation: none; background: var(--bg-2); }
@keyframes kx-dv-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.kx-dv-arrive .kx-dv-text, .kx-dv-arrive .kx-dv-diff { animation: kx-dv-in .56s var(--kx-ease) both; }
@keyframes kx-dv-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.kx-dv-log { position: sticky; top: 76px; min-width: 0; }
.kx-dv-log-h { font-size: 16px; margin: 0 0 4px; }
.kx-dv .kx-dv-log-now { font-size: 12px; color: var(--ink-2); margin: 0 0 8px; }
.kx-dv-log-list { list-style: none; margin: 0; padding: 0; max-height: min(60vh, 560px); overflow-y: auto; overscroll-behavior: contain; }
.kx-dv-log-list li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-top: 1px solid var(--line);
  font-size: 13px; line-height: 1.4; animation: kx-dv-in .3s var(--kx-ease) both; }
.kx-dv-log-list li:first-child { border-top: 0; }
.kx-dv-log-list time { font-size: 11px; color: var(--ink-3); padding-top: 2px; }
.kx-dv-log-w { overflow-wrap: anywhere; }
.kx-dv-log-more { margin-top: 8px; }

@media (max-width: 1099px) { .kx-dv-grid { grid-template-columns: minmax(0, 1fr) 260px; } }
@media (max-width: 899px) {
  .kx-dv-grid { grid-template-columns: minmax(0, 1fr); }
  .kx-dv-log { position: static; order: -1; }
  .kx-dv-log-list { max-height: none; }
  .kx-dv-done-in { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .kx-dv-clock { text-align: left; }
  .kx-dv-clock > div { justify-content: flex-start; }
  .kx-dv-clock-note { margin-left: 0; }
  .kx-dv-stages { grid-template-columns: repeat(4, auto); justify-content: space-between; }
  .kx-dv-stages li:not(.now) .kx-dv-stage-w { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .kx-dv-map { grid-template-columns: minmax(0, 1fr); }
  .kx-dv-tile { min-height: 56px; }
  /* The lines that change as checks land keep the height of their longest form, so the text below does not move. */
  .kx-dv .kx-dv-meta { min-height: 54px; align-content: flex-start; }
  .kx-dv .kx-dv-skel-meta { height: 54px; }
  .kx-dv .kx-dv-now { min-height: 42px; }
  .kx-dv .kx-dv-skel-w { min-height: 40px; align-items: flex-start; }
  .kx-dv .kx-dv-log-list li { min-height: 52px; border-top: 0; }
  .kx-dv .kx-dv-text p, .kx-dv .kx-dv-diff { font-size: 16px; line-height: 1.6; }
}
@media (prefers-reduced-motion: reduce) {
  .kx-dv-fill, .kx-dv-over, .kx-dv-tile, .kx-dv-tile-g, .kx-dv-stages li { transition: none; }
  .kx-dv-skel-lines i, .kx-dv-arrive .kx-dv-text, .kx-dv-arrive .kx-dv-diff, .kx-dv-log-list li { animation: none; }
}

/* Files sent with a message (engine item message-attachments): the attach button and drop zone, then one row per file. */
.kx-msg-attach { margin: 12px 0; }
.kx-msg-attach h3 { margin: 0; font-size: 15px; }
.kx-msg-attach > p { margin: 4px 0 0; }
.kx-msg-drop {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; padding: 12px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2);
}
.kx-msg-drop.over { border-style: solid; border-color: var(--ink-2); }
.kx-msg-drop .btn { display: inline-flex; align-items: center; gap: 6px; }
.kx-msg-files { margin-top: 8px; }
.kx-msg-chip > div { min-width: 0; overflow-wrap: anywhere; }
.kx-msg-chip p { margin: 4px 0 0; }
.kx-msg-progress { display: block; width: 100%; max-width: 240px; height: 6px; margin-top: 6px; }
@media (max-width: 720px) {
  .kx-msg-chip { grid-template-columns: minmax(0, 1fr); }
  .kx-msg-chip .btn { justify-self: start; }
}

/* The signing declaration by the call's own sections (engine item declaration-groups, 14 Nov 2026): one card per
   section, confirmed in one step; its conditions open on demand; open points first. Colour always with words. */
.kx-decl-meter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0 4px; }
.kx-decl-meter progress { flex: 0 1 240px; height: 6px; appearance: none; border: 0; border-radius: var(--radius); background: var(--surface-2); }
.kx-decl-meter progress::-webkit-progress-bar { background: var(--surface-2); border-radius: var(--radius); }
.kx-decl-meter progress::-webkit-progress-value { background: var(--ok); border-radius: var(--radius); }
.kx-decl-meter progress::-moz-progress-bar { background: var(--ok); }
.kx-decl-meter p { margin: 0; color: var(--ink-2); }
.kx-decl-points { margin: 16px 0 0; padding: 12px 16px; border: 1px solid var(--warn-line); border-left-width: 4px;
  border-radius: var(--radius); background: var(--warn-bg); }
.kx-decl-points h3 { margin: 0 0 4px; font-size: 15px; }
.kx-decl-points .kx-decl-item:first-child { border-top: 0; }
.kx-decl-groups { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.kx-decl-group { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 14px 16px; }
.kx-decl-group[data-done="true"] { border-color: var(--ok-line); }
.kx-decl-gh { display: grid; gap: 4px; }
.kx-decl-gh h3 { margin: 0; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.kx-decl-where { margin: 0; font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.kx-decl-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 4px; }
.kx-decl-count { font-size: 12px; color: var(--ink-2); }
.kx-decl-rows { margin-top: 8px; }
.kx-decl-rows > summary, .kx-decl-aside > summary { cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; color: var(--accent); list-style: none; }
.kx-decl-rows > summary::-webkit-details-marker, .kx-decl-aside > summary::-webkit-details-marker { display: none; }
.kx-decl-rows[open] > summary .kx-why-x, .kx-decl-aside[open] > summary .kx-why-x { transform: rotate(180deg); }
.kx-decl-st { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; margin: 0 0 4px; }
.kx-decl-st > span:first-child { max-width: var(--measure); }
.kx-decl-pg { flex: none; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.kx-decl-item[data-state="holds"] .kx-decl-st > span:first-child { color: var(--ink-2); }
.kx-decl-item .kx-chip { margin: 4px 0; }
.kx-decl-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.kx-decl-acts .btn { min-height: 44px; }
.kx-decl-gact { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.kx-decl-gact .btn { min-height: 44px; }
.kx-decl-legal { margin: 16px 0 0; }
@media (max-width: 640px) {
  .kx-decl-group { padding: 12px; }
  .kx-decl-gact .btn { width: 100%; justify-content: center; }
  .kx-decl-st { display: block; }
  .kx-decl-pg { display: block; margin-top: 2px; }
  .kx-decl-acts .btn { flex: 1 1 140px; justify-content: center; }
}

/* Earlier choices to make again (lane A, set_aside_card.choose_again): at the top of their card, words and quote. */
.kx-again { margin: 8px 0 12px; }
.kx-again-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.kx-again-list .kx-quote { margin: 0; }

/* A standard document's one statement (engine declaration-groups, amendment 2). */
.kx-decl-statement { margin: 10px 0 2px; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft);
  border-radius: var(--radius); }
.kx-decl-statement p { margin: 0; max-width: var(--measure); }
.kx-decl-statement p + p { margin-top: 4px; }

/* Amendment 3: each group a fieldset (L4), every control of the declaration at least 44 px at every width (L5). */
.kx-decl-fs { border: 0; margin: 0; padding: 0; min-width: 0; }
.kx-decl-legend { padding: 0; float: left; width: 100%; }
.kx-decl-legend + * { clear: both; }
.kx-decl-legend h3 { margin: 0; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.kx-decl .btn, .kx-decl summary, .kx-decl .kx-why > summary, .kx-decl .kx-open-doc { min-height: 44px; }
.kx-decl .kx-why > summary { display: inline-flex; align-items: center; gap: 6px; }
.kx-decl-shown { margin-top: 6px; }

/* Missing facts panel (owner, 16 Nov 2026): every item in full, its words above a full-width field; the send button
   stays in reach at the bottom of the panel however long the list. */
.kx-gaps-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 14px; }
.kx-gaps-list > .kx-gaps-row { display: block; }
.kx-gaps-row label { display: block; font-weight: 600; font-size: 14px; line-height: 1.4; margin-bottom: 6px; overflow-wrap: anywhere; }
.kx-gaps-input { width: 100%; box-sizing: border-box; }
.kx-gaps-filling { display: flex; align-items: center; gap: 6px; margin: 0; }
.kx-gaps-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; padding: 12px 0 4px; margin-top: 8px; background: var(--surface); border-top: 1px solid var(--line); }

/* ── Source pop-up (source_viewer.js): a call document opened on the quoted passage ─────── */
.srcv-back { padding: 2vh 2vw; }
.srcv-wrap { display: contents; }
.modal.srcv {
  max-width: min(1100px, 96vw); width: 100%; height: 94vh; max-height: 94vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.srcv-head { gap: 12px; }
.srcv-id { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.srcv-ico { color: var(--accent); margin-top: 2px; }
.srcv-title { display: block; overflow-wrap: anywhere; }
.srcv-search { padding: 10px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; background: var(--surface); }
.srcv-bar { display: flex; align-items: center; gap: 8px; }
.srcv-find { color: var(--ink-3); display: inline-flex; }
.srcv-input { flex: 1; min-width: 0; }
.srcv-count { font-size: 12px; color: var(--ink-2); white-space: nowrap; min-width: 4.5em; text-align: right; }
.srcv-quote { font-size: 12px; color: var(--ink-2); line-height: 1.45; max-height: 7.5em; overflow-y: auto; }
.srcv-status { font-size: 12px; color: var(--ink-2); min-height: 1.2em; }
.srcv-stage { flex: 1; min-height: 0; background: var(--surface-2); }
.srcv-pages { height: 100%; overflow: auto; padding: 16px; outline: none; }
.srcv-page { position: relative; margin: 0 auto 14px; background: #fff; box-shadow: 0 1px 3px rgba(22,32,43,.18); }
.srcv-canvas { display: block; width: 100%; height: 100%; }
.srcv-wait { display: grid; gap: 10px; width: min(420px, 80%); margin: 18vh auto 0; }
.srcv-other { padding: 40px 20px; }
.srcv-feedback {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 18px; border-top: 1px solid var(--line); background: var(--surface);
}
.srcv-fb-ask { font-size: 13px; font-weight: 600; }
.srcv-fb-no { display: grid; gap: 8px; width: 100%; }
.srcv-fb-no textarea { width: 100%; }
.srcv-fb-no .row { justify-content: flex-end; }
.srcv-thanks { font-size: 13px; color: var(--ok); }
@media (max-width: 640px) {
  .srcv-back { padding: 0; }
  .modal.srcv { max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .srcv-pages { padding: 8px; }
}

/* pdf.js text layer (from pdfjs-dist web/pdf_viewer.css, trimmed): transparent text over the
   canvas, so the words can be selected and the search hits drawn under them. */
.textLayer {
  position: absolute; text-align: initial; inset: 0; overflow: clip; opacity: 1; line-height: 1;
  -webkit-text-size-adjust: none; text-size-adjust: none; forced-color-adjust: none;
  transform-origin: 0 0; caret-color: CanvasText; z-index: 0;
}
.textLayer :is(span, br) { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; }
.textLayer > :not(.markedContent), .textLayer .markedContent span:not(.markedContent) { z-index: 1; }
.textLayer span.markedContent { top: 0; height: 0; }
.textLayer .highlight {
  position: initial; margin: -1px; padding: 1px; border-radius: 3px;
  background-color: rgb(250 204 21 / 0.45);
}
.textLayer .highlight.selected { background-color: rgb(234 88 12 / 0.45); box-shadow: 0 0 0 2px rgb(234 88 12 / 0.55); }
.textLayer ::selection { background: rgb(37 71 160 / 0.25); }
.textLayer br::selection { background: transparent; }

/* Answers given in calls (views/call_answers.js) */
.ca-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ca-edit { display: flex; flex-direction: column; gap: 10px; min-width: min(420px, 80vw); }
.ca-input { width: 100%; }
.ca-error { color: var(--danger, #b42318); margin: 0; min-height: 1em; }
.ca-card .pfs-group-t { margin-top: 0; }
.efact-was { grid-column: 1 / -1; font-size: 12px; color: var(--ink-2); }
