/* ldu/pages-clients.css: Daniel's Clients list (clients/index) and one client's workspace, the Overview tab (clients/_workspace; Milan, 12 Nov).
   Its own sheet so it merges beside the Activity and Reviews work in pages-work.css. Layout only, tokens only (bin/ds-lint).

   The list: the search and four filters on one bar, then one framed table (.ldu-table), every column left-aligned; the whole row opens the
   client (the name's link is stretched over it). Colour only in DS pills: the status, what needs Daniel, a date passed (Milan, 13 Nov, 39-45).
   The name column takes what the others leave and cuts a long name with "…"; Last activity, the least needed, leaves when the page is under
   900px wide (a container query, so the rail open or folded both count; Milan, 13 Nov: cut off at 1200 with the rail open). Under 720px a row is a
   card: the name with its status at the end, then Work, Next date and Last activity as a label and its value, one line each.
   The workspace: a work column (Waiting on you, Matters, Conversations) and a side column (Waiting on the client, Billing, About the client)
   from 1180px; one column below, the side cards after the work. Sam's documents board follows under it on the same tab. Nothing lifts. */

/* ── the list ─────────────────────────────────────────────────── */
.cl { gap: 24px; }
.cl__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.cl__search { flex: 1 1 220px; min-width: 0; } /* the search takes what the filters leave, so the bar ends level with the table */
.cl__filter { width: 168px; }
.cl__filter .ldu-dd__trigger { width: 100%; }
.cl-row { position: relative; }
.cl-row__name { display: flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 600; text-decoration: none; }
.cl-row__name::after { content: ""; position: absolute; inset: 0; } /* the whole row is the link */
.cl-row__name:focus-visible { outline: none; }
.cl-row:has(.cl-row__name:focus-visible) { outline: var(--ring-w) solid var(--ring); outline-offset: -2px; }
.cl-row__line { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
/* a cell is one line (Milan, 13 Nov, point 47): what a pill stands for is its tip, above the row's link so it takes hover and focus and opens the same
   client; on a desktop the quiet line under it is for screen readers only, on a phone it shows (no hover there) */
.cl-row__tip { z-index: 1; }
.cl-row__tip[data-tip]:is(:hover, :focus-visible, .is-hover)::after { max-width: none; white-space: nowrap; } /* a tip of one line: it is short, and two lines covered the row */
.cl-row__more { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cl-row__phone { display: none; } /* inside the Late pill: "· 10 days", on a phone only */
.cl-row__name { min-width: 0; max-width: 100%; }
.cl-row__name > [data-hit] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* a long name stays one line; it is whole on the client page */
.cl-row__mark {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: var(--r-1);
  background: var(--ldu-wash); color: var(--ink-2); font-size: var(--fs-meta); font-weight: 600;
}
.cw-warn { display: inline-flex; align-items: center; gap: 6px; color: var(--danger); font-weight: 500; }
.cw-warn { color: var(--ink); }
.cw-warn > .icon { color: var(--warn); flex: none; }
.cw-late { color: var(--danger); font-weight: 500; white-space: nowrap; }
.cl-row__quiet, .cw-quiet { color: var(--ink-3); }
.cl__table td { white-space: nowrap; }
.cl__table tbody th { width: 100%; max-width: 0; } /* the name column takes what the others leave, so a long name is cut there, never the table */
.cl-row__name > .chip { flex: none; }
@container page (max-width: 900px) { .cl__table :is(thead th:nth-child(5), td[data-label="Last activity"]) { display: none; } }

@media (max-width: 720px) {
  .cl__search { max-width: none; flex-basis: 100%; }
  .cl__filter { flex: 1 1 calc(50% - 4px); width: auto; min-width: 0; } /* two filters a row, so four take two rows, not four */
  .ldu-table:is(.cl__table, .cw-matters, .cw-bills, .cw-doctable) { border: 0; background: transparent; overflow: visible; }
  .ldu-table:is(.cl__table, .cw-matters, .cw-bills, .cw-doctable) thead { display: none; }
  .ldu-table:is(.cl__table, .cw-matters, .cw-bills, .cw-doctable) :is(table, tbody) { display: block; }
  .ldu-table:is(.cl__table, .cw-matters, .cw-bills, .cw-doctable) tbody { display: grid; gap: 8px; }
  .ldu-table:is(.cl__table, .cw-matters, .cw-bills, .cw-doctable) tbody tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px;
    padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--bg-2);
  }
  .ldu-table:is(.cl__table, .cw-matters, .cw-bills, .cw-doctable) tbody :is(th, td) { display: block; padding: 0; border: 0; white-space: normal; font-size: var(--fs-ui); }
  /* a line is its label in a fixed column, then the value, both on the left (Milan, 13 Nov, point 41: nothing right-aligned) */
  .ldu-table:is(.cl__table, .cw-matters, .cw-bills, .cw-doctable) tbody td { grid-column: 1 / -1; display: flex; justify-content: flex-start; align-items: center; gap: 12px; }
  .ldu-table:is(.cl__table, .cw-matters, .cw-bills, .cw-doctable) tbody td::before { content: attr(data-label); flex: none; width: 88px; color: var(--ink-2); }
  /* the Clients list's card (Milan, 13 Nov: "the phone version looks terrible"): the name, its status at the end of that line, then one line each
     for Work, Next date and Last activity (quiet), the label in an 80px column; no second lines (how late sits in the Late pill) */
  .ldu-table.cl__table tbody tr { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .ldu-table.cl__table tbody th { grid-column: 1; grid-row: 1; width: auto; max-width: none; padding: 0 0 4px; }
  .ldu-table.cl__table tbody td[data-label="Status"] { grid-column: 2; grid-row: 1; padding-bottom: 4px; }
  .ldu-table.cl__table tbody td[data-label="Status"]::before { content: none; }
  .ldu-table.cl__table tbody td::before { width: 80px; }
  .ldu-table.cl__table tbody td[data-label="Last activity"] { display: flex; font-size: var(--fs-meta); color: var(--ink-3); } /* back on the card, quiet (the 900px rule above hides it) */
  .ldu-table.cl__table tbody td[data-label="Last activity"]::before { color: var(--ink-3); }
  .ldu-table.cl__table tbody td.cl-row__nodate { display: none; } /* no "None" line */
  .ldu-table.cl__table tbody td .cl-row__phone { display: inline; }
  .ldu-table.cw-doctable tbody td[data-label="For"]:not(.cw-doc__empty) { display: grid; grid-template-columns: 88px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: start; }
}

/* ── the workspace ────────────────────────────────────────────── */
.page.ldu-page.activity.dataroom:has(.cw, .cw-mx) { height: auto; } /* sized by its content, not the Tracker's full-height page: else a long tab or matter runs under the phone's bar */
.dataroom:has(.cw, .cw-mx) > * { flex: none; }
.cw-tabs { margin: 0; }
/* each tab is one column under the tabs; between its sections 40px, inside one 16px (Milan, 12 Nov, round 2) */
.cw { display: grid; align-content: start; gap: 40px; min-width: 0; }
/* the four tabs fit a phone with a gap between every two (round 3 send-back: a grid of max-content columns scrolled the row a few px on a
   matter, cutting "Overview", and left 12px between "Overview 3" and "Documents"): a row that never scrolls, the first tab on the left edge, the
   last on the right, the room left over shared out between them, never under 16px */
@media (max-width: 720px) {
  .ldu-tabs.cw-tabs { display: flex; justify-content: space-between; gap: 16px; overflow: visible; -webkit-mask-image: none; mask-image: none; animation: none; }
  .ldu-tabs.cw-tabs .ldu-tabs__tab { padding-inline: 0; }
}

.cw-sec { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; } /* one column no wider than the page: else the documents board's row widens it and its description runs off a phone (checklist 16) */
.cw-sec__head { display: grid; gap: 4px; }
.cw-sec__head--action { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 16px; }
.cw-sec__head--action .cw-sub { grid-column: 1 / -1; }
/* a section with nothing in it: one quiet line, no box (the page has other sections to look at) */
.cw-none { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-ui); color: var(--ink-2); }
.cw-none .icon { flex: none; color: var(--ink-3); }
.cw-head { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-h3); font-weight: 600; color: var(--ink); }
.cw-sub { margin: 0; max-width: 60ch; font-size: var(--fs-ui); line-height: 1.5; color: var(--ink-2); }
.cw-foot { margin: 0; font-size: var(--fs-meta); color: var(--ink-3); }

