/* =====================================================================================================================
   payments-k.css: Payments (#/invoices) in the calm comparison style, behind ?payments=k (21 October 2026, night; README 67).
   Markup: ../../prototype/app/v8-payments.js, "The calm comparison style" (pkOpen, pkPaid). Every rule is scoped to
   html[data-payments="k"], so without the flag nothing changes. The model is Claims behind ?claims=flow (claims-flow.css, "The
   boxed table"): one white box, 1 px --v8-line, 8 corners; the gray band of heads inside its top (top corners 7, a hairline under
   it); rows about 88 high on hairlines; Home's square icon tile (README 63, 8d); markers before regular ink; sortable heads.
   Type 16 and 12 at 400 and 700, no font-size in a query. The container `pk` decides the columns.
   ===================================================================================================================== */

/* Section titles hold a table: 24 Bold ink, every page section title's size (Janne, 30 October 2026), the line 16 ink-2 */
html#v8[data-payments="k"] #app section:is(.v8-pay-topay, .v8-pay-paid) > .v8-sh h2.v8-h2 { color: var(--v8-ink); font-size: var(--v8c-fs-24, 24px) !important; line-height: var(--v8c-lh-24, 32px) !important; font-weight: 700 !important; letter-spacing: 0; }
html#v8[data-payments="k"] #app section:is(.v8-pay-topay, .v8-pay-paid) > .v8-sh p.v8-line { color: var(--v8-ink-2); }

/* ---------- The box ---------- */
html#v8[data-payments="k"] #app .pk-box { container: pk / inline-size; --pk-px: var(--v8-5); --pk-gap: var(--v8-5);
  --pk-cols: minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1.2fr) 124px;
  border: 1px solid var(--v8-line); border-radius: var(--v8-r-sm); background: var(--v8-white); color: var(--v8-ink); }
/* Invoices to pay, one bank transfer a row (README 109): Invoice, Account number, Recipient, Reference number, Amount, Status */
/* Each column sized by what it holds at 16 (the number, the account number and Copy, Fennia, the reference and Copy, the amount and
   Copy, the mark and "Due 15 September", the longest month), 16 apart: about 990 wide in all, so the row stays one line in a 1440 window */
html#v8[data-payments="k"] #app .pk-box.pk-open { --pk-gap: var(--v8-4); --pk-cols: minmax(0, 142fr) minmax(0, 234fr) minmax(0, 74fr) minmax(0, 140fr) minmax(0, 110fr) minmax(0, 178fr); }
html#v8[data-payments="k"] #app .pk-box :is(.pk-c, .pk-c *, .pk-pay *, .pk-tot *) { font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 400 !important; font-variant-numeric: tabular-nums; }

/* The grid: the band, every row and the total share the columns */
html#v8[data-payments="k"] #app :is(.pk-h, .pk-r, .pk-tot) { display: grid; grid-template-columns: var(--pk-cols); column-gap: var(--pk-gap); align-items: center; padding: 0 var(--pk-px); }
html#v8[data-payments="k"] #app .pk-c { min-width: 0; }

