/* ================================================================ EntitleWorks design system, concept of 18 October 2026
   One layer, loaded after every other stylesheet, so it can be switched off by removing one line from index.html.
   It changes how the app looks and moves, never what it says or does.

   Sources: Apple Human Interface Guidelines (typography: body 17 pt, minimum 11 pt, a fixed text-style ladder; layout:
   44 pt touch targets; materials: translucent bars that let content show through), Nielsen Norman Group (animations
   100 to 400 ms, ease-out for entering; skeleton screens for full-page loads of 1 to 10 seconds), Linear's 2024 and
   2026 redesigns ("structure should be felt, not seen": softer, quieter borders; fewer, smaller icons; display
   type only for headings), WCAG 2.2 (1.4.3 text 4.5:1; 1.4.11 controls and focus 3:1).

   House rules kept: ink #123E35 and lime #C4F578; red, amber and green only ever beside their word; never blue. */

@font-face { font-family: "Inter Display"; font-weight: 600; font-display: swap; src: url("/static/fonts/InterDisplay-SemiBold.woff") format("woff"); }
@font-face { font-family: "Inter Display"; font-weight: 700; font-display: swap; src: url("/static/fonts/InterDisplay-Bold.woff") format("woff"); }

:root {
  /* ---- colour: the brand, plus the two tokens the audit found missing */
  --ds-ink: #123e35;
  --ds-lime: #c4f578;
  --ds-lime-press: #afe25c;      /* lime, one step darker: hover and press */
  --ds-text-2: #456358;          /* secondary text: 6.1:1 on paper (was sage at 3.97:1 in places) */
  --ds-text-3: #50695f;          /* tertiary text, still AA: 5.6:1 on paper */
  --ds-hair: rgba(18, 62, 53, .10);       /* dividers: felt, not seen */
  --ds-edge: #7a9387;            /* field and control borders: 3.3:1 on white, 3.1:1 on canvas (WCAG 1.4.11) */
  --ds-fill: rgba(18, 62, 53, .045);      /* quiet hover fill */
  --ds-fill-2: rgba(18, 62, 53, .08);     /* pressed fill */
  --ds-canvas: #f6f7f2;
  --ds-surface: #ffffff;
  --ds-material: rgba(246, 247, 242, .78);/* translucent bars (top bar, phone tab bar) */

  /* ---- type: Apple's ladder at web sizes; Inter for text, Inter Display from 20 px up */
  --ds-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ds-font-display: "Inter Display", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ds-t-caption: 12px;   --ds-l-caption: 16px;
  --ds-t-footnote: 13px;  --ds-l-footnote: 18px;
  --ds-t-subhead: 14px;   --ds-l-subhead: 20px;
  --ds-t-callout: 15px;   --ds-l-callout: 22px;
  --ds-t-body: 16px;      --ds-l-body: 24px;
  --ds-t-headline: 17px;  --ds-l-headline: 24px;
  --ds-t-title3: 20px;    --ds-l-title3: 26px;
  --ds-t-title2: 24px;    --ds-l-title2: 30px;
  --ds-t-title1: 30px;    --ds-l-title1: 36px;
  --ds-t-large: 36px;     --ds-l-large: 42px;
  --ds-track-display: -0.022em;

  /* ---- space: a 4 px grid */
  --ds-1: 4px; --ds-2: 8px; --ds-3: 12px; --ds-4: 16px; --ds-5: 20px; --ds-6: 24px; --ds-8: 32px; --ds-10: 40px; --ds-12: 48px; --ds-16: 64px;

  /* ---- shape */
  --ds-r-xs: 6px; --ds-r-sm: 10px; --ds-r-md: 14px; --ds-r-lg: 20px; --ds-r-pill: 999px;

  /* ---- depth: four steps, all tinted with the ink, never grey or blue */
  --ds-e1: 0 1px 2px rgba(18, 62, 53, .05), 0 1px 1px rgba(18, 62, 53, .03);
  --ds-e2: 0 2px 6px rgba(18, 62, 53, .06), 0 8px 24px rgba(18, 62, 53, .06);
  --ds-e3: 0 4px 12px rgba(18, 62, 53, .08), 0 16px 40px rgba(18, 62, 53, .12);
  --ds-e4: 0 12px 32px rgba(18, 62, 53, .14), 0 32px 80px rgba(18, 62, 53, .20);

  /* ---- motion: short, ease-out in, a little faster out */
  --ds-d-press: 100ms; --ds-d-quick: 160ms; --ds-d-enter: 220ms; --ds-d-exit: 160ms;
  --ds-ease-out: cubic-bezier(.2, .8, .2, 1);
  --ds-ease-in: cubic-bezier(.4, 0, 1, 1);

  /* ---- focus: ink ring with a lime halo, 3:1 or better on every surface */
  --ds-focus: 0 0 0 2px var(--ds-surface), 0 0 0 4px var(--ds-ink), 0 0 0 7px rgba(196, 245, 120, .9);

  /* ---- layout */
  --ds-content: 860px;   /* Home, Dashboard, Your work; a piece of work (920) and a project (1000) keep their widths */
  /* The readable measure (Han, 12 November 2026, option B): running text is held to about 95 characters a line. A ch is
     the width of "0", wider than the average letter: measured in this typeface, 70ch holds about 95 characters of
     English and about 100 of Arabic at every text size. Boxes, cards and tables are not held: they fill the width. */
  --ds-measure: 70ch;

  /* existing tokens pointed at the system, so every older rule follows it */
  --radius-lg: var(--ds-r-md);
  --radius-sm: var(--ds-r-sm);
  --pill: var(--ds-r-pill);
  --line: #dfe8e2;
  --sage: var(--ds-text-3);
  font-family: var(--ds-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
@media (max-width: 640px) {
  :root { --ds-t-body: 17px; --ds-t-large: 30px; --ds-l-large: 36px; --ds-t-title1: 24px; --ds-l-title1: 30px; }
}

/* ================================================================ type */
body { font-size: var(--ds-t-body); line-height: var(--ds-l-body); background: var(--ds-canvas); }
h1, .pf-headline, .wk-status, .dash-head h1, .verdict > .risk { font-family: var(--ds-font-display); letter-spacing: var(--ds-track-display); }
h1 { font-size: var(--ds-t-large); line-height: var(--ds-l-large); font-weight: 700; margin: 0 0 var(--ds-3); text-wrap: balance; }
h2 { font-size: var(--ds-t-title3); line-height: var(--ds-l-title3); font-weight: 600; letter-spacing: -0.012em; }
h3 { font-size: var(--ds-t-headline); line-height: var(--ds-l-headline); font-weight: 600; }
.projects-head h2, .gs-head h2, #recent-h, .dn-head h2 { font-family: var(--ds-font-display); font-size: var(--ds-t-title2); line-height: var(--ds-l-title2); font-weight: 700; letter-spacing: var(--ds-track-display); }
.card h2 { font-size: var(--ds-t-title3); line-height: var(--ds-l-title3); }
.lede { font-size: var(--ds-t-headline); line-height: 26px; color: var(--ds-text-2); }
.hint, .meta, .status { font-size: var(--ds-t-subhead); line-height: var(--ds-l-subhead); color: var(--ds-text-2); }
#job .meta, #ct-meta { font-size: var(--ds-t-callout); }
.src, ol.fnotes, .foot, .foot-copy { font-size: var(--ds-t-footnote); line-height: var(--ds-l-footnote); }
.pill, .tag, .ktag, .sev, .type { font-size: var(--ds-t-caption); line-height: var(--ds-l-caption); font-weight: 600; letter-spacing: .005em; }
/* Figures line up in columns everywhere a number is read against another. */
table, .dn-num strong, .at-risk .tile strong, .pf-tile, .credits, .chrono .date, time { font-variant-numeric: tabular-nums; }

/* ================================================================ focus */
:focus-visible { outline: none; box-shadow: var(--ds-focus); border-radius: var(--ds-r-xs); }
.btn:focus-visible, .raillink:focus-visible, .rail-job:focus-visible { border-radius: inherit; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .search:focus-visible { box-shadow: var(--ds-focus); border-color: var(--ds-ink); }
.drop:focus-within { outline: none; box-shadow: var(--ds-focus); }
/* On the dark Portfolio and claim-file heroes the ring turns lime-first. */
.pf-hero :focus-visible, .pf :focus-visible { box-shadow: 0 0 0 2px var(--ds-ink), 0 0 0 5px var(--ds-lime); }

/* ================================================================ buttons: primary, secondary, quiet */
.btn { min-height: 40px; padding: 0 var(--ds-5); display: inline-flex; align-items: center; justify-content: center; gap: var(--ds-2);
  font-size: var(--ds-t-callout); line-height: 1.2; font-weight: 600; letter-spacing: -0.005em;
  border-radius: var(--ds-r-pill); border: 1px solid var(--ds-edge); background: var(--ds-surface); color: var(--ds-ink);
  transition: background-color var(--ds-d-quick) var(--ds-ease-out), border-color var(--ds-d-quick) var(--ds-ease-out),
              box-shadow var(--ds-d-quick) var(--ds-ease-out), transform var(--ds-d-press) var(--ds-ease-out);
  -webkit-tap-highlight-color: transparent; user-select: none; }
.btn:hover { background: #f1f5f2; border-color: var(--ds-ink); }
.btn:active:not(:disabled) { transform: scale(.97); background: #e7eee9; }
.btn.primary { background: var(--ds-lime); border-color: var(--ds-lime); color: var(--ds-ink); box-shadow: inset 0 -1px 0 rgba(18, 62, 53, .12); }
.btn.primary:hover { background: var(--ds-lime-press); border-color: var(--ds-lime-press); }
.btn.primary:active:not(:disabled) { background: #a3d64f; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ds-text-2); }
.btn.quiet:hover { background: var(--ds-fill); color: var(--ds-ink); text-decoration: none; }
.btn.quiet:active:not(:disabled) { background: var(--ds-fill-2); }
.btn.small { min-height: 32px; padding: 0 var(--ds-4); font-size: var(--ds-t-subhead); }
.btn.executed { background: var(--ds-ink); border-color: var(--ds-ink); color: #fff; }
.btn.danger-btn { background: var(--critical); border-color: var(--critical); color: #fff; }
.btn:disabled { opacity: .4; }
.btn.quiet.delete-btn, .btn.quiet.delete-btn:hover { color: var(--critical); }
/* Links and icon buttons press too. */
.linkbtn, .more > summary, .help-btn, .more-btn, .chip, .filter button, .hats button, .seg button { transition: background-color var(--ds-d-quick) var(--ds-ease-out), transform var(--ds-d-press) var(--ds-ease-out); -webkit-tap-highlight-color: transparent; }
.more > summary:active, .help-btn:active, .more-btn:active, .chip:active, .filter button:active, .hats button:active { transform: scale(.94); }
.help-btn { width: 32px; height: 32px; border-width: 1px; font-size: var(--ds-t-subhead); }
.more > summary { width: 32px; height: 32px; border-color: var(--ds-hair); }

/* One primary action per screen: Settings had 13 lime buttons in view. Inside Settings sections the
   buttons are secondary; the one action that matters on the screen stays lime. */
#settings .setting .btn.primary { background: var(--ds-surface); border-color: var(--ds-edge); box-shadow: none; }
#settings .setting .btn.primary:hover { background: #f1f5f2; border-color: var(--ds-ink); }

/* ================================================================ fields */
.edit, .note, .search, .track select, .track input, .project-pick select, .project-pick input, .dash-switch select,
input[type="text"], input[type="email"], input[type="number"], input[type="search"], input[type="date"], select, textarea {
  border-color: var(--ds-edge); border-radius: var(--ds-r-sm);
  transition: border-color var(--ds-d-quick) var(--ds-ease-out), box-shadow var(--ds-d-quick) var(--ds-ease-out); }
.search, .dash-switch select { border-radius: var(--ds-r-pill); }
input:hover, select:hover, textarea:hover { border-color: var(--ds-ink); }

/* ================================================================ surfaces: canvas, panel, card */
main { padding: var(--ds-8) var(--ds-5) var(--ds-16); }
.projects-wrap, .dash { max-width: var(--ds-content); }
@media (min-width: 641px) {
  .projects-wrap { max-width: var(--ds-content); }
  main:has(#start:not([hidden])) > .panel { max-width: var(--ds-content); }
}
.panel { border: 1px solid var(--ds-hair); border-radius: var(--ds-r-lg); box-shadow: var(--ds-e1); padding: var(--ds-8); }  /* 32 px: all ten project tabs fit on a computer */
.card, .project, .export, .progress-card, .now-strip, .getstarted, .setting, .verdict, .levels div, .use-contract {
  border-color: var(--ds-hair); }
/* The quieter hairline keeps each accent stroke that carries meaning (rel/2026-10-18e visual check: Get started's lime
   top showed as a grey band, and a medium-risk verdict lost its amber stripe). Higher-risk verdicts keep theirs (:has). */
.getstarted { border-top-color: var(--lime); }
.verdict { border-left-color: var(--medium); }
.card, .project, .export, .progress-card { border-radius: var(--ds-r-md); box-shadow: var(--ds-e1); }
.project { padding: var(--ds-5) var(--ds-6); transition: box-shadow var(--ds-d-quick) var(--ds-ease-out); }
.project:hover { box-shadow: var(--ds-e2); }
.card { padding: var(--ds-6); }
.verdict { border-radius: var(--ds-r-md); box-shadow: var(--ds-e1); padding: var(--ds-6); }

/* Stat tiles: one grouped card with hairline dividers (the Dashboard's style) on Home as well. */
.at-risk { gap: 0; background: var(--ds-surface); border: 1px solid var(--ds-hair); border-radius: var(--ds-r-md); box-shadow: var(--ds-e1); overflow: hidden; }
.at-risk .tile { border: 0; border-radius: 0; background: transparent; padding: var(--ds-4) var(--ds-5); }
.at-risk .tile + .tile { box-shadow: inset 1px 0 0 var(--ds-hair); }
.at-risk .tile strong { font-family: var(--ds-font-display); font-size: var(--ds-t-title2); line-height: var(--ds-l-title2); font-weight: 700; }  /* title 2: "GBP 1.26 million" stays on one line */
.at-risk .tile span { font-size: var(--ds-t-subhead); line-height: var(--ds-l-subhead); }
.at-risk .tile.warn { background: #fdf6ef; }
.at-risk .tile.bad { background: #fcf0ef; }
.dn-numbers { border-color: var(--ds-hair); border-radius: var(--ds-r-md); box-shadow: var(--ds-e1); }
.dn-num { transition: background-color var(--ds-d-quick) var(--ds-ease-out); }
.dn-num:hover { background: var(--ds-fill); }
.dn-num + .dn-num { border-left-color: var(--ds-hair); }

/* ================================================================ top bar: a translucent material that stays put */
.top { position: sticky; top: 0; z-index: 30; padding: var(--ds-3) var(--ds-6); min-height: 60px;
  background: var(--ds-material); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--ds-hair); }
.brand { font-family: var(--ds-font-display); font-size: var(--ds-t-title3); letter-spacing: -0.03em; }
.brand span { color: #5f826f; }  /* the logotype's second half; a mark, not text to read */
@media (min-width: 1100px) {
  .rail { top: 60px; min-height: calc(100vh - 60px); max-height: calc(100vh - 60px); padding: var(--ds-6) var(--ds-4) var(--ds-10) var(--ds-5); border-right-color: var(--ds-hair); }
}

/* ================================================================ left rail: quiet selection, as in a Mac sidebar */
.rail-new { display: flex; width: 100%; margin-bottom: var(--ds-5); min-height: 40px; }
.raillink { padding: var(--ds-2) var(--ds-3); border-radius: var(--ds-r-sm); font-size: var(--ds-t-callout); transition: background-color var(--ds-d-quick) var(--ds-ease-out); }
.raillink:hover { background: var(--ds-fill); }
.raillink[aria-current="page"] { background: rgba(18, 62, 53, .09); color: var(--ds-ink); font-weight: 600; }
.rail-h { font-size: var(--ds-t-footnote); font-weight: 600; color: var(--ds-text-2); margin: var(--ds-2) 0 var(--ds-1) var(--ds-3); }
.rail-group h3 { font-size: var(--ds-t-caption); line-height: var(--ds-l-caption); color: var(--ds-text-2); margin: var(--ds-4) 0 var(--ds-1) var(--ds-3); }
.rail-job { font-size: var(--ds-t-subhead); padding: 6px var(--ds-3); transition: background-color var(--ds-d-quick) var(--ds-ease-out); }
.rail-job:hover { background: var(--ds-fill); }
.rail-job[aria-current="page"] { background: rgba(18, 62, 53, .09); box-shadow: none; font-weight: 600; }
.ktag { font-size: 11px; padding: 0 6px; background: transparent; box-shadow: inset 0 0 0 1px var(--ds-hair); }
.ktag.claim, .ktag.notice { background: transparent; }

/* ================================================================ tabs: underline that settles, edges that hint at more */
.tabs:not(.ptabs) { gap: var(--ds-1); border-bottom-color: var(--ds-hair); margin: var(--ds-5) 0 var(--ds-6); scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.tabs:not(.ptabs) button { position: relative; padding: var(--ds-3); font-size: var(--ds-t-callout); font-weight: 500; color: var(--ds-text-2); border-bottom: 0; scroll-snap-align: start;
  transition: color var(--ds-d-quick) var(--ds-ease-out); }
.tabs:not(.ptabs) button::after { content: ""; position: absolute; left: var(--ds-3); right: var(--ds-3); bottom: 0; height: 2px; border-radius: 2px; background: var(--ds-ink);
  transform: scaleX(0); transition: transform var(--ds-d-enter) var(--ds-ease-out); }
.tabs:not(.ptabs) button:hover { color: var(--ds-ink); }
/* The chosen tab is drawn heavier with a hairline stroke, not a bolder font, so the row never changes width. */
.tabs:not(.ptabs) button[aria-current="page"] { color: var(--ds-ink); font-weight: 500; -webkit-text-stroke: .45px currentColor; }
.tabs:not(.ptabs) button[aria-current="page"]::after { transform: scaleX(1); }
/* The project's tabs keep their own scroll hints; they share the colours, stroke and timing. */
#ct-body .ptabs button { font-weight: 400; transition: color var(--ds-d-quick) var(--ds-ease-out), border-color var(--ds-d-enter) var(--ds-ease-out); }
#ct-body .ptabs button[aria-current="page"] { font-weight: 400; -webkit-text-stroke: .45px currentColor; }
.ptabs-row { border-bottom-color: var(--ds-hair); }

/* ================================================================ tables: room to breathe, figures aligned */
table.grid { font-size: var(--ds-t-subhead); line-height: var(--ds-l-subhead); border-collapse: separate; border-spacing: 0; }
table.grid thead th { font-size: var(--ds-t-caption); line-height: var(--ds-l-caption); font-weight: 600; color: var(--ds-text-2); text-transform: none; letter-spacing: .01em;
  padding: var(--ds-2) var(--ds-3); border-bottom: 1px solid var(--line); background: var(--ds-surface); position: sticky; top: 60px; z-index: 1; }
table.grid td, table.grid tbody th { padding: var(--ds-3); border-bottom: 1px solid var(--ds-hair); }  /* a row's own label scrolls with its row (rel/2026-10-18e: sticky row labels piled up over the header) */
table.grid tbody tr { transition: background-color var(--ds-d-quick) var(--ds-ease-out); }
table.grid tbody tr:hover { background: #f7faf8; }
@media (max-width: 640px) { table.grid thead th { top: 0; position: static; } table.grid td, table.grid tbody th { padding: var(--ds-3) var(--ds-2); } }
/* The project's register tables: the same header and rhythm; a long first cell wraps instead of running into the next. */
.hub-table th { font-size: var(--ds-t-caption); line-height: var(--ds-l-caption); letter-spacing: .01em; padding: var(--ds-2) var(--ds-4) var(--ds-2) 0; border-bottom-color: var(--line); }
.hub-table td { padding: var(--ds-3) var(--ds-4) var(--ds-3) 0; border-bottom-color: var(--ds-hair); }
.hub-table td.hub-first { white-space: normal; min-width: 22ch; }
.hub-table td.hub-first.hub-short { min-width: 0; white-space: nowrap; overflow-wrap: normal; }  /* a short reference: the width of its words (14 November 2026) */
.hub-table tbody tr td { transition: background-color var(--ds-d-quick) var(--ds-ease-out); }

/* ================================================================ rows and lists */
.issue, .rows > li, .history li, .mini button, .chrono, .project-jobs li { border-color: var(--ds-hair); }
.issue > button, .row-head { padding: var(--ds-4) var(--ds-2); margin: 0 calc(-1 * var(--ds-2)); width: calc(100% + 2 * var(--ds-2)); border-radius: var(--ds-r-sm);
  transition: background-color var(--ds-d-quick) var(--ds-ease-out); }
.issue > button:hover, .row-head:hover { background: var(--ds-fill); }

/* ================================================================ project bar on a piece of work: one line, quiet */
.project-bar { gap: var(--ds-2) var(--ds-3); padding: var(--ds-3) var(--ds-4); border-color: var(--ds-hair); background: #f4f8f5; border-radius: var(--ds-r-md); }
.project-bar .btn { min-height: 36px; }

/* ================================================================ empty states */
.history li.empty, .hub-empty, .empty-state { border: 1px dashed #c3d3cb; border-radius: var(--ds-r-md); background: #f8fbf9; padding: var(--ds-8) var(--ds-6); }

/* ================================================================ dialogs and menus: lift and settle */
dialog#sheet { border-radius: var(--ds-r-lg); box-shadow: var(--ds-e4); }
dialog#sheet::backdrop { background: rgba(9, 31, 26, .32); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.more-menu, .acct-menu { border-color: var(--ds-hair); border-radius: var(--ds-r-md); box-shadow: var(--ds-e3); }
.more-menu button, .more-menu a { border-radius: var(--ds-r-xs); }

/* ================================================================ skeletons in place of "Loading…" (ds.js marks them) */
.ds-skel { position: relative; min-height: 132px; margin: var(--ds-2) 0 var(--ds-6); color: transparent !important; user-select: none; border-radius: var(--ds-r-sm); overflow: hidden; }
.ds-skel::before { content: ""; position: absolute; inset: 0; border-radius: inherit;
  background:
    linear-gradient(90deg, transparent 0, rgba(255, 255, 255, .7) 50%, transparent 100%) -100% 0 / 50% 100% no-repeat,
    linear-gradient(#e8efea, #e8efea) 0 4px / 42% 16px no-repeat,
    linear-gradient(#eef3f0, #eef3f0) 0 40px / 100% 12px no-repeat,
    linear-gradient(#eef3f0, #eef3f0) 0 64px / 92% 12px no-repeat,
    linear-gradient(#eef3f0, #eef3f0) 0 88px / 78% 12px no-repeat,
    linear-gradient(#eef3f0, #eef3f0) 0 112px / 60% 12px no-repeat; }
@media (prefers-reduced-motion: no-preference) {
  .ds-skel::before { animation: ds-shimmer 1.4s var(--ds-ease-out) infinite; }
}
@keyframes ds-shimmer { to { background-position: 200% 0, 0 4px, 0 40px, 0 64px, 0 88px, 0 112px; } }

/* ================================================================ no layout shift */
/* The footer starts below the fold, so content arriving never pushes it about on screen. */
.shell { min-height: calc(100vh - 60px); }
/* Home: "Start something new" waits, unseen, until the projects above it have arrived (ds.js lifts it). */
#start.ds-wait { visibility: hidden; }
/* Settings: the plan's two lines arrive after the page, and pushed every section below them down (layout shift 0.11).
   Their space is held while they are empty: one line for the plan, two for the questions to Jono. */
#plan-line:empty { min-height: var(--ds-l-body); }
#plan-jono:empty { min-height: calc(2 * var(--ds-l-body)); }
/* A tab's body keeps its height while the next tab's data arrives. */
#job-result .view, #ct-body .view { min-height: 240px; }

/* ================================================================ motion: screens and tabs arrive, never jump */
/* Screens and tab bodies fade only, and only while arriving (fill "backwards"): a transform or filter left on a
   section would capture the fixed Ask Jono button, the "Saved" note and the reader's controls. Movement is kept
   for list items and overlays, which hold nothing fixed. */
@media (prefers-reduced-motion: no-preference) {
  main > section:not([hidden]) { animation: ds-fade var(--ds-d-enter) var(--ds-ease-out) backwards; }
  #job-result .view, #ct-body .view, #job-result > .verdict, .claims-tab, .hub, .pay-tab { animation: ds-fade var(--ds-d-enter) var(--ds-ease-out) backwards; }
  .project-list > li, .dn-next li { animation: ds-rise var(--ds-d-enter) var(--ds-ease-out) backwards; }
  .project-list > li:nth-child(2), .dn-next li:nth-child(2) { animation-delay: 30ms; }
  .project-list > li:nth-child(3), .dn-next li:nth-child(3) { animation-delay: 60ms; }
  .project-list > li:nth-child(n+4), .dn-next li:nth-child(n+4) { animation-delay: 90ms; }
  dialog#sheet[open] { animation: ds-sheet var(--ds-d-enter) var(--ds-ease-out) backwards; }
  dialog#sheet[open]::backdrop { animation: ds-fade var(--ds-d-enter) var(--ds-ease-out) backwards; }
  .more-menu, .acct-menu:not([hidden]) { animation: ds-pop var(--ds-d-quick) var(--ds-ease-out) backwards; transform-origin: top right; }
  details[open] > :not(summary) { animation: ds-fade var(--ds-d-quick) var(--ds-ease-out) backwards; }
}
@keyframes ds-fade { from { opacity: 0; } }
@keyframes ds-rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes ds-sheet { from { opacity: 0; transform: translateY(12px) scale(.985); } }
@keyframes ds-pop { from { opacity: 0; transform: scale(.96); } }
/* Reduced motion: nothing slides, scales or shimmers; colour changes stay, as Apple's Reduce Motion does. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .btn:active:not(:disabled), .more > summary:active, .help-btn:active, .more-btn:active, .chip:active { transform: none; }
}

/* ================================================================ phones */
@media (max-width: 640px) {
  main { padding: 0 0 var(--ds-10); }
  /* No blur on the header here: a backdrop filter would become the frame of the fixed tab bar inside it. */
  .top { position: static; min-height: 52px; padding: var(--ds-2) var(--ds-4); background: var(--ds-canvas); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .brand { font-size: var(--ds-t-headline); }
  .panel { padding: var(--ds-6) var(--ds-4); border-radius: 0; box-shadow: none; border-left: 0; border-right: 0; }
  .projects-wrap { padding: 0 var(--ds-4); margin-top: var(--ds-6); }
  h1 { margin-bottom: var(--ds-2); line-height: 1.18; }  /* older rules set some titles to 24 px; the leading follows the size */
  .projects-head h2, .gs-head h2, #recent-h, .dn-head h2 { font-size: var(--ds-t-title3); line-height: var(--ds-l-title3); }
  .projects-head { flex-wrap: nowrap; align-items: center; }
  .projects-head h2 { margin: 0; }
  .pf-all { display: flex; gap: var(--ds-3); flex: none; }
  .pf-all .linkbtn { font-size: var(--ds-t-callout); }

  /* Tab bar: Apple's material, 10 to 11 px labels that fit ("Dashboard" and "Your work" were cut). */
  /* Solid canvas: translucent, the words behind the bar could be read through it ("None added", "96 h" on the dark
     Portfolio tiles), even at 96% with a blur. Legibility comes before the material. */
  .top nav { background: var(--ds-canvas); -webkit-backdrop-filter: none; backdrop-filter: none;
    border-top: 1px solid var(--ds-hair); padding-top: var(--ds-1); font-size: 11px; letter-spacing: -0.01em; }
  .top nav .navlink { gap: 2px; padding: var(--ds-1) 0; }
  .top nav .navlink svg { width: 26px; height: 26px; stroke-width: 1.7; }
  .top nav .navlink[aria-current="page"] { font-weight: 600; }
  .top nav .navlink[aria-current="page"] svg { stroke-width: 2.1; }

  /* Stat tiles: three across stay three across, figure over label, no word wrap in the middle of a figure. */
  .at-risk { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .at-risk .tile { padding: var(--ds-3); }
  .at-risk .tile strong { font-size: var(--ds-t-title3); line-height: 1.15; }
  .at-risk .tile span { font-size: var(--ds-t-footnote); line-height: var(--ds-l-footnote); }
  .dn-num { padding: var(--ds-3) var(--ds-4); }
  .dn-num strong { font-size: var(--ds-t-title1); }

  /* A piece of work: the project line wraps tightly, so no action ("Move") is hidden off the edge; tabs bleed to
     the screen edge and scroll. */
  .project-bar { flex-wrap: wrap; row-gap: var(--ds-1); padding: var(--ds-2) var(--ds-3); }
  .project-bar .hint { flex-basis: auto; }
  #job-result > .tabs { margin-left: calc(-1 * var(--ds-4)); margin-right: calc(-1 * var(--ds-4)); padding: 0 var(--ds-2); }
  .btn { min-height: 44px; }
  .btn.small { min-height: 44px; }  /* a tap target on a phone is 44 px at least (Apple Human Interface Guidelines; e2e_qa_claims) */
  .verdict { padding: var(--ds-5); }
}

/* ---- File wells (19 October 2026): every file input, one look. The input stays for the code and the keyboard. */
.ds-well-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
/* A form's own field rule (.lq-field input { width: 100% }) must never widen the hidden input past the page (night review, 20 October 2026). */
input.ds-well-input, .lq-field input.ds-well-input, .dl-add input.ds-well-input { width: 1px; min-width: 0; height: 1px; padding: 0; border: 0; }
.ds-well { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 14px 16px; border: 1.5px dashed var(--line, #cfd8d3); border-radius: 12px; background: var(--tint-2, #f6f9f7); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.ds-well:hover, .ds-well.over { border-color: var(--ink, #123e35); background: var(--tint, #eef5f1); }
.ds-well-input:focus-visible + .ds-well { outline: 2px solid var(--ink, #123e35); outline-offset: 2px; }
.ds-well-word { font-weight: 600; color: var(--ink, #123e35); }
.ds-well-kinds { grid-column: 1; font-size: .82rem; color: var(--ink-2, #5e7f73); }
.ds-well-name { grid-column: 1; font-size: .9rem; color: var(--ink, #123e35); overflow-wrap: anywhere; }
.ds-well-name:empty { display: none; }
.ds-well.has { border-style: solid; background: var(--sheet, #fff); }
.ds-well-clear { grid-column: 2; grid-row: 1 / 4; font: inherit; font-size: .85rem; border: 1px solid var(--line, #cfd8d3); background: var(--sheet, #fff); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
/* Han chose the compact row (19 October 2026, 20:48). */
.ds-well { grid-template-columns: auto 1fr auto; padding: 8px 12px; border-style: solid; border-radius: 999px; }
.ds-well-kinds { grid-column: auto; }
.ds-well-name { grid-column: 1 / 3; }
.ds-well-clear { grid-row: auto; }
/* One Remove for a chosen file, not two: the file well has its own, so the plain button the app adds beside every
   file picker (app.js fileRemoveControls) is not shown where a well stands (super-user walk, 14 November 2026: "Remove"
   stood above the well and again inside it, on every upload). Pickers without a well keep the plain button. */
.ds-well-input + .file-rm { display: none !important; }
/* On a phone the Remove button of a chosen file is a full touch target: it was 38 px tall (super-user walk, 14 November 2026). */
@media (max-width: 640px), (pointer: coarse) { .ds-well-clear { min-height: 44px; min-width: 44px; padding: 10px 14px; } }

/* ================================================================ the layout overhaul of 20 October 2026
   Han, 20 October 2026, on a computer and an iPhone: "It looks unprofessional... Everything looks squeezed in, no clear
   delineation between sections." Sources (docs/research/DUE-DILIGENCE.md, record 28): the GOV.UK Design System
   (layout, summary lists, the contents list, back to top), Apple's Human Interface Guidelines (44 pt targets, tab bars
   of three to five items, 17 pt body), Material 3 (window size classes; a list in place of a table on a compact
   screen), WCAG 2.2 (1.4.10 reflow at 320 CSS px, 2.5.8 target size, 2.4.11 focus not obscured), and how Harvey,
   Legora, Procore, Document Crunch and Notion lay out long documents, contents and tables on a phone.
   The browser checks (deploy/layout_checks.py) measure every rule below at 390, 320 and 1440 px. */

:root { --stick: 0px; --gutter: var(--ds-4); --bar-h: 0px; --fab-room: 0px; }

/* ---- 1. Width: the page sits beside the rail and uses the screen (item 6). One gutter from the rail, not a gap. */
@media (min-width: 1100px) {
  body:has(#rail:not([hidden])) .shell > main { margin: 0; max-width: none; padding: var(--ds-8) var(--ds-10) var(--ds-16); }
  body:has(#rail:not([hidden])) main:has(#job:not([hidden])) > #job,
  body:has(#rail:not([hidden])) main:has(#project-contract:not([hidden])) > #project-contract { max-width: 1320px; }
  body:has(#rail:not([hidden])) .projects-wrap, body:has(#rail:not([hidden])) .dash, body:has(#rail:not([hidden])) #history,
  body:has(#rail:not([hidden])) main:has(#start:not([hidden])) > .panel, body:has(#rail:not([hidden])) #settings { max-width: 1080px; }
  #job.panel, #project-contract.panel { padding: var(--ds-8) var(--ds-10); }
}
@media (min-width: 641px) and (max-width: 1099px) { main:has(#job:not([hidden])), main:has(#project-contract:not([hidden])) { max-width: none; } }
/* ---- 2. Sections read as sections (item 8): a heading opens each with air above it and a hairline; cards stand apart. */
.view > h2, .view > section > h2, .view-col > .view > div > h2 { margin-top: var(--ds-10); padding-top: var(--ds-6); border-top: 1px solid var(--ds-hair); }
.view > h2:first-child, .view > section:first-child > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
/* The first heading of a tab has no rule and no gap above it, also when it follows the way back ("\2039 All registers")
   or sits in the tab's own box (Team): an empty band with a line under the tabs said a section was missing. */
.view > .sc-back + h2, .view-col > .view > div:first-child > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.view > h3, .view > section > h3:first-child, .view > div > h3:first-child { margin-top: var(--ds-6); margin-bottom: var(--ds-2); }
.view > h3:first-child { margin-top: 0; }
.view > :is(section, .card, .cf-card, .export, .verdict, .log-quick, .rt-card) + :is(section, .card, .cf-card, .export, .verdict, .log-quick, .rt-card) { margin-top: var(--ds-6); }
.view > p { margin-top: 0; margin-bottom: var(--ds-3); }
.view > .meta { margin-bottom: var(--ds-4); }
/* Pills, chips and tags never touch each other or their text, and wrap rather than run off a card. Real-world clause
   references, document and party names run to 100 characters and more ("Project Deed clauses 24.2 and 24.3, as
   summarised in Schedule 2 (Services) of the IREA Deed of Appointment"): set on one line, they dragged the page wider
   than a phone (second UI pass, 21 October 2026). Every chip wraps inside its box at any width; a date in full inside
   one stays on one line (.ds-date). */
.pill, .chip, .tag, .sev, .clause, .co-clause, .ktag, .d-role, .rag-chip, .cf-kind, .sc-rag, .cc-red, .o-key, .risk { max-width: 100%; white-space: normal; overflow-wrap: break-word; }
/* break-word, not anywhere: a word of a status ("Critical") is never split to fit a squeezed row, while a word longer than
   the box (a file name with no spaces) still breaks, because the box is never wider than its card (max-width). */
.pf-row-risk { flex-wrap: wrap; }
.pf-row-risk > .risk { flex: none; }
.pf-row-risk > a:not(.pf-more-risks) { flex: 1 1 12rem; min-width: 0; overflow-wrap: break-word; }
.pf-row-risk > .pf-more-risks { flex: none; white-space: nowrap; margin-left: 0; }
:is(.chip, .tag, .pill, .sev, .co-clause) { line-height: 1.35; }
:is(.chip, .tag, .pill, .co-clause) + :is(.chip, .tag, .pill, .co-clause) { margin-left: 6px; }
.row-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: var(--ds-3); row-gap: var(--ds-1); align-items: center; text-align: left; }
.row-head > * { min-width: 0; }
/* On a computer the first column (a number or a status) has one width in every row, so the titles start at one line
   down the list; a fourth item (the status after a clause) stays on the same line, at the right (UI audit, 21 October 2026). */
@media (min-width: 641px) {
  .rows:not(.q-rows):not(.sec-rows) .row-head { grid-template-columns: 7.5rem minmax(0, 1fr) auto auto; }
  .rows:not(.q-rows):not(.sec-rows) .row-head > :first-child { justify-self: start; }
}
.rows > li + li { border-top: 1px solid var(--ds-hair); }
.row-body { padding: var(--ds-2) 0 var(--ds-5); }

/* ---- 3. Folding (item 1): a section's heading is its button; the caret turns; a folded section shows one line. */
.fold-head, .sc-top { display: flex; align-items: center; gap: var(--ds-3); width: 100%; min-height: 44px; padding: var(--ds-2) 0; margin: 0;
  font: inherit; font-weight: inherit; color: inherit; text-align: left; background: none; border: 0; cursor: pointer; border-radius: var(--ds-r-xs); }
.fold-head:hover, .sc-top:hover { background: var(--ds-fill); }
.fold-caret { flex: none; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px);
  transition: transform var(--ds-d-quick) var(--ds-ease-out); opacity: .75; margin: 0 var(--ds-1); }
.fold-head[aria-expanded="false"] .fold-caret, .sc-top[aria-expanded="false"] .fold-caret { transform: rotate(-45deg); }
.fold-title { flex: 1 1 auto; min-width: 0; }
.fold-sum { color: var(--ds-text-2); font-weight: 400; font-size: var(--ds-t-subhead); }
.fold-sec.fold-auto.folded > :not(.fold-h):not(.wk-h) { display: none !important; }
.fold-sec.fold-auto.folded > .wk-h > :not(.fold-h) { display: none !important; }
.fold-h { margin-bottom: var(--ds-2); }
.fold-sec.folded > .fold-h { margin-bottom: 0; }
.fold-bar { display: flex; justify-content: flex-end; gap: var(--ds-2); margin: 0 0 var(--ds-3); }
.fold-allbtn { display: inline-flex; align-items: center; gap: var(--ds-2); min-height: 36px; padding: 0 var(--ds-3); border-radius: var(--ds-r-pill);
  border: 1px solid var(--ds-hair); background: var(--ds-surface); color: var(--ds-ink); font-size: var(--ds-t-subhead); font-weight: 600; text-decoration: none; }
.fold-allbtn:hover { border-color: var(--ds-ink); text-decoration: none; }
/* One bar everywhere (Han, 21 October 2026): the home page's project cards wear the same pills, not link text. */
.pf-all.fold-bar { margin: 0; gap: var(--ds-2); }
.pf-all.fold-bar .fold-allbtn { color: var(--ds-ink); font-size: var(--ds-t-subhead); padding: 0 var(--ds-3); }
/* The Scott schedule's items fold to one line: item, head, status and the difference. */
.sc-row { scroll-margin-top: calc(var(--stick) + 12px); }
.sc-top { flex-wrap: wrap; row-gap: var(--ds-1); }
.sc-top .sc-headl { flex: 1 1 12rem; min-width: 0; font-weight: 600; }
.sc-top .sc-sum { flex-basis: 100%; padding-left: calc(10px + 2 * var(--ds-1) + var(--ds-3)); color: var(--ds-text-2); font-size: var(--ds-t-subhead); }
.sc-row:not(.folded) .sc-sum { display: none; }
.sc-row.folded > :not(.sc-top) { display: none !important; }

/* ---- 4. The contents (item 2): a sticky column on a computer; a one-line bar that opens on a tablet or phone. Every
   heading lands below the sticky bars (--stick is set in code from the bars' real height). */
:is(#job-result, #ct-body) :is(h2, h3, [data-toc]) { scroll-margin-top: calc(var(--stick) + 12px); }
.page-toc .toc-toggle { display: none; }
@media (min-width: 1440px) {
  .view-wrap.has-toc { grid-template-columns: 220px minmax(0, 1fr); gap: 0 var(--ds-8); }
  .page-toc { position: sticky; top: calc(var(--stick) + 16px); max-height: calc(100vh - var(--stick) - 32px); overflow: auto; overscroll-behavior: contain; margin: 0;
    padding: var(--ds-3) var(--ds-2) var(--ds-3) var(--ds-3); background: transparent; border: 0; border-left: 1px solid var(--ds-hair); border-radius: 0; font-size: var(--ds-t-footnote); }
  .page-toc h3.toc-h { margin: 0 0 var(--ds-2); padding-left: var(--ds-2); }
  .page-toc a { padding: 6px var(--ds-2); border-left: 2px solid transparent; margin-left: -1px; border-radius: 0 var(--ds-r-xs) var(--ds-r-xs) 0; line-height: 1.35; color: var(--ds-text-2); }
  .page-toc a.sub { padding-left: var(--ds-5); }
  .page-toc a:hover { color: var(--ds-ink); background: var(--ds-fill); }
  .page-toc a.on { border-left-color: var(--ds-ink); color: var(--ds-ink); background: rgba(196, 245, 120, .28); font-weight: 600; }
}
@media (max-width: 1439px) {
  .page-toc { padding: 0; background: var(--ds-surface); border: 1px solid var(--ds-hair); border-radius: var(--ds-r-md); margin: 0 0 var(--ds-5); overflow: hidden; }
  .page-toc h3.toc-h { display: none; }
  .page-toc .toc-toggle { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "t n c" "now now now"; align-items: center; gap: 0 var(--ds-2); width: 100%; min-height: 48px;
    padding: var(--ds-2) var(--ds-4); font: inherit; font-size: var(--ds-t-subhead); text-align: left; color: var(--ds-ink); background: none; border: 0; cursor: pointer; }
  .toc-toggle .toc-t { grid-area: t; font-weight: 600; }
  /* The section in view, on one line: a long heading (a form name of 160 characters) made the folded box five lines tall
     on a phone and pushed the page a screen down (second UI pass, 21 October 2026). The whole heading is in the list. */
  .toc-toggle .toc-now { grid-area: now; color: var(--ds-text-2); min-width: 0; font-size: var(--ds-t-footnote); line-height: var(--ds-l-footnote);
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; overflow: hidden; overflow-wrap: anywhere; }
  .toc-toggle .toc-now:empty { display: none; }
  .toc-toggle .toc-caret { grid-area: c; }
  .toc-toggle .count { grid-area: n; font-size: var(--ds-t-caption); font-weight: 600; padding: 0 var(--ds-2); border-radius: var(--ds-r-pill); background: var(--ds-fill-2); }
  .toc-caret { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -4px 4px 0; transition: transform var(--ds-d-quick) var(--ds-ease-out); }
  .page-toc.open .toc-caret { transform: rotate(-135deg); margin-top: 4px; }
  .page-toc ol { display: none; border-top: 1px solid var(--ds-hair); padding: var(--ds-2) 0; max-height: 60vh; overflow: auto; }
  .page-toc.open ol { display: block; }
  .view-wrap > .page-toc li { max-width: none; }  /* the section in view is marked across the whole bar, not three quarters of it (laptop width, 1 December 2026) */
  .page-toc a { display: flex; align-items: center; min-height: 44px; padding: var(--ds-2) var(--ds-4); border-left: 3px solid transparent; border-radius: 0; color: var(--ds-ink); }
  .page-toc a.sub { padding-left: var(--ds-8); color: var(--ds-text-2); }
  .page-toc a.on { border-left-color: var(--ds-ink); background: rgba(196, 245, 120, .28); font-weight: 600; }
}

/* ---- 5. The tabs of a piece of work stay in reach and show that more wait (items 13 and 2). */
.tabs-wrap { position: relative; margin: var(--ds-5) 0 var(--ds-6); }
.tabs-wrap > .tabs:not(.ptabs) { margin: 0; -webkit-mask-image: none; mask-image: none; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.tabs-stick { position: sticky; top: 60px; z-index: 12; background: var(--ds-surface); }
.tabs-wrap::before, .tabs-wrap::after { content: ""; position: absolute; top: 0; bottom: 1px; width: 44px; pointer-events: none; opacity: 0; z-index: 1;
  transition: opacity var(--ds-d-quick) var(--ds-ease-out); display: flex; align-items: center; font-size: 20px; line-height: 1; color: var(--ds-ink); }
.tabs-wrap::before { content: "\2039"; left: 0; justify-content: flex-start; padding-left: 2px; background: linear-gradient(to right, var(--ds-surface) 45%, rgba(255, 255, 255, 0)); }
.tabs-wrap::after { content: "\203A"; right: 0; justify-content: flex-end; padding-right: 4px; background: linear-gradient(to left, var(--ds-surface) 45%, rgba(255, 255, 255, 0)); }
.tabs-wrap.more-left::before, .tabs-wrap.more-right::after { opacity: 1; }
@media (max-width: 640px) {
  .tabs-stick { top: 0; margin-left: calc(-1 * var(--ds-4)); margin-right: calc(-1 * var(--ds-4)); padding: 0 var(--ds-2); border-bottom: 1px solid var(--ds-hair); }
  .tabs-stick > .tabs:not(.ptabs) { border-bottom: 0; }
  .tabs-wrap::before { left: var(--ds-2); } .tabs-wrap::after { right: var(--ds-2); }
}
@media (min-width: 1100px) {
  /* A computer has room for every tab: they wrap to a second line rather than hide. */
  .tabs-wrap > .tabs:not(.ptabs) { flex-wrap: wrap; overflow: visible; }
  .tabs-wrap::before, .tabs-wrap::after { display: none; }
  /* A claim's twelve tabs fit one line at 1440 px: closer set, so "Downloads" and "Disputes" do not drop to a second row
     (UI audit, 21 October 2026). Narrower computers still wrap rather than hide. */
  .tabs-wrap > .tabs:not(.ptabs):has(> button:nth-child(11)) { gap: 0; }
  .tabs-wrap > .tabs:not(.ptabs):has(> button:nth-child(11)) button { padding-left: 6px; padding-right: 6px; font-size: 14px; }
  .tabs-wrap > .tabs:not(.ptabs):has(> button:nth-child(11)) button::after { left: 6px; right: 6px; }
}

/* ---- 6. Tables become lists of cards on a phone (item 10: nothing cut off, label over value). */
@media (max-width: 640px) {
  table.stack, table.stack > tbody, table.stack > thead, table.stack tr, table.stack td, table.stack th { display: block; width: auto; min-width: 0 !important; }
  table.grid.wide.stack { min-width: 0; }
  table.stack .stack-head, table.stack > thead { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.stack tr { padding: var(--ds-3) var(--ds-4); margin: 0 0 var(--ds-3); border: 1px solid var(--ds-hair); border-radius: var(--ds-r-md); background: var(--ds-surface); box-shadow: var(--ds-e1); }
  table.stack tbody tr:hover { background: var(--ds-surface); }
  table.stack td, table.stack tbody th { display: grid; grid-template-columns: minmax(6.5rem, 38%) minmax(0, 1fr); gap: var(--ds-3); padding: var(--ds-2) 0; border: 0;
    border-bottom: 1px solid var(--ds-hair); white-space: normal !important; overflow-wrap: anywhere; text-align: left; }
  table.stack td:last-child, table.stack tbody th:last-child { border-bottom: 0; }
  table.stack td[data-label]::before, table.stack tbody th[data-label]::before { content: attr(data-label); color: var(--ds-text-2); font-size: var(--ds-t-footnote); font-weight: 600; }
  table.stack td.stack-nolabel, table.stack td:not([data-label]) { grid-template-columns: minmax(0, 1fr); }
  table.stack td.d-name { grid-template-columns: minmax(0, 1fr); font-weight: 600; font-size: var(--ds-t-callout); }
  table.stack td.d-name::before { content: none; }
  table.stack td.d-name .d-from { display: block; font-weight: 400; margin-top: 0; font-size: var(--ds-t-subhead); }
  table.stack td, table.stack tbody th { justify-items: start; }
  table.stack td.d-get .btn { width: 100%; }
  .table-wrap:has(> table.stack), .doclist-wrap .table-wrap { overflow: visible; }
  .doclist-wrap, .doc-tab { min-width: 0; }
}

/* ---- 7. Phones: one column, readable type, 44 px targets, nothing past the edge (items 9, 10, 11). */
@media (max-width: 640px) {
  /* A text box under 16 px makes the phone zoom in as it takes focus, and the box runs off the screen (item 9). */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea, .search { font-size: 16px !important; }
  .crumbs a, .crumbs .here { min-height: 44px; display: inline-flex; align-items: center; }
  .top .brand { min-height: 44px; display: inline-flex; align-items: center; }
  .foot-legal a { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .linkbtn, .team-btn, .fold-allbtn, .help-btn, details.more > summary, .more > summary, .chip, button.chip, .ref:not(.inref .ref), .recent-link, a.hint, .row-head, summary { min-height: 44px; }
  .help-btn, details.more > summary, .more > summary { min-width: 44px; width: 44px; height: 44px; }
  .linkbtn, .team-btn, a.hint, .d-from a { display: inline-flex; align-items: center; min-width: 44px; }  /* .d-from a: work named by a five-letter file was a 33 px target (super-user walk, 11 November 2026) */
  .ptabs-row .team-btn { padding: 0 var(--ds-2); }
  .chip, button.chip { display: inline-flex; align-items: center; min-width: 44px; justify-content: center; }
  /* Every card's content wraps inside it; a long word or reference breaks rather than spills. */
  .card, .cf-card, .export, .verdict, .co-card, .co-next, .project, .rt-card, .log-quick, .sc-row, li { min-width: 0; overflow-wrap: anywhere; }
  .rail-t, .row-head > span, .d-file, .project-name, .proj-name, .job-title { white-space: normal !important; text-overflow: clip !important; overflow: visible !important; }
  /* Close-out (item 11): the next step reads as one column; the date block sits above the words. */
  .co-next { grid-template-columns: minmax(0, 1fr) !important; gap: var(--ds-3); padding: var(--ds-5); }
  .co-next .wk-leaf { justify-self: start; }
  .co-next-title { font-size: var(--ds-t-title3); line-height: var(--ds-l-title3); }
  .co-next-title .co-clause { display: block; width: fit-content; margin: var(--ds-2) 0 0; }
  /* Source chips in written answers wrap with their words. */
  .inref { display: inline; }
  .inref .ref { white-space: normal; }
}

/* ---- 8. The phone's bottom bar (items 11 and 12): six places (Han, 25 October 2026: New, Projects, Dashboard, Records, Your work, More), 12 px labels, the
   rest under More. Portfolio, Business (the owner's alone) and DevCure open from More on a phone. */
@media (max-width: 640px) {
  body:not(.dc-only) .top nav #nav-portfolio-top, body:not(.dc-only) .top nav #nav-business-top { display: none !important; }
  .top nav #nav-programmes-top { display: none !important; }  /* Programs is first under More on a phone (Han, 4 November 2026) */
  .top nav { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; grid-auto-columns: auto; font-size: 12px; letter-spacing: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .top nav .navlink, .top nav .more-btn { min-height: 52px; padding: 4px 2px; justify-content: center; }
  .top nav .navlink span, .top nav .more-btn .more-l { overflow: visible; text-overflow: clip; white-space: nowrap; }
  .top nav .navlink svg, .top nav .more-btn svg { width: 24px; height: 24px; }
}
.acct-menu .menu-place { display: block; }  /* listed only when the place is not on the screen already (app.js openAccountMenu) */
/* At 380 px and below six equal 52 px columns are narrower than "Dashboard" and "Your work" at 12 px (live walk,
   10 November 2026, M2: "DashboaRecords" at 320 px). Each column takes its own label's width and the spare room is
   shared, at 12 px (no text under 12 px on a phone: layout check L7); every label stays inside its own box and every
   box stays at least 44 px wide. */
@media (max-width: 380px) {
  .top nav { grid-template-columns: repeat(6, minmax(44px, auto)) !important; font-size: 12px; letter-spacing: -0.01em; padding-left: 2px; padding-right: 2px; }
  .top nav .navlink, .top nav .more-btn { padding: 4px 1px; min-width: 0; }
  .top nav .navlink span, .top nav .more-btn .more-l { overflow: hidden; text-overflow: clip; max-width: 100%; }
}

/* ---- 9. The floating buttons (item 7): Jono at the bottom right, Top at the bottom left on a phone and beside Jono on a
   computer; the page ends with room for both, so neither ever covers the last control or the footer. */
.to-top { min-height: 44px; padding: 0 var(--ds-4); display: inline-flex; align-items: center; gap: var(--ds-1); }
body:has(.jono-btn) .to-top { right: 196px; bottom: 24px; }
body:has(.jono-btn), body:has(.to-top:not([hidden])) { padding-bottom: 120px; }
@media (max-width: 640px) {
  .to-top, body:has(.jono-btn) .to-top { left: 12px; right: auto; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .jono-btn { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  body, body:has(.jono-btn), body:has(.to-top:not([hidden])) { padding-bottom: calc(148px + env(safe-area-inset-bottom)); }
}

/* ---- 10. "Edited offline", compact (item 4): one line with the upload beside it; the editions below, if any. */
.rt-card { padding: var(--ds-3) var(--ds-4); gap: var(--ds-2); grid-template-columns: minmax(0, 1fr) auto; align-items: center; margin: var(--ds-4) 0; }
.rt-card > :not(.rt-lead):not(.rt-up) { grid-column: 1 / -1; }
.rt-lead { display: grid; gap: 2px; min-width: 0; }
.rt-lead h3 { margin: 0; font-size: var(--ds-t-callout); }
.rt-lead .hint { margin: 0; font-size: var(--ds-t-footnote); line-height: var(--ds-l-footnote); }
.rt-card .rt-up { flex-wrap: nowrap; gap: var(--ds-2); }
.rt-card .rt-up .ds-well { flex: 0 1 260px; padding: 4px 12px; }
.rt-card .rt-list, .rt-card .rt-foot { font-size: var(--ds-t-subhead); }
@media (max-width: 760px) {
  .rt-card { grid-template-columns: minmax(0, 1fr); }
  .rt-card .rt-up { flex-wrap: wrap; }
  .rt-card .rt-up .ds-well { flex: 1 1 100%; }
}

/* ---- 11. "Record their position" (item 5): three titled groups; a head's position as a row of choices with its figure. */
.log-quick { gap: var(--ds-5); padding: var(--ds-6); }
.log-quick .lq-group { display: grid; gap: var(--ds-3); padding-top: var(--ds-4); border-top: 1px solid var(--ds-hair); margin: 0; border-left: 0; border-right: 0; border-bottom: 0; min-width: 0; }
.log-quick .lq-group > legend { padding: 0; margin-bottom: var(--ds-3); font-size: var(--ds-t-footnote); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ds-text-2); float: left; width: 100%; }
.log-quick .lq-group > legend + * { clear: left; }
/* A grouped form's grid never grows past its column: the fieldset's own grid track is minmax(0, 1fr), so three fields wrap instead of pushing the page sideways (iPad landscape and 13" laptop, 23 October 2026). */
.log-quick .lq-group { grid-template-columns: minmax(0, 1fr); }
.log-quick .lq-group > * { min-width: 0; }
.lq-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--ds-3) var(--ds-4); }
.lq-field > span { font-size: var(--ds-t-footnote); font-weight: 600; color: var(--ds-text-2); }
.lq-field input, .lq-field select { min-height: 44px; }
.lq-heads-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ds-3); }
.lq-head { display: grid; grid-template-columns: minmax(10rem, 1fr) auto minmax(9rem, 12rem); gap: var(--ds-2) var(--ds-4); align-items: center; padding: var(--ds-3) 0; border-bottom: 1px solid var(--ds-hair); }
.lq-head-name { font-weight: 600; min-width: 0; }
.lq-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--ds-edge); border-radius: var(--ds-r-pill); overflow: hidden; }
.lq-seg label { display: inline-flex !important; align-items: center; min-height: 40px; padding: 0 var(--ds-3); margin: 0 !important; cursor: pointer; font-size: var(--ds-t-subhead); gap: 0 !important; }
.lq-seg label + label { border-left: 1px solid var(--ds-edge); }
.lq-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lq-seg label:has(input:checked) { background: var(--ds-ink); color: #fff; }
.lq-seg label:has(input:focus-visible) { box-shadow: var(--ds-focus); }
.lq-head input[type=text] { min-width: 0 !important; width: 100%; }
.lq-conds { gap: var(--ds-2); }
.lq-conds > label.inline { padding: 0 var(--ds-3); min-height: 40px; border: 1px solid var(--ds-hair); border-radius: var(--ds-r-pill); background: var(--ds-surface); display: inline-flex; align-items: center; gap: var(--ds-2); }
.lq-conds > input[type=text] { flex: 1 1 14rem; min-height: 40px; }
@media (max-width: 640px) {
  .log-quick { padding: var(--ds-4); }
  .lq-head { grid-template-columns: minmax(0, 1fr); }
  .lq-seg { width: 100%; }
  .lq-seg label { flex: 1 1 auto; justify-content: center; min-height: 44px; }
  .lq-conds > label.inline { min-height: 44px; }
}
.rt-card > .msg:empty { display: none; }

/* ---- 12. Touch targets on any phone-sized screen, whatever pointer the browser reports (the (pointer: coarse) rules in
   app.css are not reported by every phone browser or emulator): 44 px for every control and every tick-box row. */
@media (max-width: 640px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not(.ds-well-input), select, textarea { min-height: 44px; }
  label:has(> input[type="checkbox"]), label:has(> input[type="radio"]), label:has(input[type="checkbox"]), label:has(input[type="radio"]) { min-height: 44px; display: flex; align-items: center; gap: 10px; }
  input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; flex: none; }
  .lq-seg label { display: inline-flex !important; }
  .filter button, .seg button, .seg > *, .tools > button:not(.btn), .hats button, .start-steps button, [role="tab"] { min-height: 44px; }
  .ref:not(.inref .ref) { display: inline-flex; align-items: center; min-width: 44px; justify-content: center; padding: 0 var(--ds-1); }
  a.d-file { display: inline-flex; align-items: center; min-height: 44px; }
  .wk-leaf span { font-size: 12px; }
}
/* A tablet is a touch screen too (live test, 8 November 2026): at 820 px the month fields of Check a situation stood
   40 px and a text field 24 px tall, because the 44 px rule above stopped at 640 px. Every field is 44 px on any screen
   whose pointer is coarse, whatever its width. */
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not(.ds-well-input), select, textarea { min-height: 44px; }
}

/* ---- 13. Ask Jono never covers the page (item 7): on a computer it is a round button in a column of its own to the
   right of the page (the label shows on hover and focus); the Top button sits above it in the same column. */
@media (min-width: 641px) {
  body:has(.jono-btn) .shell > main { padding-right: 104px; }
  .jono-btn { right: 24px; bottom: 24px; padding: 6px; gap: 0; }
  .jono-btn > span:not(.jono-face) { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width var(--ds-d-enter) var(--ds-ease-out), margin var(--ds-d-enter) var(--ds-ease-out); }
  .jono-btn:hover > span:not(.jono-face), .jono-btn:focus-visible > span:not(.jono-face) { max-width: 120px; margin: 0 var(--ds-3) 0 var(--ds-2); }
  body:has(.jono-btn) .to-top { right: 24px; bottom: 92px; }
}
@media (min-width: 641px) and (max-width: 1099px) { body:has(.jono-btn) main { padding-right: 96px; } }
/* The head's position: three equal choices in one row, never wrapped inside a pill. */
.lq-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: var(--ds-r-sm); min-width: 18rem; }
.lq-seg label { justify-content: center; text-align: center; line-height: 1.2; padding: var(--ds-1) var(--ds-2); white-space: normal; }
.lq-head input[type=text] { font: inherit; min-height: 44px; padding: 0 var(--ds-3); border: 1px solid var(--ds-edge); border-radius: var(--ds-r-sm); background: var(--ds-surface); color: var(--ds-ink); }
.lq-conds > label.inline { border-radius: var(--ds-r-sm); }
@media (max-width: 900px) { .lq-head { grid-template-columns: minmax(0, 1fr); } .lq-seg { min-width: 0; } }
@media (max-width: 640px) { .log-quick .lq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .log-quick .lq-grid > .lq-field.wide { grid-column: 1 / -1; } }
@media (max-width: 480px) { .log-quick .lq-grid { grid-template-columns: minmax(0, 1fr); } }
.rt-card .ds-well { flex: 0 0 auto; grid-template-columns: auto auto; min-height: 44px; padding: 4px 16px; }
.rt-card .ds-well-kinds { display: none; }
.rt-card .ds-well-word { white-space: nowrap; font-size: var(--ds-t-subhead); }
.rt-card .ds-well-name { max-width: 16rem; }
@media (max-width: 760px) { .rt-card .ds-well { flex: 1 1 100%; } .rt-card .ds-well-word { white-space: normal; } }
.rt-card .rt-up .btn { white-space: nowrap; flex: none; }
/* Source chips in written answers (item 14): each names its record, as a quiet chip that wraps with the words. */
.inref .ref { display: inline; padding: 1px 6px; margin: 0 0 0 4px; border-radius: var(--ds-r-xs); background: var(--ds-fill-2); color: var(--ds-ink);
  text-decoration: none; white-space: normal; overflow-wrap: anywhere; line-height: 1.6; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.inref .ref:hover { background: rgba(196, 245, 120, .55); }
.inref .ref { display: inline !important; min-height: 0 !important; min-width: 0 !important; }
.jono-log { align-content: start; }
@media (max-width: 640px) { #devcure { padding-left: var(--ds-4); padding-right: var(--ds-4); } }
/* A phone shows one step back, not the whole trail (GOV.UK breadcrumbs, "collapse on mobile"): the trail took three
   lines of 44 px targets above every piece of work. */
@media (max-width: 640px) {
  #job .crumbs > * { display: none; }
  #job .crumbs > a:has(+ .sep + .here) { display: inline-flex; }
  #job .crumbs > a:has(+ .sep + .here)::before { content: "\2039"; margin-right: 6px; font-size: 20px; line-height: 1; }
}
/* Release walk of 20 October 2026 (deploy/e2e_release.py with the layout checks): the screens outside the main walk. */
@media (max-width: 640px) {
  a.back, .back-to a, .doc-compact .dc-name, table.stack td a, .v-changed, .rd-contents { min-height: 44px; display: inline-flex; align-items: center; }
  .rd-now { white-space: normal !important; text-overflow: clip !important; overflow: visible !important; }
  table.stack { overflow: visible !important; max-width: 100%; }
  table.stack tr { max-width: 100%; box-sizing: border-box; }
  /* The Dashboard's run chart fits the phone: each bar its full width, its words wrapped, its scale readable. */
  .dn-run-grid { min-width: 0; }
  .dn-run-scale { font-size: 12px; }
  .dn-bar { min-height: 44px; align-content: center; }
  .dn-bar-t { display: block; white-space: normal; overflow: visible; text-overflow: clip; }
  .dn-bar-x { white-space: normal; overflow: visible; text-overflow: clip; }
  .dn-bar-d { white-space: normal; }
}
/* The floating buttons sit above the sticky tabs, never under them (the walk found the tabs over Ask Jono at 320 px). */
.jono-btn, .to-top { z-index: 15; }
@media (min-width: 641px) { .to-top { right: 24px; bottom: 24px; } body:has(.jono-btn) .to-top { bottom: 92px; } }
@media (max-width: 640px) { .sc-rag, .sc-rows .pill, .sc-rows .tag { white-space: normal; } }

/* Jono's sheet at 320 px (21 October 2026): its Close, Ask, source and "Read every page" targets measured 43.4 px
   (the sheet's scaled type): 46 px leaves room at every width. */
@media (max-width: 640px) {
  #sheet-close, #sheet .btn, #sheet button.ref { min-height: 46px; }
  .jono-read-all { min-height: 50px; }  /* the sheet is drawn smaller at 320 px: 46 px measured 43 */
  #sheet button.ref { min-width: 46px; }
  .jono-read-all { display: flex; align-items: center; }
}
.ds-date { white-space: nowrap; }
/* A password box drawn as every other field (DevCure tender returns: it was the browser's bare box; UI audit, 21 October 2026). */
input[type="password"] { font: inherit; font-size: 16px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--ds-edge, #cfd8d3); border-radius: var(--ds-r-sm, 8px); background: var(--sheet, #fff); color: var(--ink, #123e35); box-sizing: border-box; }
input[type="password"]:hover { border-color: var(--ds-ink, #123e35); }
/* A wording option keeps its grid on every phone, whatever pointer the browser reports: item 12's tick-box rule made it a
   flex row where "(pointer: coarse)" is not reported, and "Preferred" stood one letter a line (UI audit, 21 October 2026). */
@media (max-width: 640px) { label.option:has(input[type="radio"]) { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: start; gap: 6px 10px; } }

/* ---- Second UI pass with real-world content (21 October 2026): the Portfolio on a phone. Labels at 12 px or more
   (L7); every count a 44 px target (L5); a long project name wraps under its dot and in the programme list instead of
   being cut with an ellipsis (L2). */
@media (max-width: 820px) {
  .pfv-step-l, .pfm-glab, .pfm-zone, .pfm-ax { font-size: 12px; }
  .pf-mini dd a { display: flex; align-items: center; min-height: 44px; min-width: 44px; text-decoration: none; }
  .pfv-mx-cell { min-height: 44px; min-width: 44px; height: auto; }
  .pfm-dot-l { white-space: normal; overflow: visible; text-overflow: clip; width: max-content; max-width: 140px; text-align: center; line-height: 1.25; }
  .pfm .pfm-prog-n { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word; }
  .dn-project { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word; }
}
/* Your work: each title is a 44 px target on a touch screen (it was a 24 px line of link text: second UI pass). */
@media (max-width: 1099px) { #history-list a.work-title { display: flex; align-items: center; min-height: 44px; min-width: 0; overflow-wrap: anywhere; } }
/* A title in Arabic (or any right-to-left script) reads from the right; a Latin one from the left: each title takes the
   direction of its own first letter (second UI pass, 21 October 2026: a notice titled in Arabic). */
h1, h2, h3, .work-title, .doc-name, .co-top h3, .co-next-title, .d-file, .dn-title, .pf-row-name { unicode-bidi: plaintext; }

/* ---- A tablet is a touch screen (second UI pass, 21 October 2026). At 820 px an iPad was given the computer's sizes:
   text boxes at 13 to 14 px (Safari zooms in as one takes focus) and 32 px buttons and links. Every rule a phone has for
   the finger applies to any touch screen wider than a phone; the layout stays the tablet's. */
@media (pointer: coarse) and (min-width: 641px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea, .search { font-size: 16px !important; }
  .btn, .btn.small { min-height: 44px; }
  .crumbs a, .crumbs .here, .top .brand { min-height: 44px; display: inline-flex; align-items: center; }
  .foot-legal a { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .linkbtn, .team-btn, .fold-allbtn, .help-btn, details.more > summary, .more > summary, .chip, button.chip, .ref:not(.inref .ref), .recent-link, a.hint, .row-head, summary { min-height: 44px; }
  .linkbtn, .team-btn, a.hint, .chip, button.chip { display: inline-flex; align-items: center; min-width: 44px; }
  .help-btn, details.more > summary, .more > summary { min-width: 44px; }
  .pfm-btn, .pfm-more, .ask-chip, .as-period, .pf-row-name, .pfm-ev-t, .pfm-prog-n, .quiet-links a, .doc-toc a, .pfv-in-link, .pfv-mx-name, .help-links a, .act-link { min-height: 44px; display: inline-flex; align-items: center; }
  .fold-btn { min-width: 44px; min-height: 44px; }
  button.d-side { min-height: 44px; padding: 4px 14px; }
  .pf dl dt, .as-tiles dt { font-size: 12px; }
}
/* A heading of real-world length is set a size smaller (app.js longTitle). */
#job h1.title-long, #project-contract h1.title-long { font-size: clamp(1.25rem, 1rem + 1.6vw, 1.9rem); line-height: 1.22; letter-spacing: -0.01em; }
/* The project list is one column that never grows past its box: a card's line of facts ("Executed contract · 1 piece of
   work · Reply due ...") set the grid's only column at its full length, 6 px past an 820 px tablet (L9, second UI pass). */
.project-list { grid-template-columns: minmax(0, 1fr); }
.project-list > li { min-width: 0; }
/* Labels at 12 px or more on every touch screen, a tablet included (L7: the Portfolio's funnel and matrix headings, the
   Dashboard's run scale and a close-out date leaf were 11 px at 820 px). Summaries wrap instead of ending in "…" (L2). */
@media (max-width: 1099px) {
  .dn-run-scale span, .pfv-drop, .pfv-col-l, .pfv-mx-h, .wk-leaf span { font-size: 12px; }
  .set-sum, .dn-bar-t, .dn-bar-x { white-space: normal; overflow: visible; text-overflow: clip; }
  .dn-bar-t { display: block; }
  .dn-bar-d { white-space: normal; }
}
/* A register's row as a card on a phone: its label and its value may take two lines; the date itself stays whole
   (.ds-date). "Due 24 October 2026" ran 3 px past a 320 px card (second UI pass). */
@media (max-width: 640px) { table.stack td, .hub-table.stack td.hub-date, .hub-table.stack td.hub-when, .hub-table.stack td.hub-first { white-space: normal; } }
/* An open menu is on top of everything: the floating Top and Jono buttons step aside while it is open (L6 at 320 px). */
body:has(#more-menu:not([hidden])) :is(.to-top, .jono-btn) { visibility: hidden; }
#devcure h1.title-long { font-size: clamp(1.25rem, 1rem + 1.6vw, 1.9rem); line-height: 1.22; }
/* A project card's title keeps at least 12rem: beside "3 days left", the person's role and the menu, a colleague's card
   on a 320 px phone left the name 32 px and set it one letter a line (L8, second UI pass). The chips go under the name. */
.project-top { flex-wrap: wrap; }
.project .project-top h2 { flex: 1 1 12rem; }
.project-top-r { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
/* More 44 px targets on touch screens, found with real-world content: the Dashboard's titles of what to do, and the risk
   line of a Portfolio card (L5, second UI pass). */
@media (pointer: coarse) {
  a.wk-title { display: inline-flex; align-items: center; min-height: 44px; }
  .pf-row-risk > a { display: inline-flex; align-items: center; min-height: 44px; }
  .navlink-new { min-width: 44px; justify-content: center; }
}
@media (max-width: 1099px) { .rd-up span { white-space: normal; overflow: visible; text-overflow: clip; } }
/* The narrowest phones: a card's label goes above its value, so a date in full ("24 October 2026", kept on one line) and
   a long title have the card's whole width (it ran 3 px past a 320 px card: second UI pass). */
@media (max-width: 360px) {
  table.stack td, table.stack tbody th { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
/* A tablet: the Dashboard's lines of what to do, the Portfolio's buttons and a tick box with its words are 44 px targets;
   the "New" chip of the website is 12 px (L5, L7 at 820 px, second UI pass). */
@media (pointer: coarse) {
  a.dn-bar { min-height: 44px; }
  .pf.pfm .pfm-btn, .pf .pfm-btn, .pfm-btn { min-height: 44px; display: inline-flex; align-items: center; }
  label.inline:has(> input[type="checkbox"]), label.inline:has(> input[type="radio"]) { min-height: 44px; display: inline-flex; align-items: center; }
}
/* A document's name that takes two lines, and every text box of a piece of work, are 44 px targets on a touch screen. */
@media (pointer: coarse) {
  table.doclist a.d-file { min-height: 44px; display: flex; align-items: center; }
  #job-result input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]) { min-height: 44px; }
}

/* ---- One Top button, in one place on every screen (Han, 21 October 2026: "The Top button on the phone is not
   consistently placed in the same location"). The page's Top (.to-top) and the contract reader's (.rd-top) had six
   positions between them; now both sit where this says, last in the cascade so no earlier rule moves them:
   a phone: bottom left, level with Ask Jono at the bottom right (or where Jono would be), above the tab bar;
   a computer: bottom right, above Ask Jono when it is there. Same pill, same words. */
.to-top, .rd-top { position: fixed; z-index: 15; min-height: 44px; padding: 0 var(--ds-4); display: inline-flex; align-items: center; gap: var(--ds-1);
  border-radius: var(--ds-r-pill); border: 1px solid var(--ds-hair); background: var(--ds-surface); color: var(--ds-ink);
  font: inherit; font-size: var(--ds-t-subhead); font-weight: 600; box-shadow: 0 6px 18px rgba(18, 62, 53, .16); cursor: pointer; }
.to-top[hidden], .rd-top[hidden] { display: none; }
@media (min-width: 641px) {
  .to-top, .rd-top { left: auto; right: 24px; bottom: 24px; }
  body:has(.jono-btn) :is(.to-top, .rd-top) { right: 24px; bottom: 92px; }
}
@media (max-width: 640px) {
  .to-top, .rd-top, body:has(.jono-btn) :is(.to-top, .rd-top) { left: max(12px, env(safe-area-inset-left)); right: auto; bottom: calc(76px + env(safe-area-inset-bottom)); }
}
body:has(#more-menu:not([hidden])) .rd-top { visibility: hidden; }

/* ---- The phone's type scale (Han, 21 October 2026: "the font on the phone is too big in the overview of the
   contract review and claim", "the font size is not consistent throughout"). Body text is 16 px on a phone as on a
   computer (it was 17), every title one step down, and the review's or claim's verdict ("High risk", "Ready for your
   review") never larger than the page's own title. Last in the cascade, so the older px rules (ds-scale.css) give way. */
@media (max-width: 640px) {
  :root { --ds-t-body: 16px; --ds-l-body: 24px; --ds-t-headline: 16px; --ds-l-headline: 22px;  /* on the one type ladder */
          --ds-t-title3: 17px; --ds-l-title3: 24px; --ds-t-title2: 20px; --ds-l-title2: 26px;
          --ds-t-title1: 20px; --ds-l-title1: 26px; --ds-t-large: 24px; --ds-l-large: 30px; }
  body { font-size: var(--ds-t-body); }
  main h1, #job h1, #job h1.title-long, .dash-head h1 { font-size: var(--ds-t-title1); line-height: var(--ds-l-title1); }
  .verdict > .risk { font-size: var(--ds-t-title3); line-height: var(--ds-l-title3); }
  .tile .n { font-size: var(--ds-t-title3); line-height: var(--ds-l-title3); }
  .verdict p, .wk-status, .events-meta, .delete-btn { font-size: var(--ds-t-callout); }
}

/* A stacked cell's value, kept as one piece (app.js stackTables): never wider than its column. */
.stack-v { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
/* A footnote marker never smaller than 12 px (the walk's L7), whatever the text around it (body 16 px on a phone). */
sup.fnref { font-size: max(12px, .72em); }

/* ---- The readable measure (Han, 12 November 2026, option B; output standard, section 98). It replaces "Full width
   for reading" of 22 October 2026, which let running text fill its column: at 1,920 px a hint ran to about 200
   characters a line, at 2,560 px to about 275. Running text (a paragraph, a hint, a quotation, the items of a plain
   list, a contract clause) is now held to --ds-measure, about 95 characters a line, at every width; it starts at the
   left of its column. Boxes, cards, tables, charts and controls are not text and still fill the width. A place with a
   narrower measure of its own keeps it: :where() holds this rule to the weight of one class. */
main :where(p, blockquote, .lede, .hint, .doc-toc, ol.fnotes, details.strat .strat-body, .no-delete, .ai-by-kind,
  .v-clause > *, .v-toc, :is(ul, ol):not([class]) > li:not([class]), ol.md-num > li,
  :is(.dc-checks, .dc-missing, .biz-notes, ul.hint) > li, label:is(.dc-check, .inline), div.dc-field > label:not(.ds-well),
  .option .wording):not(.pfm-dot-l, .dn-ring-t, .team-link, :has(> .doc-chip)) { max-width: var(--ds-measure); }
/* A paragraph drawn as a box (a status, a flag, a notice line) is a box: it fills the width, and its words are held to
   the measure by the room kept on their far side. One with a button at its far end keeps that button there. */
main :is(p.dc-flag, p.cr-privacy, p.notice-line, p.status-line, p.internal-mark, p.pf-empty, p.hub-empty, .option .wording):not(:has(.status-go)) {
  max-width: none; padding-inline-end: max(12px, calc(100% - var(--ds-measure))); }
main p.status-line:has(.status-go) { max-width: none; }

/* Numbered advice as counsel sets it (22 October 2026): 1. hangs, (a) one step in with its letter hanging, (i) two. */
ol.md-num { padding-left: 2em; margin: 0 0 var(--ds-4); }
ol.md-num > li { margin: 0 0 var(--ds-3); padding-left: .2em; }
ol.md-num > li > p { margin: 0 0 var(--ds-2); }
.md-sub { position: relative; margin: 0 0 var(--ds-2) 0; padding-left: 2.4em; }
.md-sub > .md-mark { position: absolute; left: 0; width: 2.2em; }
.md-sub.md-sub2 { margin-left: 2.4em; }
.md-sub.md-cont { padding-left: 2.4em; }
ol.md-num > li > p.md-cont { margin: 0 0 var(--ds-2); }
ul.md-bul { margin: 0 0 var(--ds-2); padding-left: 1.4em; }
ul.md-bul.in-sub { margin-left: 2.4em; }

/* A long list in parts (22 October 2026): each part a heading with its count; the rows sit under it. */
ul.parts { list-style: none; margin: 0; padding: 0; }
.fold-part { border-top: 1px solid var(--ds-hair); }
.fold-part > .fold-h { margin: 0; font-size: var(--ds-t-body); }
.fold-part > .fold-h .fold-sum { margin-left: auto; padding-right: var(--ds-3); }
.fold-part > ul.rows { margin: 0 0 var(--ds-4); }

/* A table of seven columns or more on a computer (22 October 2026): one step smaller and closer set, so it fits its
   column beside the contents instead of hiding its last columns off to the right. */
@media (min-width: 641px) {
  :is(table.grid, table.hub-table).dense { font-size: 13px; }
  table.grid.dense :is(td, th) { padding-left: var(--ds-2); padding-right: var(--ds-2); }
  table.hub-table.dense :is(td, th) { padding-right: var(--ds-2); }
  table.hub-table.dense th { white-space: normal; }
}

/* Long advice folded to its first part (22 October 2026): it fades out above "Read all of it". */
.verdict.long.folded { max-height: 22em; overflow: hidden; position: relative; }
.verdict.long.folded::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4em; background: linear-gradient(to bottom, transparent, var(--sheet, #fff)); pointer-events: none; }
.verdict-more { display: block; margin: calc(-1 * var(--ds-4)) 0 var(--ds-6); }

/* A list marker printed as its own paragraph hangs beside its words in the contract reader (22 October 2026). */
.v-p.v-item { position: relative; padding-left: 2.4em; }
.v-p.v-item > .v-mark { position: absolute; left: 0; top: 0; }
.fold-h:has(> .mi) { display: flex; align-items: center; gap: var(--ds-2); }
.fold-h:has(> .mi) > .fold-head { flex: 1; min-width: 0; }

/* Any screen, filled (Han, 22 October 2026, on a 27-inch screen: the app stopped at a fixed column with empty space on
   both sides). From 1100 px the page uses the whole width beside the rail, and from 1700 px everything is drawn larger
   in steps, so a large screen shows the same layout bigger rather than a small page in the middle. */
@media (min-width: 1100px) {
  body:has(#rail:not([hidden])) .shell > main,
  body:has(#rail:not([hidden])) main > section,
  body:has(#rail:not([hidden])) main:has(#job:not([hidden])) > #job,
  body:has(#rail:not([hidden])) main:has(#project-contract:not([hidden])) > #project-contract,
  body:has(#rail:not([hidden])) main:has(#start:not([hidden])) > .panel,
  body:has(#rail:not([hidden])) #settings,
  body:has(#rail:not([hidden])) .projects-wrap,
  body:has(#rail:not([hidden])) .dash,
  main:has(#portfolio:not([hidden])), main:has(#claimfile:not([hidden])), main:has(#business:not([hidden])),
  main:has(#job:not([hidden])), main:has(#project-contract:not([hidden])) { max-width: none; }
}
@media (min-width: 1700px) { html { zoom: 1.12; } }
@media (min-width: 2000px) { html { zoom: 1.25; } }
@media (min-width: 2400px) { html { zoom: 1.4; } }
@media (min-width: 3000px) { html { zoom: 1.6; } }

/* A status word in a table cell stays on one line inside its cell: "No notice found" ran over the next column (Han, 22 October 2026). */
/* A status word is one unit: a word in it never breaks part-way ("Owne / r" on Han's phone, Settings, 22 October 2026): the word
   moves to the next line whole, and a long status may still wrap between its words. */
:is(.pill, .tag, .sev, .status, .chip, .badge) { display: inline-block; max-width: 100%; overflow-wrap: break-word; word-break: normal; hyphens: none; }
table :is(.pill, .tag, .sev, .status) { white-space: nowrap; }

/* Each head's row stacks when the form itself is narrow, not only the screen: beside the contents rail the column is about 400 px wide on a 1280 px laptop (23 October 2026). */
.lq-heads-list { grid-template-columns: minmax(0, 1fr); }
.lq-heads-list > .lq-head { min-width: 0; }
.log-quick { container-type: inline-size; }
@container (max-width: 640px) { .log-quick .lq-head { grid-template-columns: minmax(0, 1fr); } .lq-seg { min-width: 0; } }

/* The Portfolio's deadline map and a lone source link on a phone (iPhone, live app, 23 October 2026): each project's name,
   its dot and a "The source" link are tapped with a thumb, so each is at least 44 px; the dot keeps its drawn size (its
   size is the risk count) and gains a clear rim to 44 px; the map's small words are 12 px. */
@media (max-width: 640px) {
  .pfm-lane { min-height: 64px; }
  .pfm-lane-name { min-height: 44px; display: flex; align-items: center; -webkit-line-clamp: unset; overflow: visible; }
  .pfm-lane-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .pfm-track { height: 56px; }
  .pfm-when { top: calc(50% + 17px); }
  .pfm .pfm-dot { box-sizing: content-box; border: max(0px, calc((45px - var(--s, 45px)) / 2)) solid transparent; background-clip: padding-box; box-shadow: none; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .3)); }
  .pfm-when, .pfm-tick, .pfm-lane-axis .pfm-share { font-size: 12px; }
  p.hint > a:only-child { display: inline-flex; align-items: center; min-height: 44px; }
}

/* The claim's own goals (TOP 10, ew2/owngoals.py): our records against our claim, before issue. */
.own-goals { margin: 16px 0; }
.og-rows .og-row { padding: 10px 0; border-bottom: 1px solid var(--line, #D9DED9); }
.og-rows .og-row p { margin: 4px 0; overflow-wrap: anywhere; }
.og-rows .ticks { margin: 6px 0; }
.og-rows .note { width: 100%; max-width: 520px; }
/* Server walker, 2 November 2026 (e2e_realworld, 820 px tablet): a document's name on a touch screen of any width is a
   44 px target, as on a phone. */
@media (pointer: coarse) {
  .doc-compact .dc-name { min-height: 44px; }
}

/* ---- On a phone, Top and Ask Jono keep their places (bottom left and bottom right, above the tab bar) on a band of the
   page's own colour, so they never sit over the body text (live re-walk 2, 9 November 2026, F25: both covered the text
   of the 0194 job). The text scrolls under the band as it does under the tab bar; the page keeps its end clear
   (padding-bottom above). */
@media (max-width: 640px) {
  body:has(.jono-btn)::after, body:has(.to-top:not([hidden]))::after { content: ""; position: fixed; left: 0; right: 0;
    bottom: calc(68px + env(safe-area-inset-bottom)); height: 66px; background: var(--ds-canvas); box-shadow: 0 -1px 0 var(--ds-hair);
    z-index: 14; pointer-events: none; }
  body.solo::after { display: none; }
}

/* ================================================================ the clean-up as looked at by eye (11 November 2026)
   Every screen of the clean-up, for the owner, a project lead, an editor and a read-only member, at 1,440 and 390 px.
   Each rule below is one fault seen on a screenshot; ew2/tests/test_app_cleanup_2026_11_11.py keeps each. */
/* Four figures stand four across (two by two on a phone), never three and one alone under them. */
.tiles:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .tiles:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 380px) { .tiles:has(> :nth-child(4):last-child) { grid-template-columns: minmax(0, 1fr); } }
/* A status in a card or on a person's row is one unit on one line, as wide as its words: "Not yet marked as sent" stood
   on three lines beside its card, and a role stretched into a bar across a phone. */
.export > .pill, .person > .pill { flex: none; width: max-content; max-width: 100%; white-space: nowrap; }
@media (max-width: 640px) { .export > .pill, .person > .pill { align-self: flex-start; justify-self: start; margin-left: 0; } }
/* An empty message keeps no band under a form's button (Payments: 36 px of nothing under "Read the BOQ" and "Add it";
   Settings, Your licence: the same above and below Watched projects). */
.pay-new > .msg:empty, #plan .msg:empty, #plan-buy:empty, #watch-extras:empty, #topup-approvals:empty, #plan .project-actions:empty { display: none; }
/* Project records, Add letters or emails by hand: which way and Add are one row with a gap, the same height. */
.rc-add-go { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-2); margin-top: var(--ds-2); }
/* The project's strip: on a phone the parties to confirm start their own line, without the dot that joined them. */
@media (max-width: 640px) { .pkg-meta-after { display: block; margin-top: var(--ds-1); } .pkg-meta-after > .pkg-sep { display: none; } }
/* A file well on a phone: what it takes sits under the words, not squeezed into a column of one word a line. */
@media (max-width: 640px) { .ds-well { grid-template-columns: minmax(0, 1fr) auto; border-radius: var(--ds-r-md); } .ds-well-kinds { grid-column: 1; } .ds-well-name { grid-column: 1; } }
/* A table read as cards: a cell with nothing in it is not a line of its own (a label with no value beside it). */
@media (max-width: 640px) { table.stack td.stack-empty { display: none; } }
/* Disputes. Each part stands clear of the one before: when the tab is tidied each heading becomes the first child of
   its own section, which took its space away ("Facts both sides' records agree on" sat on the paragraph above). */
.export.avoid .fold-run { margin-top: var(--ds-5); }
.export.avoid div > h2:not(:first-child) { margin-top: var(--ds-6); }
/* One rule above The dispute route, not two with an empty band between them. */
.view-col > .view > div.dispute-route > h2:first-child, .view > .dispute-route > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
/* A choice in force is drawn as chosen (ink), as everywhere else in the app; lime is the page's one main button. */
.btn.is-choice[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.export.avoid .row > .row-break { flex-basis: 100%; height: 0; }
@media (max-width: 640px) { .export.avoid .row > .row-break { display: none; } }
/* Their financial year: the app's own field, not the browser's small grey one. */
.export.avoid label.year-end { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-2); margin: var(--ds-3) 0; font-size: var(--ds-t-subhead); color: var(--ds-text-2); }
.export.avoid label.year-end select { font: inherit; color: var(--ink); background: var(--sheet); padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: 40px; }
@media (pointer: coarse), (max-width: 640px) { .export.avoid label.year-end select { min-height: 44px; font-size: 16px; } }
/* Edited offline is a card of Downloads like the others; its heading keeps its compact size. */
.rt-lead h2 { margin: 0; font-size: var(--ds-t-callout); line-height: var(--ds-l-callout, 1.35); border: 0; padding: 0; }
/* Project records. A choice's words stay beside its button and wrap there (on a phone "What the Records view shows now"
   dropped under its button, alone on the line); the chronology's box is the app's own type, not the browser's. */
.rc-opt > .rc-opt-words { flex: 1 1 0; min-width: 0; }
.rc-chron textarea { font: inherit; color: var(--ink); padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--sheet); }
@media (pointer: coarse), (max-width: 640px) { .rc-chron textarea { font-size: 16px; } }
/* An empty message line takes no room anywhere (it stays on the page, so a screen reader still hears it filled):
   36 px of nothing stood under Project team, Programme and delay and other forms. */
.msg:empty { min-height: 0; margin: 0; }
/* A link in the middle of a sentence stays in the sentence on a phone: the only element of its paragraph, it was set
   as a 44 px block of its own ("Turn this on in" / the link / ": it is off for your company."). */
@media (max-width: 640px) { p.hint > a.in-text:only-child { display: inline; min-height: 0; } }
/* Programs (the dark page): a badge on lime or amber keeps dark words. The page turns --ink pale, so "On file" stood
   pale on lime and "Close to a party on file" white on pale amber, neither readable. */
.pf.pfm .pp-kind.exact, .pf.pfm .pp-kind.near, .pf.pfm .pp-kind.conflict { color: #0f2f28; }
/* Records. From and To stay side by side (To stood alone on a second row at 1,440 px), and a name in "From \2192 To"
   breaks between words, not inside one ("Contracto / rs LLC"). */
.rv-filters { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
.rv-filters > .rv-dates { grid-column: span 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-2); min-width: 0; }
@media (max-width: 640px) { .rv-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rv-filters > .rv-dates { grid-column: 1 / -1; } }
@media (min-width: 641px) { table.rv-log td:nth-child(3) { overflow-wrap: break-word; word-break: normal; hyphens: none; min-width: 7.5rem; } }
.keep-together { white-space: nowrap; }
/* Disputes on a phone: a set of choices stands two across under its question, not as a column of eight full-width bars. */
@media (max-width: 640px) {
  .export.avoid .row:has(> .is-choice) { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .export.avoid .row:has(> .is-choice) > .hint { flex: 1 0 100%; }
  .export.avoid .row:has(> .is-choice) > .is-choice { flex: 1 1 calc(50% - var(--ds-2)); min-width: 0; text-align: center; }
  .hat-choice > .is-choice, .hat-choice > .hint, .hat-choice > .hat-more { flex: 1 0 100%; text-align: center; }  /* each side's name on one line */
  /* A side's name may wrap: "Their side (Employer / Employer's Representative)" ran 7 px past a 320 px screen, because buttons
     in an export are kept on one line (programs walk of 15 November 2026). */
  .export .hat-choice > .is-choice, .export .hat-more > button { white-space: normal; min-width: 0; max-width: 100%; }
  .hat-choice > .hint { text-align: left; }
}
/* A button drawn as a link reads as a link: its words start where the text around them starts. A long party name
   stood centred over three lines (a button centres its words), with its registration number flush left under it. */
.linkbtn { text-align: inherit; }
.pg-party-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--ds-2); }
.pg-party-list li > .linkbtn { text-align: start; min-width: 0; }
/* A status in a row of a list is as wide as its words: the second status of a negotiation round's row dropped under
   the number and filled its 120 px column ("Open", "Agreed" as bars). */
.row-head > .pill { justify-self: start; width: max-content; max-width: 100%; }
/* The Portfolio (the dark page): a status on one of the page's pale tones keeps dark words. "High" and "Critical"
   stood white on pale orange and pale red, and so did the numbers in the matrix's dots. */
.pf.pfm .risk.severe, .pf.pfm .risk.critical, .pf.pfm .risk.high, .pf.pfm .risk.moderate, .pf.pfm .risk.medium, .pf.pfm .risk.low, .pf.pfm .pfv-dot.over, .pf.pfm .pfv-dot.risk { color: #0a1c17; }
/* Disputes on a phone: the four figures stand one under the other, each with its label, so a long amount has the
   whole width ("SAR 10,250,000" ran out of its half and into "Not recorded"); a longer one still wraps at its space. */
@media (max-width: 640px) {
  .at-risk.avoid-tiles, .view-wrap.has-toc .at-risk.avoid-tiles { grid-template-columns: minmax(0, 1fr); }
  .at-risk.avoid-tiles .tile { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 var(--ds-3); min-width: 0; }
  .at-risk.avoid-tiles .tile + .tile { box-shadow: inset 0 1px 0 var(--ds-hair); }
  .at-risk.avoid-tiles .tile strong { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
}

/* ---------------------------------------------------------------- the one next step (ew2/web/nextstep.js; Han, 11 November 2026)
   One card at the top of a working screen: what to do, why now, one button. The most prominent thing on the screen
   after its heading: the page's only lime button above the fold sits here. The colour of the bar always stands beside
   its word ("Late", "Due this week"). On a phone the button takes the full width under the words. */
.ns-host { margin: 0 0 var(--ds-6); }
.ns-host[hidden] { display: none; }
.next-step { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--ds-3) var(--ds-6); padding: var(--ds-5) var(--ds-6);
  background: var(--ds-surface); border: 1px solid var(--ds-hair); border-left: 6px solid var(--low); border-radius: var(--ds-r-md); box-shadow: var(--ds-e1); }
.next-step.ns-late { border-left-color: var(--critical); }
.next-step.ns-soon { border-left-color: var(--high); }
.next-step.ns-todo { border-left-color: var(--medium); }
.next-step.ns-start { border-left-color: var(--ds-lime-press); }
.next-step p { margin: 0; }
.ns-text { min-width: 0; display: grid; gap: var(--ds-1); }
.ns-k { font-size: var(--ds-t-caption); line-height: var(--ds-l-caption); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ds-text-2); display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-2); }
.ns-tone { letter-spacing: 0; text-transform: none; font-size: var(--ds-t-footnote); line-height: var(--ds-l-footnote); padding: 1px var(--ds-2); border-radius: var(--ds-r-pill); background: var(--tint); color: var(--low); white-space: nowrap; }
.ns-late .ns-tone { background: var(--critical); color: #fff; }
.ns-soon .ns-tone { background: color-mix(in srgb, var(--high) 16%, var(--ds-surface)); color: var(--high); }
.ns-todo .ns-tone { background: color-mix(in srgb, var(--medium) 14%, var(--ds-surface)); color: var(--medium); }
.ns-t { font-family: var(--ds-font-display); font-size: var(--ds-t-title3); line-height: var(--ds-l-title3); font-weight: 700; letter-spacing: var(--ds-track-display); color: var(--ds-ink); overflow-wrap: anywhere; text-align: start; }
.ns-why { font-size: var(--ds-t-callout); line-height: var(--ds-l-callout); color: var(--ds-text-2); overflow-wrap: anywhere; text-align: start; }
.ns-proj { font-size: var(--ds-t-footnote); line-height: var(--ds-l-footnote); color: var(--ds-text-3); overflow-wrap: anywhere; text-align: start; }
.ns-go { display: flex; flex-direction: column; align-items: flex-end; gap: var(--ds-2); }
.ns-btn { white-space: nowrap; min-height: 44px; text-decoration: none; }
.ns-more { font-size: var(--ds-t-footnote); line-height: var(--ds-l-footnote); color: var(--ds-text-2); white-space: nowrap; }
.ns-more:hover { color: var(--link); }
/* Above another screen's own subject (Your work, Records, Portfolio) the step is a reminder: two lines at most, its
   button smaller, so the screen's own heading stays on the first screen of a phone. */
.ns-compact .next-step { padding: var(--ds-3) var(--ds-5); gap: var(--ds-2) var(--ds-5); }
.ns-compact .ns-t { font-family: var(--ds-font); font-size: var(--ds-t-headline); line-height: var(--ds-l-headline); font-weight: 600; letter-spacing: 0;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.ns-compact .ns-proj { display: none; }
.ns-compact .ns-go { flex-direction: row; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: var(--ds-3); }
/* On the project's page the card sits inside the project's own panel, above its position line. */
#ct-body > .ns-host { margin-bottom: var(--ds-4); }
/* A touch screen of any width up to a small laptop: the link beside the button is a 44 px target too. */
@media (max-width: 1099px) { .ns-more { min-height: 44px; display: inline-flex; align-items: center; } }
@media (max-width: 760px) {
  .next-step { grid-template-columns: minmax(0, 1fr); padding: var(--ds-4); }
  .ns-t { font-size: var(--ds-t-headline); line-height: var(--ds-l-headline); }
  .ns-go { align-items: stretch; }
  .ns-btn { width: 100%; white-space: normal; text-align: center; }
  .ns-more { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; white-space: normal; }
  .ns-compact .next-step { padding: var(--ds-3) var(--ds-4); }
  .ns-compact .ns-go { flex-direction: column; align-items: stretch; gap: 0; }
  .ns-compact .ns-more { display: none; }
}

/* ---------------------------------------------------------------- every size of screen (Han, 11 November 2026, 21:00;
   deploy/e2e_sizes.py walks 320 px to 2,560 px, phones held sideways, 200% zoom and large text)
   A short screen (a phone held sideways, a window zoomed to 200%): the top bar scrolls away with the page instead of
   holding a third of the screen, and the tabs of a piece of work stick at the very top (they sat under the bar). */
@media (max-height: 500px) {
  .top { position: static; }
  .tabs-stick { top: 0; }
  /* The More menu fits the screen and scrolls inside itself (at 640 by 400 its top ran off the screen). */
  #more-menu { max-height: calc(100vh - 76px); max-height: calc(100dvh - 76px); overflow-y: auto; overscroll-behavior: contain; }
}
/* Touch screens between a phone and a computer (a phone held sideways at 844 px, a tablet at 1,024 px): a long project
   or program name wraps instead of being cut with an ellipsis, the months take their short form, and every count is a
   44 px target, as on a phone. */
@media (max-width: 1099px) {
  .pfv-step-l, .pfm-glab, .pfm-zone, .pfm-ax { font-size: 12px; }
  .pf-mini dd a { display: flex; align-items: center; min-height: 44px; min-width: 44px; text-decoration: none; }
  .pfv-mx-cell { min-height: 44px; min-width: 44px; height: auto; }
  .pfm .pfm-prog-n { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word; min-height: 44px; display: inline-flex; align-items: center; }
  /* A name with no spaces (300 characters) broke nowhere: "break-word" does not shrink a grid item's smallest width, so
     the Portfolio's program row made a phone page 1,981 px wide (live walk of 15 November 2026). "anywhere" does. */
  .pfm .pfm-prog-n, .dn-project { overflow-wrap: anywhere; min-width: 0; }
  .dn-project { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word; }
  .pfm-glab { overflow: visible; text-overflow: clip; white-space: normal; }
  .pfm-glab .pfm-gm-full { display: none; }
  .pfm-glab .pfm-gm-short { display: inline; }
}
/* Your work uses the width beside the rail like every other screen (it alone kept 1,080 px and left the right of a wide
   screen empty: 611 px at 2,560 px). */
@media (min-width: 1100px) { body:has(#rail:not([hidden])) #history { max-width: none; } }