/* what waits on Daniel: an ask carries its own answer box; the twin's work is one line with its one link */
.cw-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cw-ask, .cw-item { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--bg-2); }
.cw-ask { display: grid; gap: 8px; }
.cw-ask__meta { margin: 0; font-size: var(--fs-meta); color: var(--ink-2); }
.cw-ask__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cw-ask__who { display: grid; gap: 2px; min-width: 0; }
.cw-ask__title { margin: 0; font-size: var(--fs-body); font-weight: 600; color: var(--ink); }
.cw-ask__head > .btn { flex: none; }
.cw-ask__text { margin: 0; max-width: 72ch; font-size: var(--fs-body); line-height: 1.5; color: var(--ink); white-space: pre-line; }
.cw-ask__form { display: flex; align-items: flex-end; gap: 8px; }
.cw-ask__field { flex: 1 1 auto; min-width: 0; }
.cw-ask__form .textarea { min-height: 40px; }
.cw-ask__form .btn { flex: none; }
.cw-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.cw-item__icon { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: var(--r-1); background: var(--ldu-wash); color: var(--ink-2); }
.cw-item__text { display: grid; gap: 2px; flex: 1; min-width: 0; font-size: var(--fs-ui); color: var(--ink); }
.cw-item__text small { font-size: var(--fs-meta); color: var(--ink-2); }
.cw-item .btn { flex: none; }
@media (max-width: 720px) {
  .cw-ask__form { flex-direction: column; align-items: stretch; }
  .cw-item { flex-wrap: wrap; }
  .cw-item__text { flex-basis: calc(100% - 44px); } /* the title and its line take the row; the button goes under them (checklist 28) */
  .cw-item .btn { margin-left: 44px; }
  .cw-ask__head { flex-direction: column; gap: 12px; }
}

