/* ============================================================================
   RELEVANT CONTRACTS TAX PAGE (tax-rct.html), rebuilt on the Projects pattern (Peter, 19 Oct 2026: "If you're gonna do
   that style, why didn't you copy projects? Show a dashboard and then show all projects.")
   Only layout lives here, copied rule for rule from projects.css (.pj-canvas, .pjh-grid, .pjh-figs, .pjh-about) with
   the .rct- prefix. The parts themselves are the shared ones: .sec-canvas, .dgrid / .dcard, .needs, .row-card,
   .status-pill, .filter-panel--drawer, .fsum, .list-empty, and Projects' closed card .pjh-disc (projects.css, linked
   by the page). Every .rct- class is catalogued in preview/index.html (#rct).
   ============================================================================ */

/* ---- the header: when the title and the right-hand row do not fit on one line (headFit, tax-rct.html), the row sits
   under the title, as on the project page and on a phone, instead of being lifted onto the title line over its words.
   No slide when it moves: it is not the pinned header's lift ---- */
@media (min-width: 769px) {
  body.sec-wide .page-stickyhead > .page-header.rct-head--under > .header-sub { margin-top: 0; transition: none; }
}

/* ---- the section card: the shared .sec-canvas, the Projects light (section-canvas.css sets it for every card) ---- */
body.sec-wide { --sec-body: 1228px; }
.rct-canvas .canvas-chart { margin-top: 0; }
.rct-canvas .ask-explore { color: #46707e; }
.rct-canvas__sub { color: var(--color-text); opacity: .7; margin-top: 6px; }
/* the list view keeps the card, slim: just the one Ask box, which also filters the list under it */
.rct-canvas--slim > :not(.ask-box):not(.ask-answer-wrap):not(.ask-hello) { display: none !important; }
.rct-canvas--slim { margin-bottom: 36px; }

/* ---- Needs you: Home's card grid, two to a row, the card hugging its content ---- */
.app--wide .rct-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: var(--space-6); }
.app--wide .rct-grid .dcard { min-height: 0; }

/* ---- the figure cards: a row of four (three for a subcontractor), like Projects' All / On track / At risk / Complete ---- */
.app--wide .rct-figs { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: var(--space-8); }
.app--wide .rct-figs.rct-figs--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* four money cards sit two to a row: a figure in euros is wider than Projects' counts, and four to a row pushed the link out of the card */
.app--wide .rct-figs.rct-figs--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rct-figs .dcard__foot { flex-wrap: wrap; row-gap: 12px; }   /* a very large figure drops its link under it rather than out of the card */
.app--wide .rct-figs .dcard { min-height: 0; }
.rct-fig .dcard__line { flex: 1; }
@media (max-width: 1100px) { .app--wide .rct-figs, .app--wide .rct-figs.rct-figs--3, .app--wide .rct-figs.rct-figs--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .app--wide .rct-grid, .app--wide .rct-figs, .app--wide .rct-figs.rct-figs--3, .app--wide .rct-figs.rct-figs--2 { grid-template-columns: minmax(0, 1fr); } }
/* what Revenue set against a tax, under the card's sentence, each with its Undo */
.rct-offs { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.rct-offs li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rct-offs .dcard__sub { margin: 0; }

/* ---- the closed card at the foot: The rules we follow. Projects' "How we work this out" card itself (.pjh-disc, its
   head, chevron and body from projects.css); only the one-column row and the list of rules live here ---- */
.app--wide .rct-about { grid-template-columns: minmax(0, 1fr); align-items: start; margin-bottom: var(--space-8); }
.app--wide .rct-about .dcard { min-height: 0; }
@media (prefers-reduced-motion: reduce) { .pjh-disc__chev { transition: none; } }
/* ONE SIZE IN A CARD (Home's rule): every line is the body size in ink, the rule's name in medium. No small grey text */
.rct-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; font-size: var(--text-base); line-height: var(--leading-body); color: var(--color-text); }
.rct-rules li { display: flex; flex-direction: column; gap: 3px; }
.rct-rules strong { font-weight: var(--weight-medium); }
.rct-rules p { margin: 0; }
.rct-rules a { color: var(--color-text); font-size: var(--text-base); text-decoration: underline; text-underline-offset: 3px; align-self: flex-start; }
.rct-rules .rct-rules__quote { font-style: italic; }

