/* The page patterns of the portal (02-foundations/portal-shell.md): the page header and grid, the dashboard (stat tiles, the liveliness strip, charts),
   the data table, the queue row and the row-like pieces (anomaly, calendar entry). Buttons, the status pill and the card are the shared primitives
   (../../shared/components.css). Prefixes pt- / st- / lv / ch / q- / an / cal.
   Dense sizes are the density scale (tokens §3.3): 40 dp rows, 36 dp controls, Body Table 13 / 18. The controls read the --dn-* custom properties that the dense scope of
   ../../shared/components.css sets inside the portal's .pb-dense region (from 1024 dp in either Density setting, from 768 dp and a fine pointer under Compact), with the
   regular 44 dp size as the var() fallback: --dn-control for what was already 36 dp from 1024 dp, --dn-field for what Compact now shrinks. Tokens only. */
/* ---------- page header, grid, the card's header row (buttons, pill and card: shared/components.css) ---------- */
.pt-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; padding: 8px 0 16px; }
.pt-head h1 { margin: 0; font-size: calc(24px * var(--font-scale)); line-height: 1.33; font-weight: 700; letter-spacing: -0.02em; }
.pt-head .sub { font-size: calc(14px * var(--font-scale)); color: var(--text-secondary); }
.pt-head .acts { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pt-seg { display: inline-flex; max-width: 100%; box-sizing: border-box; overflow-x: auto; scrollbar-width: none; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--edge); }
.pt-seg .btn { min-height: var(--dn-field, 44px); box-shadow: none; background: transparent; }   /* 44 dp (52 with the frame); 36 dp (44 with the frame) under Compact from 768 dp and a fine pointer */
.pt-seg .btn[aria-checked="true"] { background: var(--primary); color: var(--on-primary); }
.pt-seg.fill { display: flex; } .pt-seg.fill .btn { flex: 1 1 0; }   /* the track fills its panel and the choices share it equally (the Density row of Settings) */   /* a choice (role="radio", the Density row of Settings) as the pressed state of a toggle */
.pt-seg .btn[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.sr-only { position: absolute; inset-inline-start: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }   /* inset-inline-start: 0 (2026-10-13, Payments 02 to 05): the hidden header of an actions column in a table wider than its card took its static position past the viewport and made the page scroll sideways at 1280; pinned to the start edge it stays invisible and inside the page (diff.py, 35 pages, 0 real) */
.pt-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.pt-grid > * { grid-column: span 12; min-width: 0; }
/* a dashboard card is the shared .card (components.css) with .pt-card for its header row */
.pt-card h2 { margin: 0; font-size: calc(16px * var(--font-scale)); font-weight: 700; display: flex; align-items: center; gap: 8px; min-width: 0; }
.pt-card h2 .ico { font-size: 18px; color: var(--text-secondary); }
.pt-card .h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.pt-card .h .more { margin-inline-start: auto; }
.pt-card .h > .pt-meta { flex: 1 1 0; min-width: 120px; }   /* the line beside a card's title takes the room that is left and wraps inside it, so the card's link or icon stays on the title's line (Today, What waits for a person: Queues dropped to a line of its own, 2026-11-13) */
.pt-meta { font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }   /* a card's small secondary line; .meta is the shared card meta row (components.css), a different thing */
/* ---------- the liveliness strip: what went live today, per module ---------- */
.lv { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.lv::-webkit-scrollbar { display: none; }
.lv a { flex: 0 0 auto; min-width: 128px; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--accent, var(--primary)) 8%, var(--surface)); box-shadow: inset 0 0 0 1px var(--edge); }
.lv a .k { display: flex; align-items: center; gap: 8px; font-size: calc(12px * var(--font-scale)); font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.lv a .k .ico { color: var(--accent, var(--primary)); font-size: 16px; }
.lv a .n { font-size: calc(20px * var(--font-scale)); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.lv a .n small { font-size: calc(12px * var(--font-scale)); font-weight: 600; color: var(--text-secondary); margin-inline-start: 4px; letter-spacing: 0; }
.lv a.stale { background: var(--warning-container); }
.lv a.stale .n { font-size: calc(14px * var(--font-scale)); font-weight: 700; letter-spacing: 0; line-height: 1.3; max-width: 14ch; }   /* a sentence, not a number: at the number's 20 sp it wrapped to three lines and made every tile of the row taller */
.lv a.stale .k .ico, .lv a.stale .n { color: var(--warning-text); }
/* ---------- stat tile (PbStatTile): the number, its period and source, the change ---------- */
.st-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.st-tile { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--edge); min-width: 0; }
.st-tile .k { font-size: calc(12px * var(--font-scale)); font-weight: 600; color: var(--text-secondary); display: flex; gap: 8px; align-items: center; }
.st-tile .n { overflow-wrap: anywhere; font-size: calc(28px * var(--font-scale)); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.st-tile .n small { display: inline-block; font-size: calc(13px * var(--font-scale)); font-weight: 600; color: var(--text-secondary); letter-spacing: 0; margin-inline-start: 3px; }   /* inline-block (2026-11-14): the unit moves to the next line whole, never "joine / d" under the number's overflow-wrap */
.pm-tiles .st-tile .n small { display: block; margin: 0; }   /* a money tile: the count sits under the amount in every tile, never beside it in one and under it in the next (2026-11-14) */
.st-tile .d { display: inline-flex; align-items: center; gap: 4px; font-size: calc(12px * var(--font-scale)); font-weight: 600; padding: 2px 8px; border-radius: 999px; align-self: flex-start; background: color-mix(in srgb, var(--text-secondary) 12%, transparent); color: var(--text-secondary); }
.st-tile .d.up { background: var(--success-container); color: var(--success-text); }
.st-tile .d.down { background: var(--error-container); color: var(--error-text); }
.st-tile .d .ico { font-size: 14px; }
.st-tile .src { font-size: calc(11px * var(--font-scale)); color: var(--text-secondary); }
.st-tile.hit .n { color: var(--success-text); } .st-tile.miss .n { color: var(--error-text); }
/* ---------- queue rows (PbQueueRow): the summary form on Today ---------- */
.q-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 4px; border-radius: 12px; }
.q-row + .q-row { box-shadow: 0 -1px 0 var(--border); border-radius: 0; }
.q-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.q-row .ic { width: 36px; height: 36px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent, var(--primary)) 14%, transparent); color: var(--accent, var(--primary)); flex-shrink: 0; }
.q-row .ic .ico { font-size: 18px; }
.q-row .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.q-row .t b { font-size: calc(14px * var(--font-scale)); font-weight: 600; overflow-wrap: anywhere; }   /* a queue's name wraps on a phone, never ends in an ellipsis (2026-11-15: Tamil "Refund requests" was cut) */
.q-row .t span { font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); overflow-wrap: anywhere; }   /* the line under a queue's name wraps: "3 drafts n…" hid what was waiting */
.q-row .n { font-size: calc(18px * var(--font-scale)); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-row .n small { font-size: calc(11px * var(--font-scale)); color: var(--text-secondary); font-weight: 600; margin-inline-start: 4px; }
.q-row > .ico { color: var(--text-secondary); font-size: 18px; }
/* ---------- chart (PbChart): bars with a tooltip on every mark, a sparkline ---------- */
.ch { display: flex; flex-direction: column; gap: 2px; }
.ch-row { display: grid; grid-template-columns: minmax(96px, 128px) 1fr auto; align-items: center; gap: 12px; min-height: var(--dn-control, 44px); position: relative; border-radius: 8px; color: inherit; }   /* the row is the hit target, taller than its 14 dp bar: 44 dp, the 36 dp dense control on Expanded */
button.ch-row { width: 100%; text-align: start; }   /* a row that filters is a button: it fills the card like the link row does */
.ch-row .lbl { font-size: calc(13px * var(--font-scale)); color: var(--text-secondary); line-height: 1.25; overflow-wrap: anywhere; }   /* a chart row's label wraps to a second line, never ends in an ellipsis (2026-11-15: Tamil "Seats granted" and "2 weeks ago" were cut) */
.ch-row .track { height: 14px; display: flex; align-items: center; }
.ch-row .bar { height: 14px; border-start-end-radius: 4px; border-end-end-radius: 4px; background: var(--primary); min-width: 4px; }
.ch-row .val { font-size: calc(13px * var(--font-scale)); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ch-row .val small { font-weight: 600; color: var(--text-secondary); margin-inline-start: 6px; }
.ch-row:hover .bar, .ch-row:focus-visible .bar { filter: brightness(.88); }
.ch-row .tip { position: absolute; inset-inline-start: 0; bottom: calc(100% + 4px); z-index: 2; display: none; padding: 6px 10px; border-radius: 12px; background: var(--text-primary); color: var(--bg); font-size: 12px; white-space: nowrap; box-shadow: var(--elev-2); }
.ch-row:hover .tip, .ch-row:focus-visible .tip { display: block; }
.ch-row:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ch-drop { font-size: calc(11px * var(--font-scale)); color: var(--text-secondary); display: flex; align-items: center; gap: 4px; margin: -4px 0; }
.ch-drop .ico { font-size: 12px; }
.spark { width: 100%; height: 44px; display: block; overflow: visible; }
.spark polyline { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark .area { fill: color-mix(in srgb, var(--primary) 10%, transparent); stroke: none; }
.spark circle { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }
.spark-x { display: flex; justify-content: space-between; font-size: calc(11px * var(--font-scale)); color: var(--text-secondary); margin-top: 4px; }
/* ---------- data table (PbDataTable): a table from 1024 dp, the rows of the same data below ---------- */
.pt-table { width: 100%; border-collapse: collapse; }
.pt-table th { text-align: start; font-size: calc(12px * var(--font-scale)); font-weight: 600; color: var(--text-secondary); padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.pt-table td { padding: 8px 12px; font-size: calc(14px * var(--font-scale)); line-height: 1.4; vertical-align: middle; border-bottom: 1px solid var(--border); }
.pt-table tr:last-child td { border-bottom: 0; }
.pt-table .who { display: flex; align-items: center; gap: 12px; min-width: 0; }   /* 12: the spacing scale (2026-10-19; the gaps of 10 in this file moved to 12 in one pass) */
.pt-table .who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-table .who span:not(.orgtile):not(.orgtile span) { display: block; font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }   /* the organisation tile keeps its letter centred (People 01: the letter sat outside the tile, 2026-10-20) */
.pt-table .acts { display: flex; gap: 4px; justify-content: flex-end; }
.pt-table .msg { color: var(--text-secondary); max-width: 36ch; }
.pt-ai { display: inline-flex; align-items: center; gap: 4px; font-size: calc(11px * var(--font-scale)); font-weight: 600; color: var(--tertiary-text); white-space: nowrap; }
.pt-ai .ico { font-size: 13px; }
@media (max-width: 1023px) {   /* the list-row form of the same data (generalised 2026-10-19, after the owner called the stacked cells of the People list the worst design: every list gets the recipe the organisation rows had) */
  /* One recipe for every table row below 1024 dp: the first cell is the title line; every other cell is wrapped as one dense line under it (the pills and plain values side by side, a plain value led by its column's name),
     indented past a tile or an avatar when the title starts with one; the desktop-only columns (c-x) stay hidden except on the tile rows, where nothing the desktop table shows is lost;
     a row's actions sit at the end of the last line. Never one cell per line: that spent a screen on six rows and lost the column names. */
  .pt-table thead { display: none; }
  .pt-table, .pt-table tbody { display: block; }
  .pt-table tr { --pt-indent: 0px; --pt-sel: 0px; display: flex; flex-wrap: wrap; align-items: center; column-gap: 16px; row-gap: 4px; padding: 10px 0 10px calc(var(--pt-sel) + var(--pt-indent)); border-bottom: 1px solid var(--border); }
  .pt-table tr:last-child { border-bottom: 0; }
  .pt-table tr:has(> td.sel) { --pt-sel: 44px; }
  .pt-table td { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 0; border: 0; min-width: 0; font-size: calc(13px * var(--font-scale)); }
  .pt-table td.c-x { display: none; }
  .pt-table td:empty { display: none; }
  .pt-table td.sel { order: -2; flex: 0 0 44px; width: 44px; margin: 0 0 0 calc(-1 * (var(--pt-sel) + var(--pt-indent))); }
  .pt-table td:first-child:not(.sel), .pt-table td.sel + td, .pt-table td.pt-title { display: block; flex: 1 1 calc(100% + var(--pt-indent)); min-width: 0; margin: 0 0 0 calc(-1 * var(--pt-indent)); font-size: calc(14px * var(--font-scale)); }
  .pt-table td.pt-title { order: -1; }   /* shell.js marks the cell that starts with an avatar or a tile (an id before the person moves under it); the box before it keeps the first place */
  .pt-table td.sel + td:not(.pt-title) { margin-inline-start: 0; }   /* a plain first cell after the box keeps its place */
  .pt-table tr:has(> td.sel) > td.pt-title { margin-inline-start: 0; flex: 1 1 calc(100% + var(--pt-indent) - 16px); }   /* with a box the tile title takes the rest of the box's line (2026-10-19: it used to wrap under the box, 92 dp in) and the wrapped cells align with the name: the indent below adds the column gap */
  .pt-table tr:has(> td.sel):has(> td > .orgcell) { --pt-indent: 68px; }
  .pt-table tr:has(> td.sel):has(> td > .orgcell > .cu-k), .pt-table tr:has(> td.sel):has(> td > .orgcell > .orgtile[style*="--size:36px"]) { --pt-indent: 64px; }
  .pt-table td:first-child:not(.sel):not(.pt-title), .pt-table td.sel + td:not(.pt-title) { display: inline-flex; flex: 0 1 auto; margin: 0; font-size: calc(13px * var(--font-scale)); }   /* a first cell that is only an id */
  .pt-table td[data-l]::before { content: attr(data-l); color: var(--text-tertiary); font-weight: 500; }   /* the column's name, set by shell.js from the header, only on a plain value */
  .pt-table td.pt-rowmenu, .pt-table td:has(> .acts), .pt-table td:has(> .tbtn) { margin-inline-start: auto; }
  .pt-table .acts { justify-content: flex-end; padding-top: 0; }
  .pt-table .msg { max-width: none; }
  /* Tile rows (an organisation tile or logo first): their indent is fixed by the tile's size; on a tablet (600 to 1023 dp) they show every cell, the desktop-only columns included, under the title;
     on a phone the desktop-only columns stay hidden like every other row's (2026-10-19, the owner's call: a phone row is the title line and what the phone table shows, not the whole desktop table). */
  .pt-table tr:has(> td:first-child > .orgcell), .pt-table tr:has(> td.sel + td > .orgcell) { --pt-indent: 52px; }
  .pt-table tr:has(> td > .orgcell > .cu-k), .pt-table tr:has(> td > .orgcell > .orgtile[style*="--size:36px"]) { --pt-indent: 48px; }
  .pt-table .orgcell { min-height: 44px; }   /* the tile link keeps the touch target below 1024 dp (36 and 40 dp in the render sweep of 2026-10-19) */
  .pt-table tr:has(> td > .orgcell) .state { display: inline; margin: 0; }
  .pt-table tr:has(> td > .orgcell) .state::before { content: "· "; color: var(--text-tertiary); font-weight: 400; }
  .pt-table tr:has(> td > .orgcell) .qb-diff { flex-direction: row; align-items: center; gap: 8px; }
}
/* A table in a narrow web column (the PB panel open, the menu shown at a small window) keeps its columns and scrolls sideways inside its card (.pt-scroll) rather than taking the tablet's list-row form: that form leans on each page's own below-1024 rules, which a container query cannot reach (2026-10-20, seen on Adda's feeds beside the panel). The table keeps the width it has at 1280 dp, so no column is crushed; the card scrolls. */
@media (min-width: 1024px) { @container pbc (max-width: 939px) { .pt-scroll > .pt-table:where(:has(> thead)) { min-width: 944px; } } }   /* a table with no heading row is a list of settings, not a grid: it keeps the card's width (config 04, Complaints contact, 2026-11-14) */
@media (min-width: 600px) and (max-width: 1023px) { .pt-table tr:has(> td > .orgcell) > td.c-x { display: inline-flex; color: var(--text-secondary); } }
/* ---------- anomaly rows and the publishing calendar ---------- */
.an { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; font-size: calc(14px * var(--font-scale)); border-radius: 8px; }
.an + .an { position: relative; }
.an + .an::before { content: ''; position: absolute; top: 0; inset-inline: 0; height: 1px; background: var(--border); pointer-events: none; }   /* a straight divider: a box-shadow followed the row's radius and curved down at both ends (2026-10-19) */
.an > .ico { font-size: 18px; flex-shrink: 0; margin-top: 2px; color: var(--info-text); }
.an.warn > .ico { color: var(--warning-text); } .an.err > .ico { color: var(--error-text); }
.an .t { flex: 1; min-width: 0; } .an .t span { display: block; font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }
.cal { display: flex; flex-direction: column; }
.cal-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 8px; align-items: center; min-height: 48px; padding: 4px 0; font-size: calc(14px * var(--font-scale)); border-radius: 8px; }
.cal-row + .cal-row { position: relative; }
.cal-row + .cal-row::before { content: ''; position: absolute; top: 0; inset-inline: 0; height: 1px; background: var(--border); pointer-events: none; }   /* straight, not a curved shadow (2026-10-19) */
.cal-row time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-secondary); font-size: calc(13px * var(--font-scale)); }
.cal-row .t { min-width: 0; } .cal-row .t b { display: block; font-weight: 600; line-height: 1.3; }   /* wraps to a second line in the narrow calendar column rather than truncating */ .cal-row .t span { display: block; font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }
/* ---------- size classes ---------- */
@media (min-width: 600px) {
  .st-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pt-grid { gap: 16px; }
}
/* The column counts ask the content column (pbc, chrome.css), not the viewport (2026-10-20, the owner: with the PB panel open, or the menu shown at a small window, the five-across scorecard and the pairs were crushed into a column that could not hold them):
   pairs from 600 dp of column, the wide shapes (five tiles across, 8 + 4) from 840 dp of column. At 1024 dp with the menu shown the column is 688 dp, so a dashboard there is pairs and three tiles across; at 1280 it is 944 dp and nothing changed. */
@container pbc (min-width: 600px) { .pt-grid > .c6 { grid-column: span 6; } }
@container pbc (min-width: 840px) {
  .st-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .st-row:has(> :nth-child(6)):not(:has(> :nth-child(7))) { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* exactly six tiles are two even rows of three, never five and one alone (2026-11-14) */
  .pt-grid > .c8 { grid-column: span 8; } .pt-grid > .c4 { grid-column: span 4; }
}
@media (min-width: 1024px) {   /* dense: the density scale (tokens §3.3) */
  .lv { flex-wrap: wrap; overflow: visible; } .lv a { flex: 1 1 128px; min-width: 0; } .lv a .k { white-space: normal; }   /* room for every module: the strip wraps instead of scrolling */
  .pt-head h1 { font-size: calc(28px * var(--font-scale)); line-height: 1.29; }

  /* Today's pairs by height (2026-10-19): a short card beside a tall one was stretched into a half-empty box, so on the wide grid the short Learners now sits with the short Out of the ordinary and the tall What waits with the tall funnel; on a phone the DOM order stays (what waits for a person first among the pairs). */
  .pt-grid > .td-o1 { order: 1; } .pt-grid > .td-o2 { order: 2; } .pt-grid > .td-o3 { order: 3; } .pt-grid > .td-o4 { order: 4; } .pt-grid > .td-o5 { order: 5; } .pt-grid > .td-o6 { order: 6; }
  .pt-grid > .td-o6 { display: flex; flex-direction: column; } .pt-grid > .td-o6 .cal { flex: 1; } .pt-grid > .td-o6 .cal-row { flex: 1; }   /* the calendar sits beside the taller at-risk card: its rows share the height instead of leaving a blank end */
  .q-row { min-height: 40px; padding: 2px 4px; gap: 12px; }
  .q-row .ic { width: 28px; height: 28px; border-radius: 8px; } .q-row .ic .ico { font-size: 16px; }
  .q-row .t { flex-direction: row; align-items: baseline; gap: 8px; }
  .q-row .t b { font-size: calc(13px * var(--font-scale)); flex-shrink: 0; }   /* the kind never truncates; the meta line does */
  .q-row .n { font-size: calc(16px * var(--font-scale)); }
  .pt-table td { padding: 8px 12px; font-size: calc(13px * var(--font-scale)); line-height: calc(18px * var(--font-scale)); height: 40px; box-sizing: border-box; }   /* the line height scales with the text: a fixed 18 px stacked wrapped lines on each other at 1.43 */
  .pt-table th { font-size: calc(13px * var(--font-scale)); line-height: calc(18px * var(--font-scale)); }
  .cal-row { min-height: 40px; font-size: calc(13px * var(--font-scale)); }
  .an { font-size: calc(13px * var(--font-scale)); }
}

/* ---------- queue page: the item form of the queue row, the split pane (02 Queues, 2026-10-11) ---------- */
.q-row.item { align-items: flex-start; min-height: 64px; padding: 8px 4px; gap: 8px; flex-wrap: wrap; }   /* at 1.43 the row's actions drop under the text instead of squeezing it to a sliver */
.q-row.item .sel { flex-shrink: 0; margin: -4px 0 0 -8px; }   /* the shared checkbox (components.css .cbox) in the row's slot */
.q-row.item .open { flex: 1 1 calc(150px * var(--font-scale)); min-width: 0; display: flex; align-items: flex-start; gap: 12px; text-align: start; color: inherit; border-radius: 12px; padding: 2px 4px; }   /* the tappable area is its own button, never the whole row (the list item rule) */
.q-row.item .open:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.q-row.item .open .ic { margin-top: 2px; }
.q-row.item .t { gap: 4px; }
.q-row.item .t b { white-space: normal; }
.q-row.item .t .m { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); white-space: normal; }
.q-row.item .t .m > span { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; min-width: 0; max-width: 100%; }   /* the facts wrap; only the summary form on Today truncates */
.q-row.item .age { font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; padding-top: 4px; }
.q-row.item .acts { display: flex; gap: 0; flex-shrink: 0; margin: -4px -8px 0 0; }
.q-row.item .acts .tbtn { background: transparent; box-shadow: none; }
.q-row.item .acts .tbtn:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.q-row.item .acts [data-act="ok"] { color: var(--success-text); } .q-row.item .acts [data-act="no"] { color: var(--error-text); }
.q-row.item .acts .tbtn .mi { font-size: 24px; }
.q-row.item[aria-current="true"] { background: color-mix(in srgb, var(--primary) 8%, transparent); border-radius: 12px; box-shadow: none; }   /* the row the keyboard is on, or the item open beside the list */
.q-row.item.gone { opacity: 0; transform: translateX(-24px); transition: opacity 300ms ease, transform 300ms ease; }
.q-list { display: flex; flex-direction: column; }
.q-bulk { position: sticky; bottom: 0; z-index: 10; margin: 12px -16px -40px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--bg); box-shadow: 0 -1px 0 var(--border); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }   /* the bulk bar: the list page pattern, shown while rows are selected */
.q-bulk b { font-size: calc(14px * var(--font-scale)); margin-inline-end: auto; }
.q-bulk[hidden] { display: none; }
.pt-split .pt-pane { display: none; }
@media (min-width: 600px) { .q-bulk { margin-inline: -24px; padding-inline: 24px; } }
@media (min-width: 1024px) {   /* the item opens beside the list (PbSplitPane); the pane is a frame that runs the item page itself */
  .pt-split { display: grid; grid-template-columns: minmax(0, 1fr) 500px; gap: 16px; align-items: start; }

  .pt-split .pt-pane { display: block; position: sticky; top: 88px; height: calc(100vh - 112px); border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--edge); overflow: hidden; }
  .pt-split .pt-pane iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--bg); }
}
/* a split page needs 940 dp of column for its list and its 500 dp pane (2026-10-20, replaces the viewport rules for the PB panel): under that the open item's pane takes the column and the list waits one Back away; with no item open nothing changes */
@media (min-width: 1024px) {
  @container pbc (max-width: 939px) {
    .pt-split { grid-template-columns: minmax(0, 1fr); }
    .pt-split .pt-pane:not(:has(> :not(.pt-none):not([hidden]))) { display: none; }   /* nothing open: the list has the column and the empty pane is not drawn (the frame exists hidden until an item opens) */
    .pt-split:has(.pt-pane > :not(.pt-none):not([hidden])) > :not(.pt-pane) { display: none; }   /* an item open: its pane takes the column, the list waits one Back away */
  }
}
@media (min-width: 1024px) {
  .pt-split .pt-pane .pt-none { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; color: var(--text-secondary); font-size: calc(14px * var(--font-scale)); }
  .pt-split .pt-pane .pt-none .mi { font-size: 48px; color: var(--primary-text); }
  .pt-split .pt-pane .pt-none h2 { margin: 4px 0 0; font-size: calc(18px * var(--font-scale)); color: var(--text-primary); }
  .q-bulk { margin-inline: -32px; padding-inline: 32px; }
  .q-row.item { min-height: 56px; padding: 6px 4px; }
  .q-row.item .t { flex-direction: column; align-items: stretch; }
}
/* the item page (01): its sections and the decision bar */
.qi-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.qi-title { margin: 0 0 4px; font-size: calc(20px * var(--font-scale)); line-height: 1.4; font-weight: 700; }
.qi-meta { font-size: calc(13px * var(--font-scale)); color: var(--text-secondary); }
.qi-sec { margin-top: 16px; }
.qi-sec h2 { margin: 0 0 8px; font-size: calc(14px * var(--font-scale)); font-weight: 700; color: var(--text-secondary); }
.qi-sec p { margin: 0 0 8px; font-size: calc(15px * var(--font-scale)); line-height: 1.5; }
.qi-sec .card p:last-child { margin-bottom: 0; }
.qi-kv { display: grid; grid-template-columns: minmax(96px, 140px) minmax(0, 1fr); gap: 8px 12px; font-size: calc(14px * var(--font-scale)); }
.qi-kv dt { color: var(--text-secondary); } .qi-kv dd { margin: 0; overflow-wrap: anywhere; }
.qi-kv dt code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: calc(12px * var(--font-scale)); overflow-wrap: anywhere; }   /* a fact named by its field (promotions 01, Fact packet): an identifier, not a label */
.qi-kv .link, .pt-banner .link { margin-block: -14px; padding-inline: 0; margin-inline-end: 0; }   /* a link inside a fact or a banner keeps its 48 dp target without growing the line (was Support 01's own rule; AI 03's Release flag row sat 30 dp low, 2026-10-19) */
.qi-kv .link + .link { margin-top: 14px; }   /* two links in one fact stack without overlapping */   /* a long source name or URL wraps, never widens the page (pseudo-locale sweep, 2026-10-18) */
.qi-src { display: flex; flex-wrap: wrap; gap: 8px; }
.qi-log { font-size: calc(13px * var(--font-scale)); color: var(--text-secondary); display: flex; flex-direction: column; gap: 4px; }
.qi-log b { color: var(--text-primary); }
/* the lines of a reported conversation (queues README question 22, 2026-10-20: the reported message and the five before it, never the whole thread): the sender and the time on one line, the text under it; the reported line takes the error tint and a pill */
.qi-th { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qi-th li { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--edge); }
.qi-th li.rep { background: var(--error-container); box-shadow: none; }
.qi-th .hd { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }
.qi-th .hd b { color: var(--text-primary); }
.qi-th .tx { font-size: calc(15px * var(--font-scale)); line-height: 1.5; overflow-wrap: anywhere; }
.qi-bar { position: sticky; bottom: 0; z-index: 10; margin: 16px -16px 0; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--bg); box-shadow: 0 -1px 0 var(--border); display: flex; gap: 8px; flex-wrap: wrap; }
.qi-bar .btn { flex: 1 1 auto; }
.qi-bar .done { flex: 1 1 100%; display: flex; align-items: center; gap: 8px; font-size: calc(14px * var(--font-scale)); }
.qi-bar .done .mi { color: var(--success-text); font-size: 20px; }
@media (min-width: 600px) { .qi-bar { margin-inline: -24px; padding-inline: 24px; } }
/* ---------- the list page (PbFilterBar): the filter bar, the saved views, the result count, the pager; the selection cell of the table (written with Organisations 00, 2026-10-11) ---------- */
.pt-filter { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.pt-filter .field { min-height: var(--dn-field, 44px); }
.pt-filter .pt-fchips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.pt-filter .pt-fchips::-webkit-scrollbar { display: none; }
.pt-filter .pt-fchips .chip { flex: 0 0 auto; min-height: var(--dn-control, 44px); }   /* the 44 dp touch target (was 40, 2026-10-13); 36 dp dense from 1024 dp, or from 768 dp under Compact */
.pt-count { font-size: calc(13px * var(--font-scale)); color: var(--text-secondary); white-space: nowrap; }
.pt-pager { display: flex; align-items: center; gap: 4px; justify-content: flex-end; padding: 8px 0 0; font-size: calc(13px * var(--font-scale)); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.pt-pager .tbtn { background: transparent; box-shadow: none; width: var(--dn-control, 44px); height: var(--dn-control, 44px); }
.pt-pager .tbtn[disabled] { opacity: .35; pointer-events: none; }
.pt-pager .pt-size { margin-inline-end: auto; display: inline-flex; align-items: center; gap: 8px; }
.pt-pager .pt-size .btn { min-height: var(--dn-control, 44px); padding-inline: 10px; }
.pt-scroll { overflow-x: auto; scrollbar-width: thin; contain: inline-size; }   /* a table wider than its card scrolls inside it; the selection and the first column stay pinned. contain: inline-size (2026-10-13, Payments 02 to 05): the table's min-content never widens the card (.pb-content is a flex item); the pages whose tables fit are unchanged (diff.py, 35 pages, 0 real) */
.pt-scroll .pt-table th:nth-child(1), .pt-scroll .pt-table td:nth-child(1) { position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; }
.pt-scroll .pt-table th:nth-child(2), .pt-scroll .pt-table td:nth-child(2) { position: sticky; inset-inline-start: 44px; background: var(--surface); z-index: 1; }
.pt-scroll .pt-table td.c-x, .pt-scroll .pt-table th.c-x { white-space: nowrap; }
.pt-scroll .cf-table td.c-x, .pt-scroll .cf-table th.c-x { white-space: normal; }   /* Config's Default and Bounds carry units (50 to 5000 rupees a day) that must wrap inside their column, not run into the next one */
.pt-scroll.no-sel .pt-table th:nth-child(2), .pt-scroll.no-sel .pt-table td:nth-child(2) { position: static; }   /* a table with no selection column pins only its first column (People) */
.pt-table .sel { width: 44px; padding: 0; }
.pt-table .sel .cbox { vertical-align: middle; }
.pt-table th.sortable button { position: relative; font: inherit; color: inherit; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; border-radius: 8px; padding-inline: 4px; margin-inline-start: -4px; }
.pt-table th.sortable button::after { content: ""; position: absolute; inset: min(0px, calc((100% - 44px) / 2)); }   /* a short header (Hindi "टेस्ट", 32 dp wide) keeps a 44 dp hit area without growing the header: the size-aware recipe of components.css, render sweep 2026-10-19 */
.pt-table th.sortable button:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.pt-table th.sortable .mi { font-size: 14px; }
.pt-table .orgcell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pt-table .orgcell b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-table .orgcell span:not(.orgtile):not(.orgtile span):not(.cu-k):not(.cu-k span) { display: block; font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }   /* the tiles (orgtile, the kind tile .cu-k) keep their own size and centring */
.pt-table .orgcell .cu-k { margin-inline-start: 0; }
.pt-table .orgcell > span > span > span:not(.orgtile):not(.orgtile span):not(.cu-k):not(.cu-k span) { display: inline; }   /* a name inside the caption (data-noloc) stays on the caption's line */
.pt-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-table .state { display: block; font-size: calc(12px * var(--font-scale)); color: var(--warning-text); font-weight: 600; margin-top: 2px; }
.pt-table tbody tr.rowlink { cursor: pointer; }
.pt-table tbody tr[data-focus="1"] { outline: 2px solid var(--primary); outline-offset: -2px; }
/* ---------- the detail page (PbDetailHeader): the header with the status and the actions, the facts column beside the tab content, the tab strip (written with Organisations 01, 2026-10-11) ---------- */
.dh { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 16px; padding: 4px 0 12px; }
.dh .dh-tx { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dh h1 { margin: 0; font-size: calc(20px * var(--font-scale)); line-height: 1.3; font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.dh .dh-sub { font-size: calc(14px * var(--font-scale)); color: var(--text-secondary); }
.dh .dh-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: calc(13px * var(--font-scale)); color: var(--text-secondary); }
.dh .dh-line .wait { color: var(--warning-text); font-weight: 600; }
.dh .dh-line .spill { white-space: normal; max-width: 100%; }   /* a long Tamil or Hindi status wraps inside its pill instead of widening the page (theme sweep 2026-10-18) */
.dh .dh-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1 0 100%; }
.dh .dh-acts .btn-sm { min-height: var(--dn-control, 44px); }   /* the header's actions keep the 44 dp target (Prepare 01, 2026-10-13); 36 dp dense from 1024 dp, or from 768 dp under Compact */
.dh-layout { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
.dh-layout > * { min-width: 0; }   /* a grid item never widens to its tab strip's or table's min-content: the strip scrolls, the table pins and scrolls inside its card */
.dh-side .card + .card { margin-top: 12px; }

/* a column of groups under a detail header with the page's 16 dp gap (the portal's counterpart of page.css .page-col); a group is a 20 sp heading with its panels under it (Settings, 2026-10-13) */
.pt-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }   /* 16: on the 4-step scale (2026-10-19; it was 20) */
.pt-tcard { padding: 4px 12px 8px; }   /* a card that holds a table or a list of rows: the rows bring their own padding (2026-10-19; replaces the inline style on every list page) */
.pt-grp .sec-h { margin-bottom: 8px; }
.pt-grp .se-sec:first-of-type { margin-top: 0; }
.pt-grp .se-sec + .se-sec, .pt-grp .ed-grid .se-sec { margin-top: 16px; }
.pt-grp .ed-grid { gap: 4px 16px; }
.pt-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; background: var(--info-container); color: var(--text-primary); font-size: calc(14px * var(--font-scale)); margin-bottom: 12px; }
.pt-banner .mi { font-size: 20px; color: var(--info-text); flex-shrink: 0; }
.pt-banner > span { min-width: 0; overflow-wrap: anywhere; }
.pt-banner.err { background: var(--error-container); } .pt-banner.err .mi { color: var(--error-text); }
.pt-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; box-shadow: inset 0 -1px 0 var(--border); margin-bottom: 12px; }
.pt-tabs::-webkit-scrollbar { display: none; }
.pt-tab { flex: 0 0 auto; min-height: 48px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: calc(14px * var(--font-scale)); font-weight: 600; color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.pt-tab:hover { color: var(--text-primary); background: color-mix(in srgb, var(--primary) 6%, transparent); border-radius: 12px 12px 0 0; }
.pt-tab[aria-selected="true"], .pt-tab[aria-current="page"] { color: var(--primary-text); border-bottom-color: var(--primary); }
a.pt-tab { text-decoration: none; }   /* Config's tabs are links between peer pages */
@media (max-width: 599px) { a.pt-tab .mi { display: none; } }   /* three Tamil or Hindi labels need the room the icons take */
.pt-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 12px; }
.pt-tab .pb-count { min-width: 20px; height: 20px; font-size: 11px; }
/* Step tabs (Prepare 02, 2026-10-23): the same tab bar as a row of steps. A numbered badge says where the step stands (a number, a tick when it is done, the count of things to fix, a lock until the course exists), the selected step is a filled pill, and a dot marks unsaved changes. */
.pt-tabs.pt-steps { gap: 4px; padding: 6px; margin-bottom: 16px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.pt-tabs.pt-steps .pt-tab { flex: 1 1 0; justify-content: center; min-height: 52px; padding-inline: 12px; margin: 0; border: 0; border-radius: 12px; }
.pt-tabs.pt-steps .pt-tab[aria-selected="true"] { background: color-mix(in srgb, var(--primary) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 35%, transparent); }
.pt-tabs.pt-steps .pt-tab[data-state="lock"] { opacity: .55; }
.pt-step { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; display: inline-grid; place-items: center; font-size: calc(12px * var(--font-scale)); font-weight: 700; background: color-mix(in srgb, var(--text-secondary) 16%, transparent); color: var(--text-secondary); }
.pt-step .mi { font-size: 16px; }
.pt-tab[aria-selected="true"] .pt-step { background: var(--primary); color: var(--on-primary); }
.pt-tab[data-state="ok"] .pt-step { background: var(--success); color: var(--on-primary); }
.pt-tab[data-state="err"] .pt-step { background: var(--error); color: var(--on-primary); }
.pt-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning-text); flex: 0 0 auto; }
.pt-tabs.pt-steps .pt-tab { position: relative; }
/* below one row's width (about 1020 dp of content) the six steps wrap into two rows of three, each a badge over its name, so every step is in view and none is cut off or scrolled to */
@container pbc (max-width: 1019px) {
  .pt-tabs.pt-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
  .pt-tabs.pt-steps .pt-tab { flex-direction: column; justify-content: center; gap: 4px; min-height: 64px; padding: 8px 4px; text-align: center; white-space: normal; line-height: 1.2; font-size: calc(13px * var(--font-scale)); }
  .pt-tabs.pt-steps:has(> .pt-tab:nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }   /* four steps (Create with AI) fit one row of four */
  .pt-tabs.pt-steps .pt-dot { position: absolute; top: 8px; inset-inline-end: 8px; }
}
@container pbc (max-width: 479px) { .pt-tabs.pt-steps .pt-tab { font-size: calc(12px * var(--font-scale)); padding-inline: 2px; } }
.ed-prog { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; font-size: calc(13px * var(--font-scale)); }
.ed-prog .pr-pt { font-weight: 600; white-space: nowrap; }
.ed-prog .pr-bar { flex: 1 1 160px; height: 6px; border-radius: 4px; overflow: hidden; background: color-mix(in srgb, var(--text-secondary) 16%, transparent); }
.ed-prog .pr-bar i { display: block; height: 100%; background: var(--primary); transition: width .3s; }
.ed-prog .pr-hint { color: var(--text-secondary); }
.ed-prog button.pr-hint { font: inherit; font-weight: 600; color: var(--error-text); min-height: 44px; padding: 0 4px; border-radius: 8px; text-decoration: underline; }
.ed-panel[hidden] { display: none; }
.ed-grid.ed-panel { align-items: stretch; }   /* the two cards of a step share one height, so their edges line up */
.pr-two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 24px; }
@media (min-width: 768px) { .pr-two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pr-three { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
@media (min-width: 600px) { .pr-three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pr-mediagrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 24px; }
@media (min-width: 768px) { .pr-mediagrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ed-panel .ed-foot { display: none; }   /* a step saves with Save and continue in the pinned bar, not with a Save of its own */
.ed-panel .ed-wide { grid-column: 1 / -1; }
.pr-steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pr-steps li { display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: calc(14px * var(--font-scale)); }
.pr-steps li .grow { flex: 1 1 auto; min-width: 0; }
.pr-steps li small { display: block; color: var(--text-secondary); font-size: calc(12px * var(--font-scale)); }
.dh-facts .qi-kv { gap: 8px 12px; grid-template-columns: fit-content(42%) minmax(0, 1fr); }   /* the label column is as wide as its longest label, up to 42 %: a fixed 140 dp left an email 100 dp and broke it mid-word in a narrow Facts card */
.dh-facts .qi-kv dd { overflow-wrap: anywhere; }
.pt-rowmenu { display: flex; justify-content: flex-end; }
.pt-rowmenu .tbtn { background: transparent; box-shadow: none; width: var(--dn-control, 44px); height: var(--dn-control, 44px); }
/* ---------- the editor (PbEditorSection): sections as cards that save one at a time, each with its state; two columns on Expanded (written with Organisations 02, 2026-10-11) ---------- */
.ed-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }   /* minmax(0, 1fr), 2026-10-13: a section's min-content (a tree row with its four round buttons) never widens the column past the page on a phone (Practice 03 and Prepare 02 scrolled sideways at 390) */
.ed-sec .ed-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.ed-sec .ed-h h2 { margin: 0; font-size: calc(16px * var(--font-scale)); font-weight: 700; flex: 1 1 auto; }
.ed-state { font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ed-state .mi { font-size: 14px; }
.ed-state.dirty { color: var(--warning-text); font-weight: 600; } .ed-state.ok { color: var(--success-text); } .ed-state.err { color: var(--error-text); font-weight: 600; }
.ed-sec { padding: var(--dn-section, 16px); }   /* the card's 16 dp; 12 dp under Compact (tokens 3.3 section-pad) */
.ed-sec .btn-sm { min-height: var(--dn-control, 44px); }   /* the section's Save and its Add buttons keep the 44 dp target (the spec's sizes; measured 40 on Prepare 02, 2026-10-13); 36 dp dense from 1024 dp, or from 768 dp under Compact */
.ed-sec .f-label { margin-top: var(--dn-field-gap, 14px); }
.ed-sec .f-label:first-of-type { margin-top: var(--dn-text-gap, 8px); }
.ed-sec textarea, textarea.sp-ta, .sheet2 textarea:not(.field textarea) { width: 100%; box-sizing: border-box; min-height: var(--dn-textarea, 96px); padding: 12px; border: 1px solid var(--outline); border-radius: 8px; background: var(--field-bg); color: var(--text-primary); font: inherit; font-size: calc(var(--dn-field-text, 14px) * var(--font-scale)); resize: vertical; }   /* one textarea recipe: the editor's sections and Support's reply bar and sheets */
.ed-sec textarea:focus, textarea.sp-ta:focus, .sheet2 textarea:not(.field textarea):focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.ed-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 12px; }
.ed-rows { display: flex; flex-direction: column; gap: 8px; }
.ed-rows ~ .btn { margin-top: var(--dn-field-gap, 14px); }   /* the Add button under a row list: the empty .help between them is display:none, so without this it touched the last row and sat inside its focus halo (2026-10-20, owner) */
.ed-row { display: flex; align-items: center; gap: 8px; }
.ed-row .field { flex: 1; min-width: 0; }
.ed-row .ed-kind { flex: 0 0 auto; min-height: var(--dn-field, 44px); }
/* an editor's pick (2026-10-27, the owner: a picker is a field like the inputs beside it, never a pill): the Select's field frame (.field, theme.css) as a button, the chosen words at the start,
   the caret at the end; .unset = nothing chosen yet, the "Choose …" words in the placeholder colour (not .empty: that is the empty state's class in components.css, a column); the focus ring and the error border are the field's own */
.ed-pick { width: 100%; box-sizing: border-box; cursor: pointer; text-align: start; font: inherit; font-size: calc(var(--dn-field-text, 14px) * var(--font-scale)); color: var(--text-primary); }
.ed-pick .tx { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-pick.unset .tx { color: var(--text-secondary); }
.ed-pick > .mi { flex: 0 0 auto; font-size: 20px; color: var(--text-secondary); }
.ed-pick:hover { background: color-mix(in srgb, var(--primary) 4%, var(--field-bg)); }
.ed-pick:focus-visible { outline: none; border: 2px solid var(--primary); padding: 0 11px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 10%, transparent); }
.ed-row .tbtn { background: transparent; box-shadow: none; flex-shrink: 0; width: var(--dn-field, 44px); height: var(--dn-field, 44px); }   /* the row's remove button follows the field beside it: 44 dp, 36 dp under Compact */
.ed-logo { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.ed-logo p { margin: 0; font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }
.ed-sec.off { opacity: .55; pointer-events: none; }
.ed-sec.danger { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--error) 40%, transparent); }
.ed-sec.danger .ed-h h2 { color: var(--error-text); }
.ed-pin { position: sticky; bottom: 0; z-index: 10; margin: 12px -16px 0; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--bg); box-shadow: 0 -1px 0 var(--border); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ed-pin .pt-count { margin-inline-end: auto; white-space: normal; min-width: 0; }   /* the pinned bar's count ("Saved as a draft, not verified") wraps beside the action in a longer language instead of widening the page (render sweep 2026-10-19; the question editor's own patch is redundant) */
@media (min-width: 600px) {
  .pt-filter { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .pt-filter .field { flex: 1 1 260px; }
  .pt-filter .pt-fchips { flex: 1 1 100%; }
  .dh .dh-acts { flex: 0 1 auto; min-width: 0; justify-content: flex-end; margin-inline-start: auto; }   /* shrinks and wraps at text scale 1.43 instead of running off the page (theme sweep 2026-10-18) */
  .dh h1 { font-size: calc(24px * var(--font-scale)); }
}
@media (min-width: 1024px) {
  .pt-filter .pt-fchips { flex: 1 1 auto; overflow: visible; flex-wrap: wrap; }
  .dh h1 { font-size: calc(28px * var(--font-scale)); line-height: 1.29; }
  @container pbc (min-width: 840px) { .dh-layout { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 16px; } }   /* side by side only when the content column has the room: at 1024 with the menu open the Facts card was 224 dp and broke words (2026-11-12) */
  .dh-layout.one { grid-template-columns: 1fr; }
  .pt-tab { min-height: 40px; padding-inline: 10px; }   /* dense: seven tabs (People) fit the 8-of-12 column at 1280 */
  .ed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .ed-pin { margin-inline: -24px; padding-inline: 24px; }
}
/* ---------- support: the clocks and the conversation (PbServiceClock, PbConversation; written with Support 00 and 01, 2026-10-13) ---------- */
.clk { display: inline-flex; align-items: center; gap: 4px; font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }   /* a clock reads in words and an icon, never colour alone */
.clk .mi { font-size: 14px; }
.clk.ok { color: var(--success-text); } .clk.warn { color: var(--warning-text); font-weight: 600; } .clk.err { color: var(--error-text); font-weight: 600; }
.sp-clocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.sp-clock { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--edge); min-width: 0; }
.sp-clock.warn { background: var(--warning-container); box-shadow: none; } .sp-clock.err { background: var(--error-container); box-shadow: none; }
.sp-clock .k { font-size: calc(12px * var(--font-scale)); font-weight: 600; color: var(--text-secondary); }
.sp-clock .clk { font-size: calc(14px * var(--font-scale)); font-weight: 700; white-space: normal; }
.sp-clock .s { font-size: calc(11px * var(--font-scale)); color: var(--text-secondary); }
.sp-thread { display: flex; flex-direction: column; gap: 16px; }
.sp-line { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; }
.sp-line .hd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: calc(13px * var(--font-scale)); color: var(--text-secondary); }
.sp-line .hd b { font-size: calc(14px * var(--font-scale)); color: var(--text-primary); }
.sp-line .tx { margin-top: 4px; padding: 10px 12px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--edge); font-size: calc(15px * var(--font-scale)); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.sp-line.staff .tx { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); box-shadow: none; }
.sp-line.note .tx { background: var(--warning-container); box-shadow: none; }
.sp-sys { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: calc(13px * var(--font-scale)); color: var(--text-secondary); }
.sp-sys .mi { font-size: 16px; }
.sp-sys .sp-rnote { flex-basis: 100%; font-style: normal; color: var(--text-primary); overflow-wrap: break-word; }   /* the learner's optional line with the rating (support 01, row 83) */
.sp-draft { padding: 14px; border-radius: 16px; background: color-mix(in srgb, var(--tertiary) 8%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tertiary) 28%, transparent); }   /* the engine's draft: tinted with the AI hue, never sent without a person */
.sp-draft.none { background: var(--surface); box-shadow: inset 0 0 0 1px var(--edge); }
.sp-draft .hd { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; }
.sp-draft .tx { font-size: calc(15px * var(--font-scale)); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.sp-draft .qi-src { margin-top: 10px; }
.sp-draft .bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.sp-draft .bar .sp-grow { margin-inline-start: auto; }
.sp-reply { position: sticky; bottom: 0; z-index: 10; margin: 16px -16px 0; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--bg); box-shadow: 0 -1px 0 var(--border); display: flex; flex-direction: column; gap: 8px; }   /* the pinned reply bar: reply or note, then the one filled button */
.sp-reply .row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.sp-reply .row .btn { margin-inline-start: auto; }
.sp-reply .to { font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }
.sp-reply textarea.sp-ta { min-height: 72px; }
.sp-reply.note textarea.sp-ta { background: var(--warning-container); }
@media (min-width: 600px) { .sp-reply { margin-inline: -24px; padding-inline: 24px; } }
/* ---------- access: the grant matrix (PbGrantMatrix; written with Access 01 and 02, 2026-10-13): one card per module, resources as rows, verbs as columns, a scope word in a granted cell ---------- */
.ed-grid > .ed-wide { grid-column: 1 / -1; }   /* a section that takes both columns of the editor (the grants) */
.gm-mod + .gm-mod { margin-top: 12px; }
.gm-mod .h h2 { flex: 1 1 auto; }
.gm-tog { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-inline-start: -8px; padding-inline: 8px; border-radius: 12px; font: inherit; font-weight: 700; color: inherit; background: transparent; }
.gm-tog:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.gm-tog:focus-visible, button.gm-c:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.gm-tog .mi { font-size: 18px; color: var(--text-secondary); }
.gm { width: 100%; border-collapse: collapse; }
.gm th, .gm td { padding: 2px 4px; text-align: center; border-bottom: 1px solid var(--border); }
.gm thead th { padding: 6px 4px; font-size: calc(12px * var(--font-scale)); font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.gm thead th:first-child { text-align: start; }
.gm tbody th { min-width: 132px; padding: 6px 8px 6px 0; text-align: start; font-size: calc(14px * var(--font-scale)); font-weight: 600; }
.gm tbody tr:last-child > * { border-bottom: 0; }
.gm-c { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 64px; min-height: 44px; padding: 2px 6px; border-radius: 12px; font: inherit; color: var(--text-secondary); background: transparent; }
.gm-c .mi { font-size: 20px; }
.gm-c .gm-s { font-size: calc(11px * var(--font-scale)); font-weight: 600; line-height: 1.2; white-space: nowrap; }
.gm-c .gm-v, .gm-c .gm-s.off { display: none; }   /* the column header names the verb and the cell's aria-label says the whole sentence, "View · Feeds · Not granted", so neither word is drawn */
.gm-c.on { color: var(--primary-text); background: color-mix(in srgb, var(--primary) 10%, transparent); }
button.gm-c { cursor: pointer; transition: background-color 150ms ease; }
button.gm-c:hover { background: color-mix(in srgb, var(--primary) 14%, transparent); }
.gm-c.ro { cursor: default; }
@media (min-width: 1024px) { .gm-c { min-height: 40px; min-width: 60px; } }
@media (max-width: 599px) {   /* a phone: each resource is a block, its verbs wrap as chips that say the verb, so nothing scrolls sideways */
  .gm thead { display: none; }
  .gm, .gm tbody { display: block; }
  .gm tr { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .gm tbody tr:last-child { border-bottom: 0; }
  .gm th, .gm td { padding: 0; border: 0; }
  .gm tbody th { flex: 1 0 100%; min-width: 0; padding: 0 0 2px; }
  .gm td.gm-na { display: none; }
  .gm-c { flex-direction: row; gap: 8px; min-width: 44px; padding: 2px 12px 2px 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--border); }
  .gm-c .gm-v { display: inline; font-size: calc(13px * var(--font-scale)); font-weight: 600; }
}
/* ---------- config: flags, values and countries (PbConfigRow, PbCountryCard; written with Config 00 to 02, 2026-10-13): the data table with one control at the end of each row (a switch, a value and its edit button, a link to the owner) ---------- */
.cf-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cf-tx b { font-weight: 600; overflow-wrap: anywhere; }
.cf-key { font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); overflow-wrap: anywhere; }
.cf-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; }
.cf-mark { display: inline-flex; align-items: center; gap: 4px; font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); white-space: nowrap; }
.cf-mark .mi { font-size: 14px; }
.cf-mark.first { color: var(--primary-text); font-weight: 600; }
.cf-sub td.cf-name .cf-tx { margin-inline-start: 16px; padding-inline-start: 12px; border-inline-start: 2px solid var(--border); }   /* a sub-feature hangs under its module */
.cf-sub td.cf-name .cf-tags { margin-inline-start: 28px; }
.cf-ctl-in { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.cf-st { min-width: 48px; font-size: calc(13px * var(--font-scale)); color: var(--text-secondary); }
.cf-st.on { color: var(--text-primary); font-weight: 600; }
.cf-val { min-width: 0; text-align: end; }
.cf-v { font-weight: 600; font-variant-numeric: tabular-nums; }
.cf-u { color: var(--text-secondary); }
.cf-swb { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 52px; height: var(--dn-toggle, 48px); border-radius: 12px; }   /* the switch of theme.css inside a 48 dp button: the button is the touch target, the .sw draws only the track and the thumb */

.cf-swb:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.cf-swb:disabled { cursor: default; }
.cf-swb .sw::before { display: none; }
.cf-swb:disabled .sw { opacity: .45; }
.cf-own { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding-inline: 6px; color: var(--primary-text); font-weight: 600; text-decoration: none; border-radius: 12px; }
.cf-own:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.cf-ctl-in .tbtn { background: transparent; box-shadow: none; width: 44px; height: 44px; }
.cf-own .mi { font-size: 16px; }
.cf-grp + .cf-grp { margin-top: 12px; }
.cf-grp .h h2 { flex: 1 1 auto; }
.cf-rows { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }   /* the lines of a config sheet: recent changes, a country's readiness */
.cf-rows li { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 4px 0; border-bottom: 1px solid var(--border); font-size: calc(14px * var(--font-scale)); }
.cf-rows li:last-child { border-bottom: 0; }
.cf-rows .mi { font-size: 18px; color: var(--text-secondary); flex-shrink: 0; }
.cf-rows li.ok .mi { color: var(--success-text); } .cf-rows li.warn .mi { color: var(--warning-text); }
.cf-rt { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.cf-rn { color: var(--text-secondary); font-variant-numeric: tabular-nums; text-align: end; }
.cf-cgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.cf-ch { display: flex; align-items: center; gap: 12px; }
.cf-code { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary-text); font-size: calc(14px * var(--font-scale)); font-weight: 700; }
.cf-ct { flex: 1 1 auto; min-width: 0; }
.cf-ct h2 { margin: 0; font-size: calc(16px * var(--font-scale)); font-weight: 700; }
.cf-langs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.cf-country .cf-lists { margin-top: 4px; }
@media (max-width: 1023px) {   /* the list-row form: the name and its control share the first line, the rest of the row's cells stack under them */
  .cf-table tr { display: grid; grid-template-columns: minmax(0, 1fr) fit-content(52%); align-items: center; gap: 0 8px; }   /* the control never takes more than half the row: a long unit wraps under its number */
  .cf-ctl-in { flex-wrap: wrap; }
  .cf-table td { grid-column: 1 / -1; }
  .cf-table td.cf-name { grid-column: 1; }
  .cf-table td.cf-ctl { grid-column: 2; grid-row: 1; }
  .cf-st { display: none; }   /* on a phone the switch alone says the state (its position and its name); the word returns with the table */
}
@media (min-width: 1024px) {
  .cf-table { table-layout: fixed; }   /* the columns line up from one card to the next */
  .cf-ctl-in { justify-content: flex-start; }
  .cf-val { text-align: start; }
  .cf-swb { width: 48px; height: var(--dn-toggle, 40px); }
  .cf-own { min-height: 36px; }
  .cf-ctl-in .tbtn { width: 36px; height: 36px; }
  .cf-cgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
/* ---------- prepare: the curriculum tree and the rich text editor (PbCurriculumTree, PbRichText; written with Prepare 01 to 03, 2026-10-13): sections and lessons as one tree, the drag handles drawn and never functional (the up and down buttons reorder); a rich text area under a static toolbar ---------- */
.cu-tree { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.cu-sec { min-width: 0; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--edge); overflow: hidden; }   /* min-width 0: a column flex item never widens the page to its row's min-content (the title field) */
.cu-sh { display: flex; align-items: center; gap: 4px; min-height: 56px; padding: 4px 8px 4px 0; }
.cu-sh .cu-t b { font-size: calc(15px * var(--font-scale)); font-weight: 700; }
.cu-sh .field { flex: 1 1 0; width: 0; min-width: 0; min-height: var(--dn-field, 44px); }
.cu-grip { flex: 0 0 auto; width: 28px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-secondary); cursor: grab; }
.cu-grip .mi { font-size: 20px; }
.cu-fold { background: transparent; box-shadow: none; }
.cu-fold .mi { transition: transform 150ms ease; }
.cu-sec.shut .cu-fold .mi { transform: rotate(-90deg); }
.cu-sec.shut .cu-ls, .cu-sec.shut .cu-add { display: none; }
@media (prefers-reduced-motion: reduce) { .cu-fold .mi { transition: none; } }
.cu-ls { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.cu-l { display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--border); }
.cu-l:last-child { border-bottom: 0; }
.cu-l[data-href] { cursor: pointer; }   /* read mode: the row opens the lesson; the round button at its end is the accessible target */
.cu-l.held { background: color-mix(in srgb, var(--warning) 8%, var(--surface)); }
.cu-l.gone { opacity: .55; }
.cu-l.gone .cu-t b { text-decoration: line-through; }
.cu-k { --accent: var(--primary); --accent-text: var(--primary-text); flex: 0 0 auto; width: 36px; height: 36px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent-text, var(--accent)); margin-inline-start: 8px; }
.cu-k .mi { font-size: 20px; }
.cu-l.held .cu-k { --accent: var(--warning); --accent-text: var(--warning-text); }
.cu-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cu-t b { font-weight: 600; font-size: calc(14px * var(--font-scale)); overflow-wrap: anywhere; }

