/* Generated from products/design-system/shared/invoice-document by Navorina/scripts/sync-ds-invoice-document.mjs. Do not edit. */
/* Invoice document (nv-o-invoice): the one source of the invoice sheet look for the DS catalog and the
   product. Markup: shared/invoice-document.js. The product gets a byte-identical copy in
   css/components/nv-invoice-document.css via Navorina/scripts/sync-ds-invoice-document.mjs; edit this file only.

   One calm surface, no outlines and no rules between rows: hierarchy comes from type roles and space.
     grid       two columns on every section: the main column and the 360 px aside on the right. To, the
                Qty · Price · Tax · Total columns and the totals all start on the aside line and end on the sheet
                edge, so the right edge of Total is the right edge of every amount.
     sheet      island radius · --nv-invoice-pad 48 px (24 px under 560 px of sheet width) · up to 820 px wide
     head       title 1 "Invoice", meta lines "Label: value" in footnote under it, logo or initial 40 px on the
                right, centred on the title line
     sections   40 px apart (32 px narrow)
     headings   footnote 500, tertiary (From, To, Payment details, the table head)
     labels     callout, secondary (Invoice no, Recipient, Subtotal)
     values     body or callout, primary and secondary; numbers tabular
     items      plain muted head row; under 560 px each line stacks: description, then qty · price · tax and amount
     Total      numeric display (numeric title when narrow)
     placeholder quaternary text: the empty case and the editor
   Accent (data-accent, I8): a calm preset tints the title, the initial plate and Total, mixed a quarter with the
   text colour so it reads on light and dark sheets alike; graphite (no attribute) is the plain text colour.
   QR: "Scan to pay" sits as a third footer column, 88 px, always dark on white.
   Edge: the island border token (a hairline on light islands, none on dark), never a decorative outline.
   Theme: the sheet follows the page tokens; data-theme="light" | "dark" pins it (PDF, previews). */