/* The band: light gray inside the box's top, its top corners 7 (8 less the line), square below, a hairline under it */
html#v8[data-payments="k"] #app .pk-h { min-height: 48px; border-radius: calc(var(--v8-r-sm) - 1px) calc(var(--v8-r-sm) - 1px) 0 0; border-bottom: 1px solid var(--v8-line); background: var(--v8-gray); }
html#v8[data-payments="k"] #app .pk-h .pk-c { color: var(--v8-ink); font-weight: 700 !important; white-space: nowrap; }
/* The sort heads: the claims' buttons (16 Bold ink, the up and down pair in ink-2, one arrow in ink when sorted, a gray wash, 44) */
html#v8[data-payments="k"] #app .pk-h .pk-sb { display: inline-flex; align-items: center; gap: var(--v8-1); min-height: 44px; margin: 0 0 0 calc(-1 * var(--v8-2)); padding: 0 var(--v8-2); border: 0; border-radius: var(--v8-r-tag); background: transparent; color: var(--v8-ink); cursor: pointer; font: inherit; font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 700 !important; text-decoration: none; white-space: nowrap; }
html#v8[data-payments="k"] #app .pk-si { display: inline-grid; place-items: center; width: 16px; height: 16px; color: var(--v8-ink-2); }
html#v8[data-payments="k"] #app .pk-sb.is-on .pk-si { color: var(--v8-ink); }
html#v8[data-payments="k"] #app .pk-sb svg.i { width: 16px; height: 16px; fill: currentColor; }
@media (hover: hover) { html#v8[data-payments="k"] #app .pk-sb:hover { background: color-mix(in srgb, var(--v8-ink) 7%, var(--v8-gray)); } }
html#v8[data-payments="k"] #app .pk-sb:active { background: color-mix(in srgb, var(--v8-ink) 12%, var(--v8-gray)); }
html#v8[data-payments="k"] #app .pk-sb:focus-visible { outline: var(--v8-focus) !important; outline-offset: 0 !important; box-shadow: var(--v8-focus-glow) !important; }

/* Rows: 22 above and below, hairlines between (a paid row's two lines make about 86, a row to pay about 68) */
html#v8[data-payments="k"] #app .pk-r { position: relative; padding-top: 22px; padding-bottom: 22px; transition: background-color .16s ease-out; }
html#v8[data-payments="k"] #app .pk-r + .pk-r { border-top: 1px solid var(--v8-line); }
html#v8[data-payments="k"] #app .pk-b > .pk-r:last-child { border-radius: 0 0 calc(var(--v8-r-sm) - 1px) calc(var(--v8-r-sm) - 1px); }

/* Invoice: the number (Bold, link green, no underline); on a paid row what it covers under it at 12 ink-2. No icon tile (README
   105: every row drew the same invoice icon) */
html#v8[data-payments="k"] #app .pk-c-n { display: flex; flex-direction: column; align-items: flex-start; }
html#v8[data-payments="k"] #app .pk-box .pk-c .pk-a { justify-self: start; color: var(--v8-green-t); font-weight: 400 !important;   /* README 208: links Regular, as Claims' rows */ text-decoration: none; text-underline-offset: 3px; text-decoration-thickness: 1px; white-space: nowrap; }
html#v8[data-payments="k"] #app .pk-box .pk-c .pk-w { display: block; margin-top: 2px; color: var(--v8-ink-2); font-size: var(--v8-fs-14) !important; line-height: var(--v8-lh-14) !important; }

/* A value with Copy beside it (the system's subtle 44 icon button, green, no ring), and the reference's phone-only label */
html#v8[data-payments="k"] #app .pk-cv { display: flex; align-items: center; gap: var(--v8-1); min-width: 0; }
html#v8[data-payments="k"] #app .pk-v { white-space: nowrap; }
html#v8[data-payments="k"] #app .pk-cv .v8-ib { margin: -10px 0; flex: none; border-radius: var(--v8-r-sm); }
html#v8[data-payments="k"] #app .pk-lab { display: none; }

/* Status: the marker (24, radius 6, a light tint, a 16 glyph), 12 before its words in regular ink */
html#v8[data-payments="k"] #app .pk-c-d { display: flex; align-items: center; gap: var(--v8-3); }
html#v8[data-payments="k"] #app .pk-mk { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: var(--v8-r-tag); }
html#v8[data-payments="k"] #app .pk-mk svg.i { width: 16px; height: 16px; overflow: visible; }
html#v8[data-payments="k"] #app .pk-mk svg.i :is(path, g > path) { stroke: currentColor; stroke-width: 1px; stroke-linejoin: round; paint-order: stroke; }
html#v8[data-payments="k"] #app .pk-mk-ok { background: var(--v8-mint); color: var(--v8-green-t); }
html#v8[data-payments="k"] #app .pk-mk-wait { background: var(--v8-blue); color: var(--v8-blue-ink); }
html#v8[data-payments="k"] #app .pk-mk-late { background: color-mix(in srgb, var(--v8-red) 10%, var(--v8-white)); color: var(--v8-red); }

/* Invoices to pay: the number is the link (the row holds Copy buttons, so it is not one target); its own hover underlines it */
@media (hover: hover) { html#v8[data-payments="k"] #app .pk-r-open .pk-a:hover { color: var(--v8-deep); text-decoration-line: underline; } }
html#v8[data-payments="k"] #app .pk-a:focus-visible { outline: var(--v8-focus) !important; outline-offset: 0 !important; border-radius: 4px; box-shadow: var(--v8-focus-glow) !important; }
/* Paid invoices: the number's link covers the row, one target, the green wash; the tile turns white */
html#v8[data-payments="k"] #app .pk-r-paid .pk-a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
html#v8[data-payments="k"] #app .pk-r-paid .pk-a:focus-visible { outline: none !important; }
@media (hover: hover) { html#v8[data-payments="k"] #app .pk-r-paid:has(.pk-a:hover) { background: var(--v8-hover); } html#v8[data-payments="k"] #app .pk-r-paid:has(.pk-a:hover) .pk-a { color: var(--v8-deep); text-decoration-line: underline; } }
html#v8[data-payments="k"] #app .pk-r-paid:has(.pk-a:focus-visible) { background: var(--v8-hover); outline: var(--v8-focus) !important; outline-offset: -2px !important; box-shadow: var(--v8-focus-glow-in) !important; }
html#v8[data-payments="k"] #app .pk-r-paid:has(.pk-a:active) { background: var(--v8-pressed); }
/* The row's cue, "View invoice" (README 109): the system's chip, at the row's end; it takes the chip's hover look with the row, and
   the pointer passes through it to the row's link */
html#v8[data-payments="k"] #app .pk-c-v { display: flex; justify-content: flex-end; }
html#v8[data-payments="k"] #app .pk-cue { pointer-events: none; }
/* The cue darkens with its row by base.css's one rule (README 111) */

/* The foot of Paid invoices: the year's total on the Amount column */
html#v8[data-payments="k"] #app .pk-tot { max-width: none; margin: 0; padding-top: var(--v8-4); padding-bottom: var(--v8-4); border-top: 1px solid var(--v8-line); }
html#v8[data-payments="k"] #app .pk-box .pk-tot b { font-weight: 700 !important; }

/* The year's radio pair sits 16 above the box */
html#v8[data-payments="k"] #app .v8-pay-paid .v8-pay-yrs { margin-bottom: var(--v8-4); }

/* ---------- Narrower boxes ---------- */
/* Paid invoices under 760 (a 1024 window): the invoice across the top, Status and Amount side by side under it; "Invoice" in the
   band is for screen readers there (the invoice runs across the row) */
@container pk (max-width: 759px) {
  html#v8[data-payments="k"] #app .pk-box { --pk-gap: var(--v8-4); }
  html#v8[data-payments="k"] #app .pk-r { row-gap: var(--v8-3); }
  html#v8[data-payments="k"] #app .pk-paid :is(.pk-h, .pk-r, .pk-tot) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 124px; }
  html#v8[data-payments="k"] #app .pk-paid .pk-r .pk-c-n { grid-column: 1 / -1; }
  html#v8[data-payments="k"] #app .pk-paid .pk-h .pk-c-n { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  html#v8[data-payments="k"] #app .pk-paid .pk-tot { grid-template-columns: minmax(0, 1fr) auto; }
  html#v8[data-payments="k"] #app .pk-paid .pk-h .pk-c-v { display: none; }
}
/* Invoices to pay, once the six columns no longer fit on one line (under 1000: a window under about 1434): no band (screen readers
   keep the heads), the invoice across the top, the cells under it in two columns, each value with its label under it, as the boxed
   facts stack; the account number takes the row's width */
@container pk (max-width: 999px) {
  html#v8[data-payments="k"] #app .pk-open .pk-hg { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  html#v8[data-payments="k"] #app .pk-open .pk-b > .pk-r:first-child { border-radius: calc(var(--v8-r-sm) - 1px) calc(var(--v8-r-sm) - 1px) 0 0; }
  html#v8[data-payments="k"] #app .pk-open .pk-b > .pk-r:only-child { border-radius: calc(var(--v8-r-sm) - 1px); }
  html#v8[data-payments="k"] #app .pk-open .pk-r { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; row-gap: var(--v8-4); padding-top: var(--v8-5); padding-bottom: var(--v8-5); }
  html#v8[data-payments="k"] #app .pk-open .pk-r > :is(.pk-c-n, .pk-c-a) { grid-column: 1 / -1; }
  html#v8[data-payments="k"] #app .pk-open .pk-c:not(.pk-c-n, .pk-c-d) { display: flex; flex-direction: column; }
  html#v8[data-payments="k"] #app .pk-open .pk-lab { display: block; color: var(--v8-ink-2); }
  html#v8[data-payments="k"] #app .pk-open .pk-c-d { min-height: 24px; }
}
/* Under 560 (phones): Paid invoices lose the band too, Status and Amount on one line under the invoice */
@container pk (max-width: 559px) {
  html#v8[data-payments="k"] #app .pk-box { --pk-px: var(--v8-4); }
  html#v8[data-payments="k"] #app .pk-hg { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  html#v8[data-payments="k"] #app .pk-b > .pk-r:first-child { border-radius: calc(var(--v8-r-sm) - 1px) calc(var(--v8-r-sm) - 1px) 0 0; }
  html#v8[data-payments="k"] #app .pk-paid .pk-b > .pk-r:only-child { border-radius: calc(var(--v8-r-sm) - 1px); }
  html#v8[data-payments="k"] #app .pk-paid .pk-r-paid { grid-template-columns: minmax(0, 1fr) auto; padding-top: var(--v8-5); padding-bottom: var(--v8-5); }
  html#v8[data-payments="k"] #app .pk-r-paid .pk-c-p { grid-column: 2; grid-row: 2; }
  html#v8[data-payments="k"] #app .pk-r-paid .pk-c-d { grid-column: 1; grid-row: 2; }
  html#v8[data-payments="k"] #app .pk-r-paid .pk-c-v { grid-column: 1; grid-row: 3; justify-content: flex-start; }
  html#v8[data-payments="k"] #app .pk-a { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) { html#v8[data-payments="k"] #app .pk-r { transition: none; } }
@media (forced-colors: active) {
  html#v8[data-payments="k"] #app .pk-box { border-color: CanvasText; }
  html#v8[data-payments="k"] #app .pk-h { border-bottom: 1px solid CanvasText; }
  html#v8[data-payments="k"] #app .pk-mk { border: 1px solid CanvasText; }
  html#v8[data-payments="k"] #app .pk-sb { color: ButtonText; }
}

/* ---------- The rest of the page under the flag ---------- */
/* For your bookkeeping: no underlined links in a card (README 63.6); the wash and an underline come with the hover */
html#v8[data-payments="k"] #app section:has(#pay-books) .v8-rows-l { text-decoration: none; }
/* An invoice page's Payment details: a white box with the thin line, 8 corners (white rather than gray, README 63.1) */
html#v8[data-payments="k"] #app .v8-pay-box { border: 1px solid var(--v8-line); border-radius: var(--v8-r-sm); background: var(--v8-white); }
/* Phones: with two stacked actions the small town (52 high) stood in the 32 above the strip and covered Set up e-invoicing (a
   shared hero defect, seen without the flag too). Here the town steps out on phones; the buttons and the strip say it all */
@media (max-width: 639px) {
  html#v8[data-payments="k"] #app .v8-hero-lean:has(.v8-hero-acts > :nth-child(2)) .v8-town-s { display: none; }
}
/* An invoice page's Payment details holds a list of facts: a page section title, 24 Bold ink (30 October 2026) */
html#v8[data-payments="k"] #app section:has(> .v8-sh #pay-det) h2.v8-h2 { color: var(--v8-ink); font-size: var(--v8c-fs-24, 24px) !important; line-height: var(--v8c-lh-24, 32px) !important; font-weight: 700 !important; letter-spacing: 0; }

/* ---------- An invoice page's Payment details as boxed facts (README 109) ----------
   Four facts, each one line with its Copy: the account number gets the widest cell so it never breaks. Side by side from a 1280
   window, stacked with hairlines across below it (the boxed facts' phone layout) */
html#v8[data-payments="k"] #app section:has(> .v8-sh #pay-det) .v8-fbox-v { white-space: nowrap; }
/* push: also answers to the page area's width (branch ai-drawer README, the push layout) */
@media (min-width: 1280px) { @container app (min-width: 1280px) { html#v8[data-payments="k"] #app section:has(> .v8-sh #pay-det) .v8-fbox { grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.8fr) minmax(0, 1.2fr) minmax(0, 1fr); } } }
@media (max-width: 1279px) {
  html#v8[data-payments="k"] #app section:has(> .v8-sh #pay-det) .v8-fbox { grid-template-columns: minmax(0, 1fr); }
  html#v8[data-payments="k"] #app section:has(> .v8-sh #pay-det) .v8-fbox > li + li { border-left: 0; border-top: 1px solid var(--v8-line); }
}
/* push: also answers to the page area's width (branch ai-drawer README, the push layout) */
@container app (max-width: 1279px) {
  html#v8[data-payments="k"] #app section:has(> .v8-sh #pay-det) .v8-fbox { grid-template-columns: minmax(0, 1fr); }
  html#v8[data-payments="k"] #app section:has(> .v8-sh #pay-det) .v8-fbox > li + li { border-left: 0; border-top: 1px solid var(--v8-line); }}
/* ---------- A paid row: only "View invoice" is a link (README 148) ----------
   Janne, 22 October 2026: rows with a button hover only on the button ("That should be the general rule"). The invoice's number is
   plain ink text, the row has no hover, and the chip is a real link with the chip's own hover, press and focus ring */
html#v8[data-payments="k"] #app .pk-box .pk-c .pk-nt { justify-self: start; color: var(--v8-ink); font-weight: 700 !important; }
html#v8[data-payments="k"] #app .pk-view { white-space: nowrap; }
/* The paid invoices' year as a pick list (README 155): the system's select, as wide as a year needs, above the table */
html#v8 #app .v8-pay-yrs .v8-field { max-width: 200px; margin-bottom: var(--v8-4); }
/* What this invoice covers: the policy in ink, View policy at the cell's end (README 156) */
html#v8 #app .v8-pay-pc { display: flex; align-items: center; justify-content: space-between; gap: var(--v8-4); }
html#v8 #app .v8-pay-pc .v8-pay-ln > span:first-child { color: var(--v8-ink); }
html#v8 #app .v8-pay-vp { flex: none; white-space: nowrap; }
@media (max-width: 599px) { html#v8 #app .v8-pay-pc { flex-direction: column; align-items: flex-start; gap: var(--v8-2); } }