.cu-m { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }
.cu-ai { display: inline-flex; align-items: center; gap: 2px; color: var(--primary-text); font-weight: 600; }
.cu-ai .mi { font-size: 14px; }
.cu-acts { display: flex; align-items: center; flex: 0 0 auto; }
.cu-acts .tbtn { background: transparent; box-shadow: none; width: 44px; height: 44px; }
.cu-acts .tbtn[disabled] { opacity: .35; pointer-events: none; }
.cu-add { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border); }
.cu-stage { aspect-ratio: 16 / 9; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary-text); }
.cu-stage .mi { font-size: 48px; }
.rt { border: 1px solid var(--outline); border-radius: 8px; background: var(--field-bg); }
.rt:focus-within { outline: 2px solid var(--primary); outline-offset: -1px; }
.rt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px; border-bottom: 1px solid var(--border); }
.rt-btn { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-primary); background: transparent; }
.rt-btn:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.rt-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary-text); }
.rt-btn .mi { font-size: 20px; }
.rt-sep { width: 1px; height: 24px; margin: 0 4px; background: var(--border); }
.rt-area, .rt-out { font-size: calc(14px * var(--font-scale)); line-height: 1.6; overflow-wrap: anywhere; }
.rt-area { min-height: 140px; padding: 12px; outline: none; }
.rt-area:empty::before { content: attr(data-placeholder); color: var(--text-secondary); }
.rt-area h3, .rt-out h3 { font-size: calc(16px * var(--font-scale)); font-weight: 700; margin: 12px 0 4px; }
.rt-area p, .rt-out p { margin: 0 0 8px; }
.rt-area ul, .rt-area ol, .rt-out ul, .rt-out ol { margin: 0 0 8px; padding-inline-start: 22px; }
.rt-area blockquote, .rt-out blockquote { margin: 0 0 8px; padding-inline-start: 12px; border-inline-start: 3px solid var(--outline); color: var(--text-secondary); }
.rt-link { color: var(--primary-text); }   /* a link inside rich text carries the class (the sanitiser adds it); never a bare anchor rule */
.ed-cnt { display: block; text-align: end; font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); margin-top: 4px; font-variant-numeric: tabular-nums; }   /* the counter under a textarea (Prepare 02 and 03; Organisations 02 drew its own first) */
.ed-cnt.over { color: var(--error-text); font-weight: 600; }
.rt-foot { display: flex; justify-content: space-between; gap: 8px; padding: 4px 12px 8px; font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.ed-row .tbtn[aria-pressed="true"] { background: var(--success-container); color: var(--success-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 40%, transparent); }
@media (min-width: 1024px) {
  .cu-l { min-height: 52px; }
  .cu-acts .tbtn { width: 36px; height: 36px; }
  .rt-btn { width: 36px; height: 36px; }
}
/* ---------- practice: the code editor as a static recipe and the test-case table (PbCodeEditor; written with Practice 01 and 03, 2026-10-13): a language bar, line numbers and the code; the build swaps in Monaco or CodeMirror and keeps the frame ---------- */
/* the code editor frame (.ce) is shared/code.css (.code-frame.dense, .code-bar, .code-body, .code-ln, .code-src), 2026-10-19 */
.tc-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: calc(12px * var(--font-scale)); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 28ch; }
/* the test-case list (2026-10-19): a card per case; Input and Expected output side by side from 460 dp of list width, stacked and labelled below it */
.tcl { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; container-type: inline-size; }
.tcl > .tcl-i { background: var(--surface); margin-top: 0; }   /* a .pt-sub; the list's gap spaces the cases (the child selector outranks .pt-sub, written after it) */
.tcl-h { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 40px; }
.tcl-h b { font-size: calc(14px * var(--font-scale)); font-weight: 600; margin-inline-end: 2px; }
.tcl-acts { display: flex; gap: 4px; margin-inline-start: auto; }
.tcl-io { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.tcl-f { min-width: 0; }
.tcl-f .f-label { display: block; margin: 0 0 4px; }
.tcl .tc-mono { max-width: none; margin: 0; padding: 8px 10px; min-height: 36px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); }
@container (min-width: 460px) { .tcl-io { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* ---------- Notifications (portal 15, 2026-10-18): the channel chip, the campaign composer sheet and the text preview ---------- */
.chn { display: inline-flex; align-items: center; gap: 4px; font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); white-space: nowrap; }
.chn .mi { font-size: 16px; }
.cp-ch { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-ch .chip { min-height: var(--dn-field, 44px); }
.cp-aud { display: flex; flex-direction: column; gap: 8px; }
.cp-k { font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); margin-top: 4px; }
.cp-prev { margin-top: 12px; padding: 0 12px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--edge); }
.cp-prev .nt-open { min-height: 0; box-shadow: none; padding: 12px 0; }
.cp-pv { margin-top: 12px; align-items: flex-start; }
.cp-miss { color: var(--error-text); }