/* ---- the list view: the toolbar's way back, the standard row-card list ---- */
#rct-tools[hidden] { display: none; }
.rct-back { margin-top: 0; }
#rct-rows-wrap > .section-title { margin-bottom: var(--space-4); }
.rct-rows .row-card[data-href] { cursor: pointer; }
.rct-rows .row-card[data-href]:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }
/* COLUMNS LINE UP (Projects' rows, 24 Aug): the name takes the free room and crops, every figure has a fixed slot.
   Each slot is sized for its label AND a five figure amount, cell padding included (row-card.css, 10px a side), so a
   right-aligned figure always keeps 24px from the one before it (19 Oct 2026: "Paid this year €6,720" ran into
   "Kept back €1,680" at 1512 and 1280 in 150px slots) */
/* THE NAME IS NEVER CUT (19 Oct 2026: "K..." at 900, "Kavanagh & So..." at 1280). It takes the free room first; the
   figures that can go drop out before it is short (below), and a name longer than its room wraps onto a second line */
.rct-rows .rct-name { flex: 999 1 0; min-width: 0; white-space: normal; overflow-wrap: break-word; }
.rct-rows .rct-date { width: 140px; flex: none; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; }
.rct-rows .rct-fig { width: 172px; box-sizing: border-box; text-align: right; flex: none; }
.rct-rows .rct-fig--wide { width: 216px; }    /* the kept back figure with its rate; "Paid this year" */
.rct-rows .rct-fig--narrow { width: 124px; }  /* a count: Contracts 1, Payments 3 */
.rct-rows .status-pill { min-width: 150px; justify-content: center; flex: none; }
.rct-k { color: var(--color-text-muted); }
/* short of room, the figures the row can do without go first (the rest are what the list is for), in two steps, each
   measured so the longest seed name ("Kavanagh & Sons Builders") keeps its line: the gross or a count (--first) under
   1360, what landed or was paid (--hide) under 1140. The figure the list is for and the pill never go */
@media (max-width: 1360px) { .rct-rows .rct-fig--first { display: none; } }
@media (max-width: 1140px) { .rct-rows .rct-fig--hide { display: none; } }
/* a line under the row (a return that rests on a payment not paid yet): its own line, under the name */
.rct-rows .rct-note { flex: 1 1 100%; white-space: normal; color: var(--color-text-muted); padding-top: 0; }
/* a phone or a narrow window: the name on its own line, the figures under it. From 960 down: between 901 and 960 the
   frame's 48px sides leave a row narrower than at 900, and a name squeezed beside the figures broke over three lines */
@media (max-width: 960px) {
  .rct-rows .rct-name { flex: 1 1 100%; }
  .rct-rows .rct-date { width: auto; }
  .rct-rows .rct-fig, .rct-rows .rct-fig--wide, .rct-rows .rct-fig--narrow { width: auto; }
  .rct-rows .status-pill { min-width: 0; }
}

/* ---- the drawers (kept from the old page, 28 Sep): the info mark, the worked-out payment, two fields side by side ---- */
.rct-tip { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 6px;
  padding: 0; border: 0; background: none; color: var(--color-text-muted); cursor: help; vertical-align: -3px; }
.rct-tip svg { width: 16px; height: 16px; }
.rct-tip:hover, .rct-tip:focus-visible { color: var(--color-text); }
.rct-calc { border: var(--border-width) solid var(--color-border); border-radius: var(--radius-md); padding: var(--drawer-row-pad, 18px); display: flex; flex-direction: column; gap: 8px; }
.rct-calc p { margin: 0; }
.rct-calc__line { display: flex; justify-content: space-between; gap: 12px; }
.rct-calc__line span:last-child { font-variant-numeric: tabular-nums; color: var(--color-text); }
.rct-calc__line span:first-child { color: var(--color-text-muted); }
.rct-calc__big span { font-weight: var(--weight-medium); }
.rct-calc__note { margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); }
.rct-steps { margin: 0; padding-left: 20px; color: var(--color-text-muted); display: flex; flex-direction: column; gap: 6px; }
.rct-cols { display: flex; gap: var(--drawer-row-gap, 14px); }
.rct-cols > * { flex: 1 1 0; min-width: 0; }
.rct-cols .tx-dd, .rct-cols .frange, .fgroup .tx-dd { width: 100%; }
.rct-none { margin: 0; color: var(--color-text-muted); }
/* the filter drawer's who list (Projects' client pick): a column of checkboxes that scrolls when long */
.rct-pick { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow: auto; }
/* the off card's one button, under its sentence (the old page's .dcard .btn) */
#rct-off .btn { align-self: flex-start; margin-top: 16px; }
/* required-field flag (the shared .is-missing convention, as projects.css): red until touched */
.input.is-missing, .is-missing > .tx-dd__btn, .tx-dd.is-missing .tx-dd__btn { border-color: var(--color-danger); }
.checkbox.is-missing { color: var(--color-danger); }