/* matters and invoices: the title's link is stretched over its row. The overlay exists only inside a positioned .cw-matter row,
   so a link outside one can never cover the page (it once covered the tabs on Billing). */
.cw-matter { position: relative; }
.cw-matter .cw-matter__link::after { content: ""; position: absolute; inset: 0; }
.ldu-table td a.cw-matter__link, .ldu-table th a.cw-matter__link { text-decoration: none; color: var(--ink); }
.cw-matter__tag { margin-left: 8px; font-size: var(--fs-meta); font-weight: 400; color: var(--ink-3); }
.cw-matters td small { color: var(--ink-3); }

/* the twin's chat: what the harness did on the client's line, as chips under it (red only for a hard stop and a failed citation, Milan, 13 Nov note 8) */
.cw-harness { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.cw-harness__facts { font-size: var(--fs-meta); color: var(--ink-3); }

/* ── the Overview's board (Milan, 13 Nov, round 3): the tracker's lanes on its scrolling board; a lane colour in its icon only. Static cards have no hover; a matter's card is the tracker's. ── */
/* the board, its sideways scrolling and the lanes' height are every board's (ldu/components.css, "board"); Needs you is P1: the widest lane */
.cw-board .mtr-col { flex: 1 0 280px; max-width: 360px; max-height: min(70vh, 44rem); }   /* the board's size, restated over the page's .activity lanes (pages-work.css) */
.cw-board .mtr-col.cw-board__col--needs { flex-grow: 1.4; max-width: 504px; }
@media (max-width: 720px) { .cw-board .mtr-col { flex-basis: calc(100vw - 64px); max-height: 70vh; } .cw-board .mtr-col.cw-board__col--nomatch { display: none; } }
.cw-board__group { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.cw-board__sub { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-ui); font-weight: 600; color: var(--ink); }
.cw-board__footrow .cw-foot { white-space: nowrap; }
.cw-board .cw-board__none { margin: 0; font-size: var(--fs-ui); color: var(--ink-3); }
.cw-board__col--needs { --lane: var(--danger); }
.cw-board__col--sent { --lane: var(--ink-2); } /* neutral: no lilac on the board (round 3 send-back) */
.cw-board__col--asked { --lane: var(--warn); }
.cw-board__col--matters { --lane: var(--ink-3); }
.cw-bcard { display: grid; justify-items: start; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--bg-2); min-width: 0; }
.cw-bcard > * { min-width: 0; max-width: 100%; }
.cw-bcard__title { font-size: var(--fs-ui); font-weight: 600; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.cw-bcard__meta { font-size: var(--fs-meta); line-height: 1.4; color: var(--ink-2); }
.cw-bcard__text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: var(--fs-ui); line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.cw-bcard__tag { margin-bottom: -2px; }
.cw-bcard__text > .icon { vertical-align: -2px; color: var(--ink-3); }
.cw-bcard > .btn, .cw-bcard > form { margin-top: 2px; }
.cw-bcard__flag { font-size: var(--fs-meta); }
.cw-bcard--link .mtr-card__title { font-size: var(--fs-ui); }
.cw-board__more { display: grid; gap: 8px; }
.cw-board__more > summary { justify-self: start; list-style: none; }
.cw-board__more > summary::-webkit-details-marker { display: none; }
.cw-board__more[open] > summary { display: none; }
.cw-board__foot { justify-self: start; }
.cw-board__footrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ── the Documents tab: the search and three filters on one bar, then the DS table; a row's name over its reference ── */
.cw-docbar__dd { width: 168px; }
@media (max-width: 720px) {
  /* a phone: the section's button goes under its line, so a long label never squeezes the title */
  .cw-sec__head--action { grid-template-columns: minmax(0, 1fr); }
  .cw-sec__head--action > .btn { grid-row: 3; justify-self: start; }
}
.cw-docbar__dd .ldu-dd__trigger { width: 100%; }
.cw-doctable th[scope="row"] { min-width: 12rem; }
.cw-doc__cell, .cw-doc__for { display: grid; gap: 2px; min-width: 0; }
.cw-doc__kind { display: inline-flex; align-items: center; gap: 4px; } /* the Type, then its quiet pencil (Change type popup) */
.cw-doc__name { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.cw-doc__ref { font-size: var(--fs-meta); font-weight: 400; color: var(--ink-3); white-space: nowrap; } /* "seed-d043" never splits */
.cw-doc__when { white-space: nowrap; color: var(--ink-2); }
.ldu-table td a.cw-doc__matter { color: var(--ink); }
@media (max-width: 720px) {
  .cw-docbar__dd { flex: 1 1 auto; width: auto; } /* the dropdowns wrap rather than cut their labels */
  .ldu-table.cw-doctable tbody th { grid-column: 1 / -1; }
  .ldu-table.cw-doctable tbody td.cw-doc__empty { display: none; } /* a phone: a row says only what is set */
  .ldu-table.cw-doctable tbody td[data-label="For"] .cw-doc__for { text-align: left; } /* For: its label, then the matter over its issue (rule with the list's two-line cells above) */
}

/* ── the Chats tab: a row per chat (who, title, their latest line, when); the whole row opens its lines ── */
.cw-chatlist { display: grid; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--bg-2); overflow: hidden; }
.cw-chatlist > li + li { border-top: 1px solid var(--line); }
.cw-sessrow { padding: 12px 16px; overflow-wrap: anywhere; } /* the Sessions tab: a plain row of text, not a Chats button */
.cw-chatrow { text-decoration: none; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto 16px; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 12px 16px;
  border: 0; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: background-color var(--dur); }
.cw-chatrow:hover { background: var(--ldu-wash); }
.cw-chatrow:focus-visible { outline: var(--ring-w) solid var(--ring); outline-offset: calc(var(--ring-w) * -1); }
.cw-chatrow__icon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-1); background: var(--ldu-wash); color: var(--ink-2); }
.cw-chatrow__main { display: grid; gap: 2px; min-width: 0; }
.cw-chatrow__title { overflow: hidden; font-size: var(--fs-ui); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.cw-chatrow__last { overflow: hidden; font-size: var(--fs-ui); color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.cw-chatrow__meta { display: grid; justify-items: end; gap: 4px; }
.cw-chatrow__meta small { font-size: var(--fs-meta); color: var(--ink-3); white-space: nowrap; }
.cw-chatrow__go { color: var(--ink-3); transition: transform var(--dur), color var(--dur); }
.cw-chatrow:hover .cw-chatrow__go { color: var(--ink); transform: translateX(2px); }
@media (max-width: 720px) {
  .cw-chatrow { grid-template-columns: 32px minmax(0, 1fr) 16px; grid-template-areas: "icon main go" "icon meta go"; align-items: start; }
  .cw-chatrow__icon { grid-area: icon; }
  .cw-chatrow__main { grid-area: main; }
  .cw-chatrow__title, .cw-chatrow__last { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; } /* the title is what tells chats apart: two lines, not one (design critic, 13 Nov) */
  .cw-chatrow__meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; justify-items: start; gap: 4px 8px; min-width: 0; } /* a twin row's longer chip pushes the line count under it, never off the card */
  .cw-chatrow__go { grid-area: go; align-self: center; }
}

.ldu-table .cw-total { font-variant-numeric: tabular-nums; }

/* the Client tab (Milan, 12 Nov: white containers with clear titles): DS cards two by two, the chats across the bottom; one column under 960px.
   Each card keeps its own height. Inside a card: title and one line, then its content, 16px apart. */
.cw-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 24px; } /* each card its own height: a short one leaves no white gap */
.cw-cards__wide { grid-column: 1 / -1; }
.cw-cards__col { display: grid; align-content: start; gap: 24px; min-width: 0; } /* a column stacks its own cards: a short one leaves no gap (checklist 19) */
@media (max-width: 960px) { .cw-cards, .cw-cards__col { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
.cw-card { gap: 16px; min-width: 0; }
.cw-card__head { display: grid; gap: 4px; min-width: 0; }
.cw-card__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cw-card__sub { margin: 0; max-width: 60ch; font-size: var(--fs-ui); line-height: 1.5; color: var(--ink-2); }
.cw-facts { display: grid; gap: 12px; margin: 0; }
.cw-facts > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; font-size: var(--fs-ui); } /* label over value at every width (round 3 send-back, point 11) */
.cw-facts dt { color: var(--ink-2); }
.cw-facts dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.cw-facts dd.cw-missing { color: var(--ink-3); }
.cw-logo { position: relative; display: inline-grid; place-items: center; width: 48px; height: 48px; overflow: hidden; border-radius: var(--r-2); background: var(--ldu-wash); }
.cw-logo__mark { font-size: var(--fs-ui); font-weight: 600; color: var(--ink-2); }
.cw-logo__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--bg-2); }
.cw-invite { display: flex; align-items: flex-end; gap: 8px; }
.cw-invite__field { flex: 1 1 auto; }
.cw-invite .btn { flex: none; }
@media (max-width: 720px) {
  .cw-invite { flex-direction: column; align-items: stretch; }
}