/* ---------- the recipes every portal page shares (2026-10-19; one recipe, one file: each of these was copied page by page before) ---------- */
.pt-error { text-align: center; }   /* the load-failed card: <div class="card pt-error"> with an icon, an h2, a .pt-meta line and Retry */
.pt-error h2 { justify-content: center; margin: 8px 0 4px; }
.pt-error .pt-meta { margin: 0 0 16px; }
.pt-lead { margin: 0 0 12px; }   /* the line under a sheet's heading: <p class="pt-meta pt-lead"> */
.pt-sheetname { margin: 0 0 8px; }   /* the applicant or job named under a sheet's heading, and the first paragraph of a sheet (2026-10-20: were inline margins in pursue.js) */
.pt-after { margin: 8px 0 0; }   /* the note after a sheet's fields: who is told, what happens next */
.pt-after-s { margin: 4px 0 0; }   /* a second such note */
.pt-between { margin: 8px 0; }   /* a note between two blocks of a sheet */
.pt-flush { margin: 0; }
.pt-hrow { display: flex; align-items: center; gap: 8px; }   /* a heading or a page head's Back and title on one row; .pt-hrow-s is the tight 4 dp gap; .pt-grow takes the rest */
.pt-hrow-s { gap: 4px; }
.pt-grow { flex: 1 1 auto; }
.pt-meter { display: block; position: relative; height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; min-width: 80px; }   /* a progress bar; the fill is its span with an inline width; a page keeps only a colour that differs on purpose */
.pt-meter > span { display: block; height: 100%; background: var(--primary); }
.pt-chk { display: flex; align-items: center; gap: 12px; min-height: var(--dn-toggle, 48px); margin-top: 12px; }   /* 12 dp above the first switch row (2026-10-27, the owner: the Tags field, which has no help line, touched the row under it); rows that follow each other keep touching */
.pt-chk + .pt-chk, .pt-chk:first-child { margin-top: 0; }   /* an editor's switch row: the label (with its small line) and the switch */
.pt-chk .lbl { flex: 1 1 auto; min-width: 0; font-size: calc(14px * var(--font-scale)); font-weight: 600; }
.pt-chk .lbl small { display: block; font-weight: 400; color: var(--text-secondary); font-size: calc(12px * var(--font-scale)); }
.pt-file { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 4px 0; border-bottom: 1px solid var(--border); }   /* an editor's file row: the kind tile (.cu-k), the name and its line, the round actions */
.pt-file:last-child { border-bottom: 0; }
.pt-file .cu-k { margin: 0; }
.pt-file .tx { flex: 1 1 auto; min-width: 0; } .pt-file .tx b { display: block; font-size: calc(14px * var(--font-scale)); overflow-wrap: anywhere; } .pt-file .tx span { font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }
.pt-file .tbtn { background: transparent; box-shadow: none; }
.pt-table .acts2 { display: flex; justify-content: flex-end; gap: 4px; }   /* a table row's action buttons: flat, 44 dp, 36 dp from 1024 */
.pt-table .acts2 .tbtn { background: transparent; box-shadow: none; width: 44px; height: 44px; }
.pt-sub { border-radius: 12px; box-shadow: inset 0 0 0 1px var(--border); padding: 8px 12px 12px; margin-top: 12px; min-width: 0; }   /* a nested panel inside a card or an editor section (a test case, a plan, a question, a table block) */
@media (min-width: 1024px) { .pt-table .acts2 .tbtn { width: 36px; height: 36px; } }