@layer components {
  .nv-o-invoice {
    --nv-invoice-sheet: var(--nv-invoice-surface, var(--nv-table-island, var(--dash-card, #121212)));
    --nv-invoice-well: var(--nv-table-well, color-mix(in srgb, #888888 9%, #020203));
    --nv-invoice-text: var(--nv-text-primary, #eeeeee);
    --nv-invoice-secondary: var(--nv-text-secondary, rgb(238 238 238 / .7));
    --nv-invoice-tertiary: var(--nv-text-tertiary, rgb(238 238 238 / .5));
    --nv-invoice-placeholder: var(--nv-text-quaternary, rgb(238 238 238 / .3));
    --nv-invoice-accent: var(--nv-invoice-text);
    --nv-invoice-pad: 48px;
    --nv-invoice-aside: 360px;
    --nv-invoice-col-qty: 72px;
    --nv-invoice-col-price: 120px;
    --nv-invoice-col-tax: 64px;
    --nv-invoice-col-amount: 104px;
    --nv-invoice-gutter: 32px;
    display: block;
    inline-size: 100%;
    max-inline-size: var(--nv-invoice-width, 820px);
    margin-inline: auto;
    border: var(--nv-invoice-edge, var(--nv-table-island-border, 0));
    border-radius: var(--nv-island-radius, 2rem);
    background: var(--nv-invoice-sheet);
    color: var(--nv-invoice-text);
    font-family: var(--nv-font-sans, Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    container: nv-invoice / inline-size;
  }

  .nv-o-invoice[data-theme="dark"] {
    --nv-invoice-edge: 0;
    --nv-invoice-sheet: #121212;
    --nv-invoice-well: color-mix(in srgb, #888888 12%, #121212);
    --nv-invoice-text: #eeeeee;
    --nv-invoice-secondary: rgb(238 238 238 / .7);
    --nv-invoice-tertiary: rgb(238 238 238 / .5);
    --nv-invoice-placeholder: rgb(238 238 238 / .3);
    color-scheme: dark;
  }

  .nv-o-invoice[data-theme="light"] {
    --nv-invoice-edge: 1px solid color-mix(in srgb, #5e5e5e 10%, #ffffff);
    --nv-invoice-sheet: #ffffff;
    --nv-invoice-well: color-mix(in srgb, #5e5e5e 8%, #ffffff);
    --nv-invoice-text: #1a1a1c;
    --nv-invoice-secondary: #4a4a4f;
    --nv-invoice-tertiary: #7c7c80;
    --nv-invoice-placeholder: #aeaeb2;
    color-scheme: light;
  }

  .nv-o-invoice[data-accent="slate"] { --nv-invoice-accent-base: #5b6b8c; }
  .nv-o-invoice[data-accent="sage"] { --nv-invoice-accent-base: #5e7f68; }
  .nv-o-invoice[data-accent="clay"] { --nv-invoice-accent-base: #a06a52; }
  .nv-o-invoice[data-accent="plum"] { --nv-invoice-accent-base: #7d5f86; }
  .nv-o-invoice[data-accent="ocean"] { --nv-invoice-accent-base: #3f7f8a; }
  .nv-o-invoice[data-accent] { --nv-invoice-accent: color-mix(in srgb, var(--nv-invoice-accent-base, var(--nv-invoice-text)) 75%, var(--nv-invoice-text)); }

  .nv-o-invoice__sheet {
    display: grid;
    gap: 40px;
    padding: var(--nv-invoice-pad);
    color: var(--nv-invoice-text);
  }

  /* Resets stay at one class of weight so every part below wins over them and over host page type. */
  .nv-o-invoice :where(p, dl, dt, dd, table, th, td) { margin: 0; }

  .nv-o-invoice__sr {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* Headings (From, To, Payment details, the table head) are 12 px in the light tone; field labels (Invoice no,
     Recipient, Subtotal) are 13 px in the darker one; values are the text colour. */
  .nv-o-invoice .nv-o-invoice__label {
    margin: 0;
    color: var(--nv-invoice-tertiary);
    font-size: var(--nv-type-footnote-size, 12px);
    font-weight: var(--nv-type-weight-medium, 500);
    line-height: var(--nv-type-footnote-line, 16px);
    letter-spacing: var(--nv-type-footnote-tracking, 0);
  }

  /* Head: the document word with the meta lines under it on the left, the logo on the right. */
  .nv-o-invoice__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
  }

  .nv-o-invoice__heading { display: grid; gap: 12px; min-inline-size: 0; }

  .nv-o-invoice__logo {
    display: block;
    max-inline-size: 160px;
    max-block-size: 40px;
    margin-block: -4px;
    object-fit: contain;
    object-position: right top;
  }

  .nv-o-invoice__mark {
    display: inline-grid;
    flex: none;
    inline-size: 48px;
    block-size: 48px;
    margin-block: -8px;
    place-items: center;
    border-radius: 50%;
    background: var(--nv-invoice-well);
    color: var(--nv-invoice-text);
    font-size: 18px;
    font-weight: var(--nv-type-weight-semibold, 600);
    line-height: 1;
  }

  .nv-o-invoice[data-accent] .nv-o-invoice__mark:not(.nv-o-invoice__placeholder) {
    background: color-mix(in srgb, var(--nv-invoice-accent) 16%, var(--nv-invoice-sheet));
    color: var(--nv-invoice-accent);
  }

  .nv-o-invoice__mark.nv-o-invoice__placeholder {
    font-size: var(--nv-type-caption-size, 11px);
    font-weight: var(--nv-type-weight-medium, 500);
  }

  .nv-o-invoice__title {
    color: var(--nv-invoice-accent);
    font-size: var(--nv-type-title-1-size, 24px);
    font-weight: var(--nv-type-title-1-weight, 600);
    line-height: var(--nv-type-title-1-line, 32px);
    letter-spacing: var(--nv-type-title-1-tracking, -.019em);
  }

  /* Meta: one line each, "Label: value", small and quiet under the title. */
  .nv-o-invoice__meta { display: grid; gap: 2px; }

  .nv-o-invoice__meta-item {
    display: flex;
    min-inline-size: 0;
    gap: 6px;
    color: var(--nv-invoice-secondary);
    font-size: var(--nv-type-callout-size, 13px);
    line-height: var(--nv-type-callout-line, 18px);
    letter-spacing: var(--nv-type-callout-tracking, -.003em);
  }

  .nv-o-invoice__meta-item dt { flex: none; white-space: nowrap; }

  .nv-o-invoice__meta-value {
    overflow-wrap: anywhere;
    color: var(--nv-invoice-text);
    font-variant-numeric: var(--nv-type-numeric-figures, tabular-nums lining-nums);
  }

  /* Parties: From in the main column, To on the aside line, over the amounts and the totals. */
  .nv-o-invoice__parties {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--nv-invoice-aside);
    gap: var(--nv-invoice-gutter);
  }

  .nv-o-invoice__party { display: grid; align-content: start; gap: 2px; min-inline-size: 0; }
  .nv-o-invoice .nv-o-invoice__party .nv-o-invoice__label { margin-block-end: 6px; }

  .nv-o-invoice__party-name {
    overflow-wrap: anywhere;
    color: var(--nv-invoice-text);
    font-size: var(--nv-type-headline-size, 15px);
    font-weight: var(--nv-type-headline-weight, 600);
    line-height: var(--nv-type-headline-line, 20px);
    letter-spacing: var(--nv-type-headline-tracking, -.009em);
  }

  .nv-o-invoice__party-line {
    overflow-wrap: anywhere;
    color: var(--nv-invoice-secondary);
    font-size: var(--nv-type-callout-size, 13px);
    line-height: var(--nv-type-callout-line, 18px);
    letter-spacing: var(--nv-type-callout-tracking, -.003em);
  }

  .nv-o-invoice__party-line--address { white-space: pre-line; }

  /* Items: plain muted head row; lines are separated by space only. */
  .nv-o-invoice__items {
    inline-size: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
  }

  /* The number columns add up to the aside: 72 + 120 + 64 + 104 = 360; without tax its 64 px go to the others. */
  .nv-o-invoice__th--qty { inline-size: var(--nv-invoice-col-qty); }
  .nv-o-invoice__th--price { inline-size: var(--nv-invoice-col-price); }
  .nv-o-invoice__th--tax { inline-size: var(--nv-invoice-col-tax); }
  .nv-o-invoice__th--amount { inline-size: var(--nv-invoice-col-amount); }
  .nv-o-invoice__items:not(:has(.nv-o-invoice__th--tax)) .nv-o-invoice__th--qty { inline-size: calc(var(--nv-invoice-col-qty) + 8px); }
  .nv-o-invoice__items:not(:has(.nv-o-invoice__th--tax)) .nv-o-invoice__th--price { inline-size: calc(var(--nv-invoice-col-price) + 16px); }
  .nv-o-invoice__items:not(:has(.nv-o-invoice__th--tax)) .nv-o-invoice__th--amount { inline-size: calc(var(--nv-invoice-col-amount) + var(--nv-invoice-col-tax) - 24px); }

  .nv-o-invoice__th {
    /* The widths above include the padding, so the number columns add up to the aside exactly. */
    box-sizing: border-box;
    padding: 0 12px 8px;
    color: var(--nv-invoice-tertiary);
    font-size: var(--nv-type-footnote-size, 12px);
    font-weight: var(--nv-type-weight-medium, 500);
    line-height: var(--nv-type-footnote-line, 16px);
    text-align: start;
    white-space: nowrap;
  }

  .nv-o-invoice__th:first-child,
  .nv-o-invoice__cell:first-child { padding-inline-start: 0; }
  /* Qty, Price and Tax read from the left: Qty opens them on the axis of To and the totals, each starts where the
     one before ends; Total alone stays on the end edge with the totals under it. */
  .nv-o-invoice__th.nv-o-invoice__cell--num:not(.nv-o-invoice__th--amount),
  .nv-o-invoice__cell.nv-o-invoice__cell--num:not(.nv-o-invoice__cell--amount) { padding-inline-start: 0; text-align: start; }
  .nv-o-invoice__cell--num:not(.nv-o-invoice__cell--amount) input { text-align: start; }
  .nv-o-invoice__th:last-child,
  .nv-o-invoice__cell:last-child { padding-inline-end: 0; }

  .nv-o-invoice__cell {
    padding: 12px;
    vertical-align: top;
    color: var(--nv-invoice-secondary);
    font-size: var(--nv-type-body-size, 14px);
    line-height: var(--nv-type-body-line, 20px);
    letter-spacing: var(--nv-type-body-tracking, -.006em);
  }

  .nv-o-invoice__cell--description { color: var(--nv-invoice-text); }
  .nv-o-invoice__description { display: block; overflow-wrap: anywhere; white-space: pre-line; }

  .nv-o-invoice__cell--num {
    font-variant-numeric: var(--nv-type-numeric-figures, tabular-nums lining-nums);
    text-align: end;
    white-space: nowrap;
  }

  .nv-o-invoice__cell--amount {
    color: var(--nv-invoice-text);
    font-weight: var(--nv-type-weight-medium, 500);
  }

  /* Totals: the aside column under the amounts; Total is the one large number on the sheet. */
  .nv-o-invoice__totals {
    display: grid;
    inline-size: min(100%, var(--nv-invoice-aside));
    justify-self: end;
    gap: 8px;
  }

  .nv-o-invoice__total-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    color: var(--nv-invoice-secondary);
    font-size: var(--nv-type-callout-size, 13px);
    line-height: var(--nv-type-callout-line, 18px);
    letter-spacing: var(--nv-type-callout-tracking, -.003em);
  }

  .nv-o-invoice__total-row dd {
    color: var(--nv-invoice-text);
    font-variant-numeric: var(--nv-type-numeric-figures, tabular-nums lining-nums);
    text-align: end;
    white-space: nowrap;
  }

  .nv-o-invoice__total-row--grand {
    align-items: center;
    margin-block-start: 8px;
    color: var(--nv-invoice-text);
    font-size: var(--nv-type-headline-size, 15px);
    font-weight: var(--nv-type-headline-weight, 600);
    line-height: var(--nv-type-headline-line, 20px);
  }

  .nv-o-invoice__total-row--grand dd {
    font-size: var(--nv-type-numeric-title-size, 22px);
    font-weight: var(--nv-type-weight-semibold, 600);
    line-height: var(--nv-type-numeric-title-line, 28px);
    letter-spacing: var(--nv-type-numeric-title-tracking, -.02em);
  }

  .nv-o-invoice[data-accent] .nv-o-invoice__total-row--grand dd { color: var(--nv-invoice-accent); }

  /* Inclusive tax is only stated: quieter than the rows that add up. */
  .nv-o-invoice__total-row--included,
  .nv-o-invoice__total-row--included dd { color: var(--nv-invoice-tertiary); }

  .nv-o-invoice__total-row--equivalent { justify-content: flex-end; }

  .nv-o-invoice__total-row--equivalent dd {
    color: var(--nv-invoice-tertiary);
    font-size: var(--nv-type-footnote-size, 12px);
    line-height: var(--nv-type-footnote-line, 16px);
    white-space: normal;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    column-gap: 12px;
  }

  .nv-o-invoice__total-row--balance {
    color: var(--nv-invoice-text);
    font-size: var(--nv-type-body-size, 14px);
    font-weight: var(--nv-type-weight-semibold, 600);
    line-height: var(--nv-type-body-line, 20px);
  }

  /* Footer: payment details and the note side by side, stacked when narrow. */
  .nv-o-invoice__footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--nv-invoice-aside);
    gap: var(--nv-invoice-gutter);
  }

  .nv-o-invoice__footer--qr { grid-template-columns: repeat(2, minmax(0, 1fr)) max-content; }

  .nv-o-invoice__block { display: grid; align-content: start; gap: 8px; min-inline-size: 0; }

  .nv-o-invoice__block--qr { grid-column: -2 / -1; justify-items: center; gap: 6px; }

  .nv-o-invoice__qr-code {
    display: block;
    inline-size: 88px;
    block-size: 88px;
    border-radius: 8px;
  }
  .nv-o-invoice__details { display: grid; gap: 4px; }

  .nv-o-invoice__detail {
    display: grid;
    grid-template-columns: minmax(72px, max-content) minmax(0, 1fr);
    gap: 12px;
    font-size: var(--nv-type-callout-size, 13px);
    line-height: var(--nv-type-callout-line, 18px);
    letter-spacing: var(--nv-type-callout-tracking, -.003em);
  }

  .nv-o-invoice__detail dt { color: var(--nv-invoice-secondary); }

  .nv-o-invoice__detail dd {
    overflow-wrap: anywhere;
    color: var(--nv-invoice-text);
    font-variant-numeric: var(--nv-type-numeric-figures, tabular-nums lining-nums);
  }

  .nv-o-invoice__copy {
    overflow-wrap: anywhere;
    color: var(--nv-invoice-secondary);
    font-size: var(--nv-type-callout-size, 13px);
    line-height: var(--nv-type-callout-line, 18px);
    letter-spacing: var(--nv-type-callout-tracking, -.003em);
    white-space: pre-line;
  }

  .nv-o-invoice__copy--parts { display: flex; flex-wrap: wrap; column-gap: 12px; }

  /* A medium sheet (a tablet drawer): the aside narrows to 296 = 64 + 96 + 56 + 80. */
  @container nv-invoice (max-width: 720px) {
    .nv-o-invoice__sheet {
      --nv-invoice-aside: 296px;
      --nv-invoice-col-qty: 64px;
      --nv-invoice-col-price: 96px;
      --nv-invoice-col-tax: 56px;
      --nv-invoice-col-amount: 80px;
    }
  }

  @container nv-invoice (max-width: 560px) {
    .nv-o-invoice__sheet { --nv-invoice-pad: 24px; gap: 32px; }
    .nv-o-invoice__head { gap: 16px; }
    .nv-o-invoice__logo { max-inline-size: 112px; }
    .nv-o-invoice__parties,
    .nv-o-invoice__footer { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .nv-o-invoice__block--qr { grid-column: auto; justify-items: start; }

    /* Lines stack: description on its own row, then qty · price · tax on the left and the amount on the right. */
    .nv-o-invoice__items thead { display: none; }
    .nv-o-invoice__items,
    .nv-o-invoice__items tbody { display: grid; }
    .nv-o-invoice__items tbody { gap: 16px; }
    .nv-o-invoice__row {
      display: grid;
      grid-template-columns: repeat(3, max-content) minmax(0, 1fr);
      align-items: baseline;
      column-gap: 12px;
    }
    .nv-o-invoice__cell { padding: 0; }
    .nv-o-invoice__cell--description { grid-column: 1 / -1; margin-block-end: 2px; }
    .nv-o-invoice__row .nv-o-invoice__cell--num:not(.nv-o-invoice__cell--amount) {
      color: var(--nv-invoice-tertiary);
      font-size: var(--nv-type-footnote-size, 12px);
      line-height: var(--nv-type-footnote-line, 16px);
      text-align: start;
    }
    .nv-o-invoice__row .nv-o-invoice__cell--num:not(.nv-o-invoice__cell--amount)::before { content: attr(data-label) " "; }
    .nv-o-invoice__row .nv-o-invoice__cell--amount { grid-column: -2; }
    .nv-o-invoice__totals { inline-size: 100%; }
  }

  /* Placeholders sit last so they win over every value colour above. */
  .nv-o-invoice .nv-o-invoice__sheet .nv-o-invoice__placeholder { color: var(--nv-invoice-placeholder); }

  /* Skeleton (the composer preview): an empty value is a quiet bar as long as its placeholder word, so the
     sheet keeps its shape and reads as "to be filled" without words. Numeric bars follow their column headings. */
  .nv-o-invoice--skeleton {
    --nv-invoice-bar: color-mix(in srgb, var(--nv-invoice-text) 8%, transparent);
  }
  .nv-o-invoice--skeleton .nv-o-invoice__sheet .nv-o-invoice__placeholder:not(td, .nv-o-invoice__mark) {
    inline-size: fit-content;
    max-inline-size: 100%;
    border-radius: 999px;
    background: var(--nv-invoice-bar);
    color: transparent;
    user-select: none;
  }
  .nv-o-invoice--skeleton .nv-o-invoice__sheet span.nv-o-invoice__placeholder { display: block; }
  .nv-o-invoice--skeleton .nv-o-invoice__sheet td.nv-o-invoice__placeholder {
    position: relative;
    color: transparent;
  }
  .nv-o-invoice--skeleton .nv-o-invoice__sheet td.nv-o-invoice__placeholder::after {
    content: "";
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 0;
    inline-size: min(3.5em, 100%);
    block-size: .9em;
    translate: 0 -50%;
    border-radius: 999px;
    background: var(--nv-invoice-bar);
  }
  .nv-o-invoice--skeleton .nv-o-invoice__sheet td.nv-o-invoice__placeholder.nv-o-invoice__cell--amount::after {
    inset-inline-start: auto;
    inset-inline-end: 0;
  }
  .nv-o-invoice--skeleton .nv-o-invoice__sheet .nv-o-invoice__mark.nv-o-invoice__placeholder { color: transparent; }

  /* Status pill for the page around the sheet. Paid and Overdue carry a soft tone; the rest stay neutral. */
  .nv-o-invoice-status {
    --nv-invoice-status-tone: var(--nv-text-secondary, rgb(238 238 238 / .7));
    display: inline-flex;
    block-size: 24px;
    align-items: center;
    padding-inline: 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--nv-invoice-status-tone) 14%, transparent);
    color: var(--nv-invoice-status-tone);
    font-size: var(--nv-type-footnote-size, 12px);
    font-weight: var(--nv-type-weight-medium, 500);
    line-height: 1;
    white-space: nowrap;
  }

  .nv-o-invoice-status--paid { --nv-invoice-status-tone: var(--nv-feedback-success, #6eb8a0); }
  .nv-o-invoice-status--overdue { --nv-invoice-status-tone: var(--nv-feedback-error, #ef4444); }

  @media print {
    .nv-o-invoice { max-inline-size: none; border: 0; border-radius: 0; }
  }
}