/* a matter, inside the Overview (Milan, 12 Nov: organised, white containers, DS components): its title row, then the work column and a side
   column of DS cards from 1100px, one column below. Between cards 24px, inside one 16px. */
.cw-mx { display: grid; gap: 24px; min-width: 0; }
.cw-mx__head { gap: 16px; }
.cw-mx__headrow { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cw-mx__title { display: grid; gap: 8px; min-width: 0; }
.cw-mx__name { margin: 0; font-family: var(--display); font-size: var(--fs-h2); font-weight: 600; line-height: 1.3; color: var(--ink); }
.cw-mx__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cw-mx__actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* What needs attention, inside the header card: the icon carries the tone; no coloured box or border (Milan's checklist 21). */
.cw-mx__attention { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: var(--fs-ui); line-height: 1.5; color: var(--ink-2); }
.page.ldu-page .cw-mx__head > .cw-mx__attention { max-width: none; } /* beats pages-work.css's 75ch cap on a .card > p, so the rule runs the card's full width */
.cw-mx__attention > .icon { flex: none; margin-top: 2px; color: var(--danger); }
.cw-mx__attention strong { font-weight: 600; color: var(--ink); }
/* The sections: sent up (full width), the next step beside the note-taker (one row, equal height), the key dates (full width). */
.cw-mx__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 24px; align-items: stretch; }
.cw-mx__wide { grid-column: 1 / -1; }
@media (max-width: 1100px) { .cw-mx__grid { grid-template-columns: minmax(0, 1fr); } }
/* Date fields: white like the DS dropdown beside them, and a click anywhere opens the calendar (input[data-picker], as on My Company). */
.cw-mx input[type="date"].input { background-color: var(--bg-2); cursor: pointer; }
.cw-mx__card { gap: 16px; min-width: 0; }
.cw-mx__cardhead { display: grid; gap: 4px; }
.cw-mx__cardhead .card__title { display: flex; align-items: center; gap: 8px; }
.cw-mx__sub { margin: 0; max-width: 60ch; font-size: var(--fs-ui); line-height: 1.5; color: var(--ink-2); }
.cw-mx__rows { display: grid; margin: 0; padding: 0; list-style: none; }
.cw-mx__rows > li { padding: 12px 0; border-top: 1px solid var(--line); }
.cw-mx__rows > li:first-child { padding-top: 0; border-top: 0; }
.cw-mx__ask { display: grid; gap: 8px; }
.cw-mx__meta { margin: 0; font-size: var(--fs-meta); color: var(--ink-2); }
.cw-mx__text { margin: 0; max-width: 72ch; line-height: 1.5; color: var(--ink); white-space: pre-line; }
.cw-mx__answer { display: flex; align-items: flex-end; gap: 8px; }
.cw-mx__answer .field { flex: 1 1 auto; }
.cw-mx__answer .textarea { min-height: 40px; }
.cw-mx__answer .btn { flex: none; }
/* forms: labelled fields on one row, the buttons at the row's end; they wrap on a narrow card */
:is(.cw-mx__step, .cw-mx__add) { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.cw-mx__grow { flex: 1 1 220px; }
.cw-mx__date { flex: 0 0 176px; }
.cw-mx__kind { flex: 0 0 160px; }
.cw-mx__kind .ldu-dd, .cw-mx__kind .ldu-dd__trigger { width: 100%; }
.cw-mx__buttons { display: flex; gap: 8px; }
.cw-mx__add { padding-top: 16px; border-top: 1px solid var(--line); }
.cw-mx__notes { display: grid; gap: 12px; }
.cw-mx__notes .btn { justify-self: start; }
.cw-mx__keydate { display: grid; grid-template-columns: 136px minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.cw-mx__when { font-size: var(--fs-ui); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.cw-mx__when.chip { justify-self: start; color: var(--ink); } /* a passed key date: the DS soft late chip, not red text (hub, 13 Nov) */
.cw-mx__what { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; font-size: var(--fs-ui); color: var(--ink); }
.cw-mx__what small { flex-basis: 100%; font-size: var(--fs-meta); color: var(--ink-3); }
.cw-mx__keydate.is-done :is(.cw-mx__when, .cw-mx__what strong) { color: var(--ink-3); text-decoration: line-through; }
.cw-mx__rowbtns { display: flex; gap: 4px; }
.cw-mx__none { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-ui); color: var(--ink-2); }
.cw-mx__none .icon { flex: none; color: var(--ink-3); }
.cw-mx__flags { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.cw-mx__flags > label { font-size: var(--fs-ui); color: var(--ink); }
@media (max-width: 720px) {
  .cw-mx__date, .cw-mx__kind { flex: 1 1 100%; }
  .cw-mx__buttons, .cw-mx__buttons .btn { flex: 1 1 auto; }
  .cw-mx__answer { flex-direction: column; align-items: stretch; }
  .cw-mx__keydate { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .cw-mx__actions, .cw-mx__actions .btn { flex: 1 1 auto; }
}

.cw-memory { display: grid; margin: 0; padding: 0; list-style: none; }
.cw-memory__line { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.cw-memory__line:first-child { border-top: 0; padding-top: 0; }
.cw-memory__icon { flex: none; margin-top: 2px; color: var(--ink-3); }
.cw-memory__body { display: grid; gap: 2px; min-width: 0; }
.cw-memory__text { font-size: var(--fs-ui); line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.cw-memory__body small { font-size: var(--fs-meta); color: var(--ink-2); }
.cw-memory__more > summary { margin-top: 12px; list-style: none; }
.cw-memory__more > summary::-webkit-details-marker { display: none; }
.cw-memory__more[open] > summary { display: none; }
.cw-memory__more > .cw-memory > .cw-memory__line:first-child { padding-top: 12px; border-top: 1px solid var(--line); }


/* ── one chat open in place of the Chats list (Milan, 13 Nov note 3: "a container in white with the full chat. And then next to it ... the most
   important information"): the chat in a white container on the left, what needs Daniel and the one action at the top right, the documents
   and what was asked under them. The thread scrolls inside its container and opens at the newest line (chatlive_controller.js). A phone
   stacks: the chat, then what needs Daniel and the action, then the rest. ── */
.cw-chat { display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: auto auto 1fr; grid-template-areas: "head head" "main look" "main more";
  gap: 16px 24px; align-items: start; }
.cw-chat__head { grid-area: head; display: grid; gap: 4px; }
.cw-chat__head .cw-head { max-width: 60ch; }
.cw-chat__lookjump { display: none; justify-self: start; text-decoration: none; }
.cw-chat__main { grid-area: main; max-height: max(360px, calc(100dvh - 380px)); min-height: 320px; padding: 0; overflow-y: auto; overscroll-behavior: contain; scroll-padding-top: 16px; }
.cw-chat__thread.transcript { padding: 24px; }
.cw-chat__thread .msg { max-width: 80%; }
.cw-chat__turn { align-self: flex-end; max-width: 80%; margin-top: -8px; list-style: none; }   /* under the client's bubble, on its side */
.cw-chat__turn .cw-harness { justify-content: flex-end; }
.cw-chat__turn .chip { white-space: normal; text-align: left; }
.cw-chat__look { grid-area: look; display: grid; gap: 12px; }
.cw-chat__more { grid-area: more; display: grid; gap: 12px; align-content: start; }
.cw-chat__ask { justify-self: stretch; }
.cw-chat__box { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--bg-2); }
.cw-chat__title { margin: 0; font-size: var(--fs-ui); font-weight: 600; color: var(--ink); }
.cw-chat__quiet { margin: 0; font-size: var(--fs-ui); color: var(--ink-2); }
.cw-chat__main > .cw-chat__quiet { padding: 24px; }
.cw-chat__looks, .cw-chat__docs { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.cw-chat__jump { display: flex; align-items: center; gap: 8px; margin: 0 -8px; padding: 8px; border-radius: var(--r-1); color: var(--ink); text-decoration: none; transition: background-color var(--dur); }
.cw-chat__jump:hover { background: var(--ldu-wash); }
.cw-chat__jump:focus-visible { outline: var(--ring-w) solid var(--ring); }
.cw-chat__jumptext { display: grid; justify-items: start; gap: 4px; flex: 1 1 auto; min-width: 0; }
.cw-chat__go { flex: none; color: var(--ink-3); transition: color var(--dur); }
.cw-chat__jump:hover .cw-chat__go { color: var(--ink); }
.cw-chat__said { max-width: 100%; overflow: hidden; font-size: var(--fs-ui); color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.cw-chat__doc { font-size: var(--fs-ui); font-weight: 500; color: var(--ink); }
.cw-chat__facts { display: grid; gap: 8px; margin: 0; }
.cw-chat__facts div { display: grid; gap: 2px; }
.cw-chat__facts dt { font-size: var(--fs-meta); color: var(--ink-3); }
.cw-chat__facts dd { margin: 0; font-size: var(--fs-ui); color: var(--ink); }
@media (max-width: 860px) {
  .cw-chat { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "head" "main" "look" "more"; }
  .cw-chat__main { max-height: 70dvh; }
  .cw-chat__lookjump { display: inline-flex; }
  .cw-chat__thread.transcript { padding: 16px; }
  .cw-chat__thread .msg, .cw-chat__turn { max-width: 92%; }
}

/* Pilot program (pilot_program/index; Sam, 18 Nov): a row's Approve, Decline and Resend email on one line. */
.pilot-prog__actions { display: flex; flex-wrap: wrap; gap: 6px; }