/* ---------- PbDataTable grows up (2026-11-12, backlog row 102; 01-decisions/product/data-table.md; shell.js dressTable) ----------
   The column kinds (data-k on th and td, set by shell.js) carry the widths of tokens 3.3 (Column widths), the alignment and the one-line rule; .pt-fx is the fixed
   layout (widths hold while the rows load), .pt-fit a table that fits its card (its header stays under the top bar), .pt-list the table of a list page. */
.pt-table { --col-num: 104px; --col-money: 120px; --col-date: 136px; --col-status: 176px; --col-id: 136px; --col-bool: 72px; }
.pt-table [data-k="num"], .pt-table [data-k="money"], .pt-table [data-k="date"] { font-variant-numeric: tabular-nums; }
.pt-table td[data-k="id"] code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: calc(12px * var(--font-scale)); cursor: copy; border-radius: 4px; }
.pt-nil { color: var(--text-tertiary); }
.pt-cols, .pt-colmenu { display: none; }
.pt-skel { display: block; width: 64%; min-width: 48px; height: 12px; border-radius: 4px; }
.pt-table td[data-k="identity"] .pt-skel { width: 80%; height: 16px; }
.pt-terr { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 24px 12px; text-align: center; white-space: normal; }
.pt-terr > .mi, .pt-terr > svg { font-size: 32px; width: 32px; height: 32px; color: var(--text-secondary); }
.pt-terr > span:not(.mi):not(.pb-ref) { color: var(--text-secondary); margin-bottom: 8px; }
@media (max-width: 1023px) { .pt-table tr.pt-errrow td { display: block; flex: 1 1 100%; } }
.pt-busy .pt-count, .pt-busy .pt-pager, .pt-busy .pt-head .sub { visibility: hidden; }   /* no count is known until the list has loaded */
.pt-total th { text-align: start; white-space: normal; }
.pt-total th b { display: block; font-weight: 700; color: var(--text-primary); }
.pt-total th span { display: block; font-weight: 400; font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }
.pt-total td { font-weight: 700; }
@media (max-width: 1023px) {   /* the row form: the totals are one last block under the rows, each sum with its column's name; nothing is sticky */
  .pt-table tfoot { display: block; border-top: 1px solid var(--border); }
  .pt-table tfoot th { flex: 1 1 100%; padding: 0; border: 0; font-size: calc(14px * var(--font-scale)); }
}
@media (min-width: 1024px) {
  .pt-table.pt-fx { table-layout: fixed; min-width: var(--pt-min, 0px); }
  .pt-table.pt-fx th { box-sizing: border-box; }   /* a column width is the whole cell, padding included */
  .pt-table.pt-fx th, .pt-table.pt-fx td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* one line a cell; the full text is the cell's title on hover */
  .pt-table.pt-fx [data-k="actions"], .pt-table.pt-fx .sel, .pt-table.pt-fx tr.pt-errrow td { overflow: visible; text-overflow: clip; }
  .pt-table .pt-clamp, .pt-table.pt-fx td[data-k="long"] .msg { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; max-width: none; white-space: normal; }   /* the one kind that wraps: plain long text, two lines */
  /* a composite cell (a title with facts, a pill with a fact, a tile with a name) is at most two lines, each one line with its own ellipsis; a third fact is in the cell's title and on the detail page */
  .pt-table.pt-fx td :is(span, a, b):not(.orgtile):not(.cu-k):not(.mi):not(.pt-nil) { min-width: 0; }
  .pt-table.pt-fx td :is(b, .sub, .state, .pt-meta) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; max-width: 100%; }
  .pt-table.pt-fx td > * > span:not(.spill):not(.orgtile):not(.cu-k):not(.mi):not(.pb-avatar), .pt-table.pt-fx td .who > span:not(.orgtile) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* the text beside a tile or before a pill: one line, never a hard cut */
  .pt-table.pt-fx td :is(.orgcell, .who) > span > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pt-table.pt-fx td > .state ~ .state { display: none; }
  .pt-table.pt-fx td .chips, .pt-table.pt-fx td [class$="-mem"] { flex-wrap: nowrap; min-width: 0; max-width: 100%; }
  .pt-table.pt-fx td .spill { display: inline-block; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }   /* a pill never leaves its cell: it ends in an ellipsis inside the pill */
  .pt-table.pt-fx td .chips > .spill { flex: 0 1 auto; }
  .pt-table.pt-fx td .spill > .mi, .pt-table.pt-fx td .spill > svg { vertical-align: -2px; margin-inline-end: 4px; }
  .pt-table.pt-fx .ordcell .who { position: relative; min-height: 24px; }   /* the order id over the person, on two lines; the link keeps a 36 dp hit area */
  .pt-table.pt-fx .ordcell .who::after { content: ""; position: absolute; inset: -6px 0; }
  .pt-table.pt-fx td .ordcell .who > span:not(.orgtile):not(.cu-k) { display: flex; align-items: baseline; gap: 6px; }   /* the name and the address share the second line */
  .pt-table.pt-fx td .ordcell .who > span:not(.orgtile):not(.cu-k) > b { flex: 0 1 auto; }
  .pt-table.pt-fx td .ordcell .who > span:not(.orgtile):not(.cu-k) > span:not(.orgtile) { flex: 1 1 0; }
  .pt-table.pt-fx td .ordcell > .link { min-height: 0; }
  .pt-table.pt-fx.pt-fx tbody td { padding-block: 4px; }
  .pt-table.pt-fx.pt-fx tbody td .tbtn { width: 36px; height: 36px; }   /* the dense control, whatever the page's cell said */
  .pt-table.pt-fx.pt-fx tbody td a:not(.tbtn):not(.btn) { min-height: 0; }   /* a name link is one line of the row; the row itself opens on a click */
  .pt-table.pt-fx.pt-fx tbody td .state .mi, .pt-table.pt-fx.pt-fx tbody td .state svg { font-size: 14px; width: 14px; height: 14px; }
  /* every part of a cell is one line (the page classes that wrapped a reason or a headline lose here), pills share a line, and the lines after the second are hidden (shell.js limitLines) */
  .pt-table.pt-fx.pt-fx tbody td:not([data-k="actions"]):not(.sel) :not(.pt-clamp):not(.msg) { white-space: nowrap; overflow-wrap: normal; }
  .pt-table.pt-fx.pt-fx tbody td:not([data-k="actions"]):not(.sel) :is(b, a, span, div):not(.pt-clamp):not(.msg):not(.orgtile):not(.cu-k):not(.mi):not(.pb-avatar):not(.pt-nil):not(.sw):not([class*="tile"]):not([class*="thumb"]):not([class*="cover"]):not([class*="logo"]):not([class*="meter"]):not([class*="bar"]):not([class*="track"]):not([class*="fill"]) { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .pt-table.pt-fx.pt-fx tbody td :is([class*="pills"], [class*="tags"]) { flex-wrap: nowrap; }
  .pt-table.pt-fx.pt-fx.pt-fx tbody td :is([class*="pills"], [class*="tags"], .chips) > :first-child { flex-shrink: 0; }   /* the first pill is the state and reads whole; the ones after it give way */
  .pt-table.pt-fx.pt-fx tbody td :is([class*="pills"], [class*="tags"], [class*="sub"], .state) { margin-block: 0; }
  .pt-table.pt-fx tbody tr.pt-two > td { height: 56px; }   /* a row with a second line anywhere is the 56 dp row, never something between */
  .pt-table.pt-fx.pt-fx tbody td [class*="pills"] > .spill { flex: 0 1 auto; }
  .pt-table.pt-fx.pt-fx tbody td .pt-x3.pt-x3 { display: none; }
  .pt-table.pt-fx th[data-k="num"] { width: var(--col-num); }
  .pt-table.pt-fx th[data-k="money"] { width: var(--col-money); }
  .pt-table.pt-fx th[data-k="date"] { width: var(--col-date); }
  .pt-table.pt-fx th[data-k="status"] { width: var(--col-status); }
  .pt-table.pt-fx th[data-k="id"] { width: var(--col-id); }
  .pt-table.pt-fx th[data-k="bool"] { width: var(--col-bool); }
  .pt-table.pt-fx th[data-k="actions"] { width: var(--pt-acts, 60px); }
  .pt-table.pt-fx th[data-k="identity"], .pt-table.pt-fx th[data-k="long"], .pt-table.pt-fx th[data-k="text"] { width: var(--pt-w, auto); }
  .pt-table.pt-fx.pt-fx th[data-k="status"] { width: var(--pt-w, 176px); }   /* the flexible kinds: their minimum plus a share of the room left (shell.js) */
  .pt-table [data-k="num"], .pt-table [data-k="money"] { text-align: end; }   /* numbers and money end-aligned, so the digits line up */
  .pt-table th.sortable[data-k="num"] button, .pt-table th.sortable[data-k="money"] button { flex-direction: row-reverse; margin-inline: 0 -4px; }
  .pt-table.pt-fx td[data-k="status"] .spill { max-width: 100%; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
  .pt-table tfoot th, .pt-table tfoot td { border-bottom: 0; box-shadow: inset 0 1px 0 var(--border); }
  .pt-table .pt-off { display: none; }
  .pt-table.pt-fx .state { overflow: hidden; text-overflow: ellipsis; }   /* a status's second fact: one line under the pill, never three */
  .pt-table.pt-fx tbody tr:has(.state, .orgcell b + span, .who b + span) > td { height: 56px; }   /* the two-line row of the density scale */
  .pt-scroll.pt-fit { overflow: visible; contain: none; }
  .pt-scroll.pt-fit > .pt-table.pt-list thead th { position: sticky; top: var(--pt-top, 72px); z-index: 3; background: var(--surface); border-bottom-color: transparent; box-shadow: inset 0 -1px 0 var(--border); }   /* the line is a shadow: a collapsed border does not travel with a sticky cell */
  .pt-scroll.pt-fit > .pt-table.pt-list tfoot th, .pt-scroll.pt-fit > .pt-table.pt-list tfoot td { position: sticky; bottom: 0; z-index: 2; background: var(--surface); box-shadow: inset 0 1px 0 var(--border); }
  .pt-table tfoot th, .pt-table tfoot td { padding: 8px 12px; height: 56px; box-sizing: border-box; font-size: calc(13px * var(--font-scale)); }
  .pt-filter:has(> .pt-cols) { position: relative; }   /* only the bar that holds the chooser: its menu hangs from it */
  .pt-cols { display: inline-flex; margin-inline-start: auto; background: transparent; box-shadow: none; position: relative; }
  .pt-cols[data-hidden]::after { content: ""; position: absolute; inset-block-start: 6px; inset-inline-end: 6px; width: 8px; height: 8px; border-radius: 999px; background: var(--primary); }
  .pt-colmenu { display: block; position: absolute; inset-inline-end: 0; top: 100%; z-index: 30; min-width: 240px; max-height: 60vh; overflow-y: auto; margin-top: 4px; padding: 8px; border-radius: 12px; background: var(--surface); box-shadow: var(--elev-3), inset 0 0 0 1px var(--border); }
  .pt-colmenu .opt[aria-disabled="true"] { opacity: .55; cursor: default; }
  .pt-colmenu .opt[data-colreset] { margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; }
}

/* ---------- motion (tokens 5: fast 150, standard 300; portal-shell.md, Motion; 2026-11-12, proposed) ---------- */
/* Arriving: the page's blocks rise in, a little apart, once per page load (html.pb-enter is on for the first 600 ms, so a redraw never replays it). */
@keyframes pt-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pt-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pt-pop { from { opacity: 0; transform: translateY(-4px) scale(.97); } to { opacity: 1; transform: none; } }
.pb-enter .pb-content :is(.dh, .pt-filter, .pt-tabs, .card:not(.card .card), .q-row) { animation: pt-in 300ms cubic-bezier(.16, 1, .3, 1) both; }
.pb-enter .pb-content :is(.card:not(.card .card), .q-row):nth-child(n+2) { animation-delay: 150ms; }   /* two beats: the head of the page, then what follows it */
/* A redraw the person asked for (a tab, a filter chip, a sort, a page): what changed fades in, fast, nothing slides. */
.pb-swap .pb-content :is(.pt-table tbody, .card:not(.card .card):not(:has(.pt-table)), .q-list) { animation: pt-fade 150ms ease-out both; }
/* Hover and press: every control answers within 150 ms. Rows and clickable cards keep the one hover recipe (tokens 4.4: the title takes primary, the ring tints; never a fill, never a lift). */
.pb-nav a, .pt-tab, .pt-fchips button, th.sortable { transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, box-shadow 150ms ease; }
:is(.pt-fchips button, .pt-tab):active { transform: scale(.97); }
/* A menu opens from its button. */
.pt-colmenu, .pb-shell [role="menu"] { animation: pt-pop 150ms cubic-bezier(.16, 1, .3, 1) both; transform-origin: top; }
.pt-tab { transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease; }
@media (prefers-reduced-motion: reduce) {
  .pb-enter .pb-content *, .pb-swap .pb-content *, .pt-colmenu, .pb-shell [role="menu"] { animation: none !important; }
  .pb-nav a, .pt-tab, .pt-fchips button, th.sortable { transition: none; }
  :is(.pt-fchips button, .pt-tab):active { transform: none; }
}

/* ---------- a row opened in place (shell.js markCut; detail-page tables: timelines, histories, runs) ---------- */
.pt-table th.pt-morecol { width: 48px; } .pt-table td.pt-morecell { text-align: end; padding-inline: 0 4px; }
.pt-table tr.pt-cut, .pt-table tr.pt-open { cursor: pointer; }
.pt-table .pt-more .mi { transition: transform 150ms ease; } .pt-table tr.pt-open .pt-more .mi { transform: rotate(180deg); }
.pt-table.pt-fx.pt-fx.pt-fx tr.pt-open > td:not(.pt-morecell), .pt-table.pt-fx.pt-fx.pt-fx tr.pt-open > td:not(.pt-morecell) * { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; -webkit-line-clamp: unset; max-height: none; }   /* !important: the one-line rule above carries a long :not() chain no selector here outranks, and an open row was still cut (engine 06, 2026-11-13) */
.pt-table.pt-fx.pt-fx.pt-fx tr.pt-open .pt-x3.pt-x3 { display: revert; }
.pt-table.pt-fx.pt-fx.pt-fx tr.pt-open > td { vertical-align: top; padding-block: 12px; }
@media (prefers-reduced-motion: reduce) { .pt-table .pt-more .mi { transition: none; } }
/* columns set aside (shell.js sizeTable, 2026-11-13): a detail-page table too wide for its card hides its last columns from 1024 dp and the open row lists them under it, each under its heading; the card never scrolls sideways */
/* a pill is whole or counted (shell.js plusPills) */
.pt-table .pt-pillx { display: none !important; } .pt-table.pt-fx.pt-fx.pt-fx tbody td .pt-plus { flex: 0 0 auto; overflow: visible; }
@media (min-width: 1024px) { .pt-table .pt-aside { display: none; } .pt-table tr.pt-open:has(+ .pt-rest) > td { border-bottom-color: transparent; } }
.pt-table tr.pt-rest > td { padding: 0 12px 12px; }
.pt-table .pt-restin { display: flex; flex-wrap: wrap; gap: 8px 32px; }
.pt-table .pt-restk { display: block; font-size: calc(12px * var(--font-scale)); font-weight: 600; color: var(--text-secondary); }
.pt-table.pt-fx.pt-fx.pt-fx tr.pt-rest > td * { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }
.pt-table.pt-fx.pt-fx.pt-fx tr.pt-rest .pt-x3.pt-x3 { display: revert; }

/* a table inside a sheet: the secondary columns step aside and the words wrap, so nothing runs past the sheet's edge */
.sheet2 .pt-table :is(th, td).c-x { display: none; }
.sheet2 .pt-table { width: 100%; table-layout: auto; } .sheet2 .pt-table :is(th, td) { white-space: normal; overflow-wrap: anywhere; }
.sheet2 .pt-scroll { overflow-x: auto; }

/* a card is never widened by what is inside it: as a grid or flex child it may shrink, and a wide table scrolls inside its own frame (organisations 04 at 1024: the cards ran past the screen, 2026-11-13) */
.pb-content .card { min-width: 0; } .pb-content .card > .pt-scroll { max-width: 100%; }

/* a words column that wraps (kind long) wraps its parts too: a nowrap part inside it ran past the card (news 01, Licence, 2026-11-13) */
.pt-table.pt-fx.pt-fx td[data-k="long"] :is(span, b, a):not(.spill):not(.mi):not(.pt-nil) { white-space: normal; overflow-wrap: anywhere; }
