.commercial-modal{width:min(1180px,calc(100vw - 32px));max-width:1180px}.commercial-workspace{min-width:0;max-height:78vh;overflow:auto;padding:2px 2px 16px}.commercial-tabs{display:flex;flex-wrap:wrap;gap:8px;padding:12px 0 18px;border-bottom:1px solid var(--border,#d8e0e9);margin-bottom:20px}.commercial-tabs .button[aria-current="page"]{background:var(--primary,#175e75);color:var(--surface,#fff);border-color:var(--primary,#175e75)}.commercial-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:16px 0}.commercial-toolbar h3{margin:0}.commercial-workspace section+section{margin-top:30px}.commercial-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:14px 0}.commercial-grid>.full-row{grid-column:1/-1}.commercial-grid label{display:flex;flex-direction:column;gap:6px;min-width:0}.commercial-grid input,.commercial-grid select,.commercial-grid textarea{width:100%;min-width:0}.commercial-workspace fieldset{border:1px solid var(--border,#d8e0e9);border-radius:10px;padding:12px 16px;margin:14px 0;min-width:0}.commercial-workspace legend{font-weight:650;padding:0 6px}.commercial-table-wrap{overflow:auto;border:1px solid var(--border,#d8e0e9);border-radius:10px}.commercial-table-wrap table{width:100%;border-collapse:collapse;font-size:14px}.commercial-table-wrap th,.commercial-table-wrap td{padding:12px;text-align:left;vertical-align:top;border-bottom:1px solid var(--border,#d8e0e9)}.commercial-table-wrap th{font-weight:650;white-space:nowrap;background:var(--surface-subtle,#f3f6f9)}.commercial-table-wrap td small{display:block;color:var(--muted,#637383);margin-top:4px}.commercial-table-wrap td .actions{gap:6px}.commercial-empty{padding:28px;border:1px dashed var(--border,#d8e0e9);border-radius:10px;color:var(--muted,#637383)}.commercial-form-actions{position:sticky;bottom:-16px;background:var(--surface,#fff);border-top:1px solid var(--border,#d8e0e9);padding:14px 0;margin-top:20px}.commercial-totals{font-weight:650;padding:14px;background:var(--surface-subtle,#f3f6f9);border-radius:8px;line-height:1.8}.commercial-checks{display:flex;gap:14px;flex-wrap:wrap}.commercial-checks label{display:flex;flex-direction:row;align-items:center;gap:8px}.commercial-checks input{width:auto}.commercial-error{border:1px solid #bd3c3c;color:#a02b2b;padding:12px;border-radius:8px}.commercial-error[hidden]{display:none}.commercial-workspace [data-no-translate]{overflow-wrap:anywhere}.commercial-workspace .actions{display:flex;flex-wrap:wrap;gap:8px}[data-theme="dark"] .commercial-table-wrap th,[data-theme="dark"] .commercial-totals{background:#202d3c}[data-theme="dark"] .commercial-form-actions{background:#17222e}[data-theme="dark"] .commercial-error{color:#ffb1b1}@media(max-width:680px){.commercial-modal{width:calc(100vw - 16px)}.commercial-grid{grid-template-columns:1fr}.commercial-tabs{flex-wrap:nowrap;overflow:auto;padding-bottom:12px}.commercial-tabs .button{flex:0 0 auto}.commercial-toolbar{align-items:stretch}.commercial-table-wrap th,.commercial-table-wrap td{padding:10px}.commercial-workspace fieldset{padding:10px}.commercial-form-actions{bottom:-16px}.commercial-workspace{max-height:78vh}}

@media(max-width:680px){.commercial-table-wrap{border:0;border-radius:0;overflow:visible}.commercial-table-wrap table,.commercial-table-wrap tbody{display:block}.commercial-table-wrap thead{display:none}.commercial-table-wrap tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border:1px solid var(--border,#d8e0e9);border-radius:10px;margin-bottom:12px;padding:6px}.commercial-table-wrap td{display:flex;flex-direction:column;gap:4px;padding:8px;border:0;min-width:0;overflow-wrap:anywhere}.commercial-table-wrap td::before{content:attr(data-label);font-size:11px;color:var(--muted,#637383);font-weight:650}.commercial-table-wrap td:first-child,.commercial-table-wrap td:last-child{grid-column:1/-1}.commercial-table-wrap td:first-child strong{font-size:14px}.commercial-table-wrap td:last-child .button{flex:1}.commercial-table-wrap td small{margin:0}}

html[data-theme="dark"] .commercial-workspace .commercial-tabs .button[aria-current="page"]{background:#96c2ff;color:#182c43;border-color:#96c2ff}

.commercial-attention{color:#b83b27}html[data-theme="dark"] .commercial-attention{color:#ffb49e}

.commercial-modal:has([data-form="commercial-product"]) { width: min(100%, 86ch); }
[data-form="commercial-product"] .commercial-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 28ch), 1fr)); gap: .75em 1em; margin-block: .75em; }
[data-form="commercial-product"] .commercial-form-actions { margin-top: .8em; padding-block: .7em; }
.commercial-category-field { min-width: 0; font-family: var(--font-brand); }
.commercial-category-field > span { display: block; font-size: .8125rem; font-weight: 650; color: var(--brand-navy); margin-bottom: .45em; }
html[data-theme="dark"] .commercial-category-field > span { color: var(--text); }
[data-commercial-category-picker] { position: relative; }
[data-commercial-category-picker] > summary { cursor: pointer; border: 1px solid var(--line); border-radius: .5em; padding: .65em .8em; background: var(--surface); color: var(--text); font-weight: 600; }
[data-commercial-category-picker] > summary:focus-visible { outline: .15em solid var(--brand-orange); outline-offset: .15em; }
.commercial-category-panel { position: absolute; inset-inline: 0; top: calc(100% + .3em); z-index: 6; display: grid; gap: .5em; padding: .7em; max-block-size: 60dvh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: .5em; box-shadow: var(--shadow); }
.commercial-category-panel .fine { margin: 0; overflow-wrap: anywhere; }
[data-commercial-category-options] { max-block-size: 14em; overflow: auto; overscroll-behavior: contain; }
.commercial-category-option { display: flex; align-items: center; gap: .4em; padding-block: .3em; }
.commercial-category-option > label { flex: 1; flex-direction: row; align-items: center; gap: .5em; overflow-wrap: anywhere; cursor: pointer; }
.commercial-category-option input[type="checkbox"] { width: 1.2em; flex: none; min-height: 1.2em; margin: 0; accent-color: var(--brand-blue); }
.commercial-category-option > .button { flex: 0 1 auto; white-space: normal; }
[data-commercial-category-confirm] { border-top: 1px solid var(--line); padding-top: .6em; overflow-wrap: anywhere; }
[data-commercial-category-confirm][hidden], [data-action="commercial-category-create"][hidden], [data-commercial-category-message]:empty { display: none; }
[data-commercial-category-confirm] p { margin-block: .4em; }
@media (pointer: coarse) {
  [data-commercial-category-picker] > summary, .commercial-category-option > label { min-block-size: 2.75em; }
}

.commercial-page { min-width: 0; }
.commercial-page > .muted { margin: 0; }
.commercial-page .commercial-workspace { max-height: none; overflow: visible; padding: 0; }
.commercial-page .commercial-tabs { gap: .5rem; padding-block: .75rem; margin-bottom: .75rem; border-color: var(--line); }
.commercial-page .commercial-tabs .button[aria-current="page"] { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); }
.commercial-page .commercial-toolbar { margin-block: .75rem; }
.commercial-page .commercial-table-wrap, .commercial-page .commercial-empty { border-color: var(--line); border-radius: .5rem; }
.commercial-page .commercial-table-wrap th, .commercial-page .commercial-table-wrap td { padding: .65rem; border-color: var(--line); }
.commercial-page .commercial-table-wrap th { background: var(--surface-soft); }
.commercial-page .commercial-empty { padding: 1rem; }
.commercial-page .commercial-workspace section + section { margin-top: 1.25rem; }
.commercial-page .commercial-tabs { flex-wrap: wrap; overflow: visible; }
.commercial-page .commercial-tabs .button { flex: 0 1 auto; min-width: 0; white-space: normal; overflow-wrap: anywhere; }

.commercial-bank-accounts { min-width: 0; }
.commercial-bank-accounts h3 { margin-block: .75em .5em; }
.commercial-bank-accounts form { gap: 1em; }
.commercial-bank-accounts [data-bank-account-rows] { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30em), 1fr)); gap: 1em; }
.commercial-bank-accounts [data-bank-account-row] { margin: 0; padding: 1em; border-color: var(--line); border-radius: .5rem; }
.commercial-bank-accounts [data-bank-account-row] .form-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18ch), 1fr)); gap: .75em 1em; }
.commercial-bank-accounts .fine { margin: 0; }

.accounting-customer-toolbar { gap: .6em 1em; }
.commercial-product-toolbar { gap: .5em .8em; }
.commercial-product-search { display: flex; flex: 0 1 auto; flex-wrap: wrap; align-items: center; gap: .4em .6em; margin-inline-start: auto; min-width: 0; font-family: var(--font-brand); }
.commercial-product-search input { flex: 1 1 26ch; width: 36ch; max-width: 100%; min-width: 0; }
.commercial-product-count { margin-block: .4em; }
.commercial-product-link { font: inherit; text-align: start; }
.product-overview { min-width: 0; }
.product-overview-header { border-bottom: 1px solid var(--line); padding-block-end: .9em; }
.product-overview-header .commercial-toolbar { align-items: flex-start; }
.product-overview-identity { min-width: 0; flex: 1 1 24ch; overflow-wrap: anywhere; }
.product-overview-identity > .fine { margin-block: 0 .35em; }
.product-overview-header .actions { flex: 0 1 auto; }
.product-overview-header .button { white-space: normal; }
.product-overview-description { white-space: pre-wrap; overflow-wrap: anywhere; margin-block: .6em .9em; }
.product-overview .product-overview-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14ch), 1fr)); gap: .75em 1.25em; }
.product-overview-filters { display: flex; flex-wrap: wrap; align-items: end; gap: .65em .85em; margin-block: 1em .4em; }
.product-overview-filters label { display: flex; flex: 0 1 12em; flex-direction: column; gap: .3em; min-width: 0; }
.product-overview-filters .product-overview-search { flex: 1 1 26ch; }
.product-overview-filters input { width: 100%; min-width: 0; }
.product-overview-filters .actions { flex: 0 1 auto; }
.product-overview-load-status { min-block-size: 1.4em; margin-block: .3em; }
.product-overview-metrics dd > span, .product-overview-quantity > span { display: block; }
.product-overview-metrics small { color: var(--muted); margin-top: .4em; }
.product-overview-explanations { display: flex; flex-wrap: wrap; gap: .7em 1.2em; margin-block: .75em; }
.product-overview-explanations details { flex: 1 1 28ch; min-width: 0; }
.product-overview-explanations summary { color: var(--brand-blue); cursor: pointer; }
.product-overview-explanations p { font-size: .9em; line-height: 1.6; }
.product-overview-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13em), 1fr)); gap: .7em; margin-block: .5em; }
.product-overview-months > div { padding: .5em .7em; border: 1px solid var(--line); border-radius: .4em; }
.product-overview-months dt { color: var(--muted); font-size: .8em; }
.product-overview-months dd { margin: .3em 0; font-weight: 700; }
.product-month-bar { display: block; width: var(--product-month-share); height: .25em; background: var(--brand-blue); border-radius: .2em; }
.product-overview-invoices .commercial-toolbar { gap: .4em 1em; }
.product-overview :is(.product-overview-invoices, .product-overview-filters) { scroll-margin-block-start: 5em; }
.product-overview-invoices .commercial-toolbar > .fine { margin: 0; }
.product-overview-invoices .commercial-table-wrap :is(th, td) { padding: .45em .65em; vertical-align: middle; }
.product-overview-invoices .product-overview-money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.product-overview-pagination, .product-overview-pagination > div { flex-wrap: wrap; gap: .5em; }
.product-overview-pagination .button { white-space: normal; }
.product-overview :is(input, summary):focus-visible { outline: .15em solid var(--brand-orange); outline-offset: .15em; }
@media (max-width: 42em) {
  .product-overview-filters label { flex-grow: 1; }
  .product-overview-filters .actions { flex-wrap: wrap; }
  .product-overview-invoices .commercial-table-wrap td:nth-child(3) { grid-column: 1 / -1; }
}
@media print {
  .product-overview-header .actions, .product-overview-filters, .product-overview-pagination .button, .product-overview-load-status { display: none; }
}
[data-commercial-products] .commercial-table-wrap :is(th, td) { padding: .35em .65em; vertical-align: middle; }
[data-commercial-products] .commercial-product-description { color: var(--muted); }
.commercial-column-hint { margin-block: .4em; }
.commercial-column-resize { display: none; }
@media screen and (min-width: 681px) {
  [data-commercial-products] .commercial-table-wrap td { white-space: nowrap; }
  [data-commercial-product-table] th { position: relative; padding-inline-end: 1.6em !important; }
  [data-commercial-product-table][data-sized] { table-layout: fixed; width: var(--commercial-table-width); }
  [data-commercial-product-table][data-sized] :is(th, td) { white-space: normal; overflow-wrap: anywhere; }
  [data-commercial-product-table][data-sized] .button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .commercial-column-resize { display: block; position: absolute; inset-block: 0; inset-inline-end: 0; width: 1.1em; min-height: 1.8em; cursor: col-resize; touch-action: none; user-select: none; }
  .commercial-column-resize::after { content: ""; position: absolute; inset-block: 20%; inset-inline-start: 50%; border-inline-start: .12em solid var(--line); }
  .commercial-column-resize:is(:hover, :focus-visible)::after { border-color: var(--brand-orange); }
  .commercial-column-resize:focus-visible { outline: .15em solid var(--brand-orange); outline-offset: -.15em; }
  .commercial-column-resizing, .commercial-column-resizing * { cursor: col-resize !important; user-select: none; }
}
@media (max-width: 680px) {
  [data-commercial-products] .commercial-product-description { grid-column: 1 / -1; }
  [data-commercial-product-table] colgroup, .commercial-column-hint, [data-action="commercial-product-columns-reset"] { display: none; }
}
[data-commercial-products] [hidden] { display: none !important; }
[data-commercial-product-pagination], [data-commercial-product-pagination] > div { flex-wrap: wrap; gap: .5em; }
.commercial-product-toolbar .button, [data-commercial-product-pagination] .button { white-space: normal; }
@media (max-width: 42em) {
  .commercial-product-search { order: 1; flex: 1 1 100%; margin-inline-start: 0; }
  .commercial-product-search input { width: auto; }
}
@media print {
  .commercial-product-toolbar, [data-commercial-product-pagination], .commercial-column-hint { display: none; }
}
.accounting-customer-search { display: flex; flex: 1 1 24em; flex-wrap: wrap; align-items: center; gap: .35em .7em; min-width: 0; }
.accounting-customer-search input { flex: 1 1 16em; min-width: 0; width: auto; }
.accounting-customers > .fine { margin-block: .4em .7em; }
.accounting-customer-list { max-width: 100%; overflow: auto; }
.accounting-customer-list table { width: 100%; border-collapse: separate; border-spacing: 0; }
.accounting-customer-list :is(th, td) { padding: .3em .6em; white-space: nowrap; vertical-align: middle; border-bottom: 1px solid var(--line); }
.accounting-customer-list th { background: var(--surface-soft); }
.accounting-customer-list td { background: var(--surface); }
.accounting-customer-list :is(.pill, .button, .accounting-overview-link) { white-space: nowrap; }
.accounting-customer-list .accounting-overview-link { min-block-size: 2.3em; }
.accounting-customer-list :is(th, td):last-child { position: sticky; right: 0; text-align: end; border-left: 1px solid var(--line); }
.accounting-customer-list:focus-visible { outline: .15em solid var(--brand-orange); outline-offset: .15em; }
@media (max-width: 42em) {
  .commercial-page .accounting-customer-toolbar { align-items: center; }
  .accounting-customer-toolbar > .button { margin-inline-start: auto; }
  .accounting-customer-search { order: 1; flex-basis: 100%; }
}
@media (pointer: coarse) {
  .accounting-customer-list :is(.button, .accounting-overview-link) { min-block-size: 2.75em; }
}
.accounting-overview-link {
  color: var(--brand-blue);
  font-family: var(--font-brand);
  text-decoration: underline;
  text-underline-offset: .18em;
  padding-block: .3em;
  overflow-wrap: anywhere;
}
.accounting-overview-link:focus-visible { outline: .15em solid var(--brand-orange); outline-offset: .15em; }
.modal:has(> .accounting-reference-overview) { width: 100%; padding: .8rem; }
.modal > .accounting-reference-header { margin-bottom: .4em; }
.accounting-reference-overview { min-width: 0; }
.accounting-reference-header { flex-wrap: wrap; }
.accounting-reference-header > .accounting-metric-actions { flex: 0 1 auto; flex-wrap: wrap; gap: .5em; }
.accounting-reference-header > div { min-width: 0; flex: 1 1 14em; overflow-wrap: anywhere; }
.accounting-reference-overview > .fine { margin: .25em 0; }
.accounting-reference-overview .accounting-party-payments li { flex-wrap: wrap; padding-block: .4em; }
.accounting-reference-overview .task-table-scroll { max-width: 100%; }
.accounting-overview-totals { display: flex; flex-wrap: wrap; gap: .5em 1.1em; margin-block: .6em; }
.accounting-overview-totals > div { flex: 1 1 auto; }
.accounting-overview-totals dt { color: var(--muted); font-size: .85em; }
.accounting-overview-totals dd { margin: .15em 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.accounting-reference-overview .task-pagination { flex-wrap: wrap; gap: .5em; padding-top: .4em; }
.accounting-reference-overview .accounting-party-overview { display: flex; flex-wrap: wrap; gap: .75em 1.25em; padding: .65em 0 0; }
.accounting-reference-overview .accounting-party-receivables { flex: 2 1 26em; min-width: 0; }
.accounting-reference-overview .accounting-party-payments { flex: 1 1 18em; min-width: 0; border: 0; padding: 0; }
.accounting-reference-overview .accounting-party-overview h3 { margin-bottom: .4em; }
.accounting-reference-overview .accounting-party-table :is(th, td) { padding: .4em .55em; }
.accounting-reference-overview .accounting-party-name > strong { font-size: .9em; color: var(--muted); }
.accounting-reference-overview .accounting-party-name > span { margin-top: .1em; }
.accounting-reference-overview .accounting-party-overview p { margin-block: .4em; }
.accounting-reference-overview .accounting-party-note { flex-basis: 100%; }

/* Claim groups use the same responsive invoice workspace as other overviews. */
.accounting-claim-overview.accounting-reference-overview .accounting-damage-summary { display: flex; flex-wrap: wrap; }
.accounting-claim-overview.accounting-reference-overview .accounting-damage-identity { flex: 2 1 18em; }
.accounting-claim-overview.accounting-reference-overview .accounting-damage-metric { flex: 1 1 auto; overflow-wrap: normal; }
.accounting-claim-overview.accounting-reference-overview .accounting-damage-metric > strong { white-space: nowrap; }
.accounting-claim-overview.accounting-reference-overview .accounting-party-table tr { grid-template-columns: repeat(auto-fit, minmax(min(100%, 10em), 1fr)); }
.accounting-claim-overview.accounting-reference-overview .accounting-party-table td:not(:first-child) { white-space: nowrap; overflow-wrap: normal; }
.accounting-claim-overview.accounting-reference-overview .accounting-party-mobile-label { white-space: normal; }
.accounting-claim-overview.accounting-reference-overview .task-pagination .button { min-inline-size: 2.75em; min-block-size: 2.75em; }

.accounting-workspace [data-action="accounting-metric-details"] {
  font-family: var(--font-brand);
  text-align: left;
  cursor: pointer;
  min-width: 0;
  white-space: normal;
}
.accounting-workspace button.accounting-kpi { background: var(--surface); }
.accounting-workspace [data-action="accounting-metric-details"]:hover { box-shadow: inset 0 0 0 1px var(--brand-blue); }
.accounting-workspace [data-action="accounting-metric-details"]:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
.accounting-metric-details .task-pagination .button { min-inline-size: 2.75em; min-block-size: 2.75em; }
html[data-theme="dark"] body:has(.layout) .accounting-metric-details .accounting-invoices-table .task-row:nth-child(n) { background: var(--surface); }
/* Tools have their own footer; pagination can use the available width. */
#accounting-customer-results .task-pagination { justify-content: flex-start; flex-wrap: wrap; gap: .75rem 1.25rem; }
#accounting-customer-results .task-pagination .button { min-inline-size: 2.75rem; min-block-size: 2.75rem; }
.modal-backdrop:has(> .modal > .accounting-customer-form) { padding: clamp(.5rem, 2vw, 1.25rem); }
.modal:has(> .accounting-customer-form) { width: min(100%, 88rem); max-height: calc(100dvh - 2.5rem); display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.modal:has(> .accounting-customer-form) > header { flex: 0 0 auto; align-items: center; margin: 0; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.modal:has(> .accounting-customer-form) > header h2 { margin: 0; }
.accounting-customer-form { display: flex; flex-direction: column; min-height: 0; gap: 0; }
.accounting-customer-form-body { display: grid; gap: .8em; padding: .8rem 1rem; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.accounting-customer-form-body > .fine { margin: 0; }
.accounting-customer-form fieldset { display: grid; gap: .65em; min-width: 0; margin: 0; padding: .7em; border: 1px solid var(--line); }
.accounting-customer-form fieldset > .fine { margin: 0; }
.accounting-customer-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 28rem), 1fr)); align-items: start; gap: .8em; }
.accounting-customer-section-stack { display: grid; gap: .8em; min-width: 0; }
.accounting-customer-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16em), 1fr)); gap: .65em 1em; }
.accounting-customer-fields label { min-width: 0; display: grid; align-content: start; gap: .25em; }
.accounting-customer-fields :is(input, select, textarea) { width: 100%; min-width: 0; }
.accounting-customer-note { min-width: 0; margin: 0; }
.accounting-customer-note textarea { width: 100%; min-width: 0; min-block-size: 4.5em; max-block-size: 35dvh; field-sizing: content; resize: vertical; font-family: var(--font-brand); }
.accounting-customer-fields:is(.accounting-customer-identity, .accounting-customer-address, .accounting-customer-billing-options) { display: flex; flex-wrap: wrap; }
.accounting-customer-fields:is(.accounting-customer-identity, .accounting-customer-address, .accounting-customer-billing-options) > label { flex: 1 1 12em; }
.accounting-customer-identity > label:has([name="name"]), .accounting-customer-address > label:has([name="street"]) { flex: 2 1 18em; }
.accounting-customer-identity > label:has([name="customerNo"]) { flex: 1 1 16em; }
.accounting-customer-address > label:has([name="postalCode"]) { flex: .65 1 8em; }
.accounting-customer-identity > label:has([name="accountingActive"]) { flex: 0 1 10em; }
.accounting-customer-form > .actions { flex: 0 0 auto; margin: 0; padding: .7rem 1rem; border-top: 1px solid var(--line); }
.accounting-customer-form [data-customer-conflicts]:empty { display: none; }
.accounting-customer-form :is([data-customer-pending-files], .accounting-customer-files):empty { display: none; }
.accounting-customer-upload { display: flex; flex-wrap: wrap; gap: .35em; min-width: 0; }
.accounting-customer-files { list-style: none; margin: 0; padding: 0; display: grid; gap: .4em; }
.accounting-customer-files li { display: flex; flex-wrap: wrap; align-items: center; gap: .35em .7em; min-width: 0; }
.accounting-customer-files li > :first-child { min-width: 0; overflow-wrap: anywhere; }
.accounting-customer-files .button { white-space: normal; text-align: start; }

.accounting-workspace .task-view-toggle { flex-wrap: wrap; max-width: 100%; gap: .25em; }
.accounting-workspace .task-view-toggle .button { flex: 1 1 auto; white-space: normal; min-width: 0; border-radius: .4em; }
html[data-theme="dark"] body:has(.layout) .accounting-workspace .task-view-toggle .button[aria-selected="true"] { background: var(--brand-blue); border-color: var(--brand-blue); color: var(--surface-soft); }

/* Customer finances share the commercial table and adapt to the available space. */
.customer-overview { min-width: 0; font-family: var(--font-brand); }
.customer-overview .commercial-toolbar > div { min-width: 0; overflow-wrap: anywhere; }
.customer-overview .commercial-toolbar p { margin: .35em 0 0; }
.customer-overview-header { padding-block: .25em 1em; border-bottom: 1px solid var(--line); }
.customer-overview .customer-overview-header .commercial-toolbar { margin-block: .2em .85em; align-items: flex-start; }
.customer-overview-identity { flex: 1 1 20em; }
.customer-overview-identity h3 { font-size: 1.4em; line-height: 1.3; }
.customer-overview-identity p { color: var(--muted); font-size: .9em; }
.customer-overview-identity strong { margin-inline-start: .4em; color: var(--ink); font-weight: 400; }
.customer-overview .actions .button { white-space: normal; }
.customer-overview-contact { display: flex; flex-wrap: wrap; gap: .75em 2em; margin: 0; }
.customer-overview-contact > div { flex: 1 1 13em; min-width: 0; }
.customer-overview-contact > div:last-child { flex-grow: 2; }
.customer-overview-contact dt { font-size: .8em; color: var(--muted); margin-bottom: .25em; }
.customer-overview-contact dd { margin: 0; font-size: .9em; overflow-wrap: anywhere; }
.customer-overview-contact > .customer-overview-note { flex-basis: 100%; }
.customer-overview-note dd { white-space: pre-wrap; }
.customer-overview-section-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .3em 1em; margin-block: 1em .6em; }
.customer-overview-section-heading :is(h3, p) { margin: 0; }
.customer-overview-currency + .customer-overview-currency { margin-top: .75em; }
.customer-overview-currency-label { color: var(--muted); font-size: .8em; margin: 0 0 .4em; letter-spacing: .05em; }
.customer-overview-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10em), 1fr)); gap: .7em; margin: 0; }
.customer-overview-metrics > div { display: flex; flex-direction: column; --metric-accent: var(--line); min-width: 0; padding: .8em 1em; border: 1px solid var(--line); border-top: .2em solid var(--metric-accent); border-radius: .5rem; background: var(--surface-soft); }
.customer-overview-metrics > [data-tone="revenue"] { --metric-accent: var(--brand-blue); background: var(--surface-blue); }
.customer-overview-metrics > [data-tone="paid"] { --metric-accent: var(--green); }
.customer-overview-metrics > [data-tone="open"] { --metric-accent: var(--brand-orange); }
.customer-overview-metrics > [data-tone="overdue"] { --metric-accent: var(--red); }
.customer-overview-metrics dt { flex: 1; color: var(--muted); font-size: .85em; }
.customer-overview-metrics dd { margin: .4em 0 0; font-size: clamp(1.2em, 1.5vw, 1.55em); line-height: 1.3; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.customer-overview-metrics > [data-tone="overdue"] dd { color: var(--red); }
.customer-overview-calculation { margin-top: .65em; font-size: .85em; color: var(--muted); }
.customer-overview-calculation summary { cursor: pointer; padding-block: .4em; width: fit-content; max-width: 100%; }
.customer-overview-calculation summary:focus-visible { outline: .15em solid var(--brand-blue); outline-offset: .15em; border-radius: .25em; }
.customer-overview-calculation p { margin: .3em 0 .6em; max-width: 90ch; line-height: 1.6; }
.commercial-page .customer-overview > section + section { margin-top: 1em; }
.customer-overview .customer-overview-series-empty { padding: .8em 1em; border: 1px solid var(--line); border-radius: .5rem; background: var(--surface-soft); }
.customer-overview .customer-overview-series-empty .commercial-toolbar { margin: 0; }
.customer-overview-count { display: inline-block; padding: .2em .5em; margin-inline-start: .65em; background: var(--surface-soft); border: 1px solid var(--line); border-radius: .35em; font-size: .75em; font-weight: 400; vertical-align: middle; color: var(--muted); }
.customer-overview-filter { display: flex; align-items: center; flex-wrap: wrap; gap: .6em; font-size: .9em; }
.customer-overview-filter > span { color: var(--muted); font-weight: 400; }
.customer-overview-filter select { max-width: 100%; }
.customer-overview .commercial-table-wrap { border-radius: .5rem; }
.customer-overview .commercial-table-wrap :is(th, td) { vertical-align: middle; padding-block: .5em; }
.customer-overview .commercial-table-wrap th { font-weight: 400; color: var(--muted); }
.customer-overview .commercial-table-wrap tbody tr:last-child td { border-bottom: 0; }
.customer-overview .commercial-table-wrap tbody tr:hover { background: var(--surface-soft); }
.customer-overview .commercial-table-wrap .button { padding: .55em .8em; }
.customer-overview .commercial-table-wrap td.customer-overview-money { text-align: right; font-variant-numeric: tabular-nums; }
.customer-overview-invoices th:nth-child(5), .customer-overview-invoices th:nth-child(6), .customer-overview-series th:nth-child(4) { text-align: right; }
.customer-overview .customer-overview-balance { font-weight: 700; }
.customer-overview .customer-overview-settled { color: var(--muted); }
.customer-overview [data-overdue="true"] { color: var(--red); }
.customer-overview .customer-overview-status { --status-ink: var(--muted); padding: .35em .6em; font-size: .85em; font-weight: 400; color: var(--status-ink); background: color-mix(in srgb, var(--status-ink) 9%, var(--surface)); }
.customer-overview-status[data-tone="paid"] { --status-ink: var(--green); }
.customer-overview-status[data-tone="open"] { --status-ink: var(--brand-blue); }
.customer-overview-status[data-tone="overdue"] { --status-ink: var(--red); }
.customer-overview .task-pagination { flex-wrap: wrap; gap: .7em; padding-block: .65em 0; }
.customer-overview .task-pagination > div { display: flex; flex-wrap: wrap; align-items: center; gap: .5em; }
.customer-overview .task-pagination button { white-space: normal; }
@media (max-width: 680px) {
  .customer-overview .commercial-table-wrap tbody tr { border-color: var(--line); border-radius: .5rem; }
  .customer-overview .commercial-table-wrap td.customer-overview-money { text-align: left; }
  .customer-overview .commercial-table-wrap td::before { font-weight: 400; }
}

/* Series editing shares the compact customer workspace and adapts to its content. */
.commercial-modal:has([data-form="commercial-recurring"]) .commercial-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15em), 1fr));
  gap: .65em 1em;
  margin-block: .7em;
}
.commercial-modal:has([data-form="commercial-recurring"]) fieldset {
  border-color: var(--line);
  border-radius: .5rem;
  padding: .7em;
  margin-block: .7em;
}
.customer-overview [data-customer-recurrings] th { white-space: normal; }
.customer-overview [data-customer-recurrings] .actions .button { white-space: normal; }

.modal.commercial-modal { max-inline-size: 100%; min-inline-size: 0; }
.modal.commercial-modal > header > div { min-width: 0; overflow-wrap: anywhere; }
.modal-backdrop:has(> .commercial-modal) { display: flex; justify-content: center; align-items: center; }
.accounting-selection-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5em 1em; padding: .6em 0; font-family: var(--font-brand); }
.accounting-selection-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35em 1em; flex: 1 1 auto; }
.accounting-selection-toolbar .actions { flex-wrap: wrap; margin: 0; }
.accounting-selection-toolbar .button { white-space: normal; }
.accounting-selection-toolbar > p { flex-basis: 100%; margin: 0; }
.accounting-selection-check { display: inline-flex; align-items: center; justify-content: center; padding: .6em; margin: -.25em; cursor: pointer; }
.accounting-selection-check input[type="checkbox"] { appearance: auto; inline-size: 1.15em; block-size: 1.15em; min-height: 0; margin: 0; accent-color: var(--brand-blue); cursor: pointer; }
.accounting-selection-check input:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 3px; }
.accounting-invoice-list { min-width: 0; container: accounting-invoices / inline-size; }
@container accounting-invoices (max-width: 64rem) {
  .accounting-workspace .accounting-invoices-table { display: block; }
  .accounting-workspace .accounting-invoices-table thead { display: none; }
  .accounting-workspace .accounting-invoices-table tbody { display: grid; }
  .accounting-workspace .accounting-invoices-table .task-row,
  .accounting-workspace .accounting-invoices-table .task-row:is(:hover, :focus-within) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12em), 1fr));
    gap: .6em 1em;
    padding: .75em;
    background: var(--accounting-row-background);
  }
  .accounting-workspace .accounting-invoices-table .task-row > td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
  }
  .accounting-workspace .accounting-invoices-table .task-row > td::before {
    display: block;
    content: attr(data-label);
    margin-bottom: .2em;
    color: var(--muted);
    font-size: .85em;
    font-weight: 400;
  }
  .accounting-workspace .accounting-invoices-table .task-row + .task-row { border-top: 1px solid var(--line); }
  .accounting-workspace .accounting-invoices-table .accounting-contact-cell { grid-column: 1 / -1; }
  .accounting-workspace .accounting-invoices-table .accounting-selection-cell::before { display: none; }
  .accounting-workspace .accounting-invoices-table .empty-state { display: block; }
}
.accounting-column-settings { margin-block: .5em; font-family: var(--font-brand); }
.accounting-column-settings > summary { width: fit-content; margin-inline-start: auto; color: var(--brand-blue); cursor: pointer; padding: .5em; font-weight: 700; }
.accounting-column-settings > summary:focus-visible { outline: .15em solid var(--brand-orange); outline-offset: .15em; }
.accounting-column-settings > ol { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18em), 1fr)); gap: .4em .8em; padding: 0; list-style: none; }
.accounting-column-settings li { display: flex; align-items: center; justify-content: space-between; gap: .5em; padding: .35em; border-bottom: 1px solid var(--line); min-width: 0; }
.accounting-column-settings li > label { display: flex; align-items: center; gap: .6em; margin: 0; min-width: 0; overflow-wrap: anywhere; cursor: pointer; }
.accounting-column-settings input[type="checkbox"] { appearance: auto; inline-size: 1.15em; block-size: 1.15em; min-height: 0; margin: .4em; flex: none; accent-color: var(--brand-blue); }
.accounting-column-settings li > span { display: flex; gap: .25em; flex: none; }
.accounting-column-settings .button { padding: .55em .8em; }
.accounting-column-settings > .actions { display: flex; flex-wrap: wrap; gap: .5em; }
.accounting-columns-status:empty { display: none; }
.accounting-workspace .accounting-selectable .is-selected > td { box-shadow: inset 0 -2px var(--brand-blue); }
.accounting-selection-progress { padding: .5em .75em; margin: 0; border-inline-start: .2em solid var(--brand-orange); background: var(--surface-soft); }

/* Invoice workspace: use the available width; keep the header and financial actions in view. */
.modal-backdrop:has(> .accounting-entry-modal) { --invoice-gutter: clamp(.5em, 1.5vw, 1.5em); padding: var(--invoice-gutter); }
.modal.accounting-entry-modal { display: flex; flex-direction: column; width: 100%; max-width: 100%; max-height: calc(100dvh - 2 * var(--invoice-gutter)); padding: 0; overflow: hidden; font-family: var(--font-brand); container-type: inline-size; }
.accounting-entry-modal > header { flex: none; background: var(--surface); }
.accounting-entry-modal > header { padding: .7em 1em; margin: 0; align-items: flex-start; border-bottom: 1px solid var(--line); }
.accounting-editor-title { display: flex; align-items: center; flex-wrap: wrap; gap: .8em; }
.accounting-entry-modal > header > div { min-width: 0; }
.accounting-editor-title h2 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.accounting-editor-title .pill { background: var(--surface-soft); color: var(--muted); font-size: .72rem; }
.accounting-entry-modal > header p { margin: .2em 0 0; }
.accounting-entry-modal > header .icon-button { flex: none; background: var(--surface-soft); color: var(--text); border: 1px solid var(--line); }
.accounting-manual-form { display: flex; flex-direction: column; gap: 0; min-width: 0; min-height: 0; margin: 0; }
.accounting-editor-scroll { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scroll-padding-block: 1em; }
.accounting-invoice-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 43ch), 1fr)); gap: .75em 1.3em; padding: .35em 1em .7em; }
.accounting-entry-section { min-width: 0; border: 0; padding: 0; }
.accounting-entry-heading { display: flex; align-items: center; gap: .6em; margin-block-end: .4em; }
.accounting-entry-heading h3 { margin: 0; font-size: .95rem; }
.accounting-manual-form .accounting-entry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 23ch), 1fr)); gap: .5em .7em; align-items: start; min-width: 0; }
.accounting-manual-form :is(.accounting-recipient-grid, .accounting-dates-grid) { display: flex; flex-wrap: wrap; align-items: start; gap: .5em .7em; }
.accounting-recipient-grid [data-manual-recipient] { flex: 1 1 100%; }
.accounting-damage-reference { flex: 1.6 1 20ch; }
.accounting-invoice-plate { flex: 1 1 16ch; }
.accounting-reference-field { min-width: 0; display: grid; gap: .25em; }
.accounting-manual-form .accounting-reference-required { display: flex; align-items: center; gap: .4em; width: fit-content; font-weight: 400; font-size: .8rem; color: var(--muted); }
.accounting-manual-form .accounting-reference-required input { inline-size: 1.1em; block-size: 1.1em; min-block-size: 1.1em; margin: 0; accent-color: var(--brand-blue); }
.accounting-dates-grid > label { flex: 1 1 14ch; }
.accounting-dates-grid > .accounting-invoice-title { flex-basis: 100%; }
.accounting-manual-form label { min-width: 0; gap: .25em; }
.accounting-manual-form :is(input, select, textarea) { min-width: 0; max-width: 100%; font-family: var(--font-brand); }
.accounting-manual-form :is(.accounting-entry-fields, .accounting-entry-options fieldset) { border: 0; padding: 0; margin: 0; min-width: 0; }
.accounting-lines-section { border-block: 1px solid var(--line); padding: .7em 1em; background: var(--surface); }
.accounting-entry-fields > .fine { margin-block: .3em .5em; }
.accounting-manual-form .accounting-add-position { display: flex; align-items: center; justify-content: center; gap: .4em; inline-size: 100%; margin-block-start: .35em; padding: .65em; border: 1px dashed var(--line); background: var(--surface-soft); color: var(--brand-blue); }
.accounting-add-position:hover { border-color: var(--brand-blue); }
.accounting-add-position > span { font-size: 1.2em; line-height: 1; }
.accounting-manual-form .accounting-position-list { display: grid; gap: .75em; counter-reset: invoice-line; }
.accounting-position-row { counter-increment: invoice-line; }
.accounting-position-main::before { content: counter(invoice-line, decimal-leading-zero); flex: 0 0 auto; min-inline-size: 2.5ch; align-self: start; padding: .35em .3em; border-radius: .3em; background: var(--brand-blue); color: var(--surface); text-align: center; font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.accounting-manual-form .accounting-position-row { display: block; border: 1px solid color-mix(in srgb, var(--brand-blue) 30%, var(--line)); border-inline-start: .25em solid var(--brand-blue); border-radius: .45em; background: var(--surface-blue); padding: .75em; min-width: 0; }
.accounting-manual-form .accounting-position-row:focus-within { border-color: var(--brand-blue); }
.accounting-position-main { display: flex; flex-wrap: wrap; align-items: start; gap: .5em .75em; min-width: 0; }
.accounting-position-main .accounting-position-service { display: flex; flex-wrap: wrap; gap: .45em .75em; flex: 1 1 40ch; min-width: 0; }
.accounting-position-choice { flex: 1 1 26ch; min-width: 0; }
.accounting-position-service [data-accounting-free-label]:not(:empty) { margin-block-start: .4em; }
.accounting-position-main .accounting-position-quantity { flex: 0 1 8ch; }
.accounting-position-main .accounting-position-price { flex: 0 1 14ch; }
.accounting-position-main .accounting-position-tax { flex: 0 1 10ch; }
.accounting-position-main :is(.accounting-position-quantity, .accounting-position-price) input { text-align: end; font-variant-numeric: tabular-nums; }
.accounting-manual-form .accounting-position-row .accounting-position-total { flex: 0 1 14ch; align-self: start; display: flex; flex-direction: column; justify-content: start; gap: .35em; border: 0; border-radius: 0; background: transparent; min-height: 0; padding: 0; text-align: end; }
.accounting-position-total > span { font-weight: 700; }
.accounting-position-total > strong { display: flex; justify-content: flex-end; align-items: center; flex: 1; min-block-size: 2.4em; font-size: .9rem; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.accounting-manual-form .accounting-position-row .accounting-position-remove { align-self: start; margin-block-start: 1.6em; min-block-size: 2.4em; min-inline-size: 2.4em; padding: .35em; font-size: 1rem; line-height: 1; border-color: transparent; background: transparent; color: var(--muted); }
.accounting-position-remove:hover:not(:disabled) { color: var(--brand-blue); background: var(--surface-soft); }
.accounting-manual-form .accounting-position-additional-description { flex: 1 1 28ch; margin: 0; }
.accounting-manual-form :is(.accounting-position-additional-description textarea, [name="internalNote"]) { field-sizing: content; min-height: 2.6em; line-height: 1.45; resize: vertical; }
.accounting-line-additional-description { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.accounting-manual-form .accounting-position-options { margin-block-start: .4em; }
.accounting-position-options[open] { background: var(--surface-soft); border-radius: .4em; padding: .5em .8em .8em; }
.accounting-position-description { grid-column: 1 / -1; }
.accounting-manual-form :is(.accounting-position-total strong, .accounting-manual-totals strong) { color: var(--text); }
.accounting-entry-options { min-width: 0; margin-block-start: .5em; }
.accounting-entry-options summary { cursor: pointer; color: var(--muted); font-size: .8rem; font-weight: 400; padding-block: .4em; overflow-wrap: anywhere; }
.accounting-entry-options summary:hover { color: var(--brand-blue); }
.accounting-entry-options > :not(summary) { margin-block-start: .6em; }
.accounting-entry-options .commercial-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 23ch), 1fr)); gap: .7em .8em; margin: .6em 0; }
.accounting-entry-options legend { display: none; }
.accounting-entry-options .fine { margin-block: .6em; }
.accounting-attachments-section { padding: .7em 1em; }
.accounting-attachments-section .accounting-entry-heading { flex-wrap: wrap; justify-content: space-between; }
.accounting-entry-extras { padding: .3em 1em; min-width: 0; }
.accounting-entry-extras > .accounting-entry-options { margin-block-start: 0; }
.accounting-position-source-upload { display: flex; align-items: center; flex-wrap: wrap; gap: .5em 1em; margin-block: .35em; padding: .35em; border: 1px dashed transparent; border-radius: .4em; }
.accounting-position-source-upload > .fine { flex: 1 1 30ch; min-width: 0; }
.accounting-position-source-upload.is-dragging { background: var(--surface-blue); border-color: var(--brand-blue); outline: .15em solid var(--brand-blue); outline-offset: .15em; }
.accounting-source-review-layout { display: flex; align-items: start; flex-wrap: wrap; gap: .8em; }
.accounting-source-review-fields { flex: 1 1 42ch; min-width: 0; }
.accounting-source-preview { display: grid; flex: 1 1 42ch; gap: .5em; min-width: 0; }
.accounting-pdf-page { inline-size: 100%; max-block-size: 55dvh; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: .4em; background: var(--surface-soft); }
.accounting-pdf-page:focus-visible { outline: .15em solid var(--brand-orange); outline-offset: .1em; }
.accounting-pdf-page canvas { display: block; }
.accounting-pdf-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .3em; margin-block-end: .35em; }
.accounting-pdf-toolbar > span { flex: 1; text-align: center; font-size: .8rem; font-variant-numeric: tabular-nums; }
.accounting-manual-form .accounting-pdf-toolbar .button { padding: .3em .65em; min-block-size: 2.75em; min-inline-size: 2.75em; }
.accounting-manual-form .accounting-source-fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17ch), 1fr)); }
.accounting-position-row.has-source-invoice .accounting-position-service { flex-basis: 70ch; }
.accounting-attachments-section > .accounting-entry-heading { margin-block-start: .5em; }
.accounting-entry-heading { flex-wrap: wrap; }
.accounting-source-preview > strong { font-size: .85rem; }
.accounting-source-preview .code-link { overflow-wrap: anywhere; }
.accounting-position-row.has-source-invoice .accounting-source-row { margin-block-start: .5em; padding: .7em; background: var(--surface-soft); }
.accounting-manual-form .has-source-invoice :is(.accounting-position-price, .accounting-position-quantity) input { background: var(--surface-soft); }
.accounting-source-file-label { position: relative; flex: 0 1 auto; cursor: pointer; align-self: center; padding: .8em 1em; border: 1px solid var(--line); border-radius: .4em; background: var(--surface); color: var(--brand-blue); text-align: center; }
.accounting-source-file-label:hover { border-color: var(--brand-blue); }
.accounting-source-file-label:focus-within { outline: .15em solid var(--brand-orange); outline-offset: .15em; }
.accounting-source-file-label input { position: absolute; inline-size: 1px !important; block-size: 1px !important; min-block-size: 0 !important; clip-path: inset(50%); overflow: hidden; padding: 0 !important; }
.accounting-manual-form .accounting-source-amounts { margin-block-start: .8em; padding: .8em 0 0; border-top: 1px solid var(--line); gap: .5em; align-items: end; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12ch), 1fr)); }
.accounting-source-amounts input { text-align: end; font-variant-numeric: tabular-nums; }
.accounting-source-row { padding: .9em; border: 1px solid var(--line); border-radius: .5em; background: var(--surface); min-width: 0; }
.accounting-source-heading { display: flex; flex-wrap: wrap; align-items: start; gap: .6em 1em; margin-block-end: .85em; }
.accounting-source-heading > div:first-child { flex: 1 1 25ch; min-width: 0; overflow-wrap: anywhere; }
.accounting-source-heading small { display: block; margin-block-start: .3em; color: var(--muted); font-size: .78rem; }
.accounting-source-heading .actions { margin: 0; flex-wrap: wrap; gap: .45em; }
.accounting-source-heading .button { padding: .55em .75em; }
.accounting-source-feedback { font-size: .85rem; color: var(--brand-blue); overflow-wrap: anywhere; }
.accounting-source-feedback:empty { display: none; }
[data-source-amount-check][data-valid="true"] { color: var(--brand-blue); font-weight: 700; }
.accounting-manual-form .accounting-entry-review { position: relative; flex: none; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: .5em 1.2em; border-top: 1px solid var(--line); background: var(--surface); padding: .65em 1em; min-width: 0; box-shadow: 0 -.2em .8em color-mix(in srgb, var(--brand-navy) 5%, transparent); }
.accounting-manual-form .accounting-manual-totals { display: flex; flex: 1 1 35ch; flex-wrap: wrap; gap: .3em 1.5em; margin: 0; min-width: 0; align-items: start; }
.accounting-manual-form .accounting-manual-totals > div { display: grid; gap: .25em; border: 0; background: transparent; padding: 0; min-width: 0; }
.accounting-manual-totals strong { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.accounting-manual-form .accounting-manual-totals > .accounting-total-payable { padding-inline-start: 1.4em; border-inline-start: 1px solid var(--line); }
.accounting-manual-form .accounting-total-payable strong { font-size: 1.3rem; }
.accounting-vat-details { font-size: .75rem; }
.accounting-vat-details > summary { cursor: pointer; padding-block: .3em; color: var(--muted); }
.accounting-vat-details > summary:focus-visible { outline: .15em solid var(--brand-orange); outline-offset: .1em; }
.accounting-manual-form .accounting-vat-breakdown { display: grid; gap: .3em; margin-block-start: .3em; max-block-size: 20dvh; overflow: auto; overscroll-behavior: contain; overflow-wrap: anywhere; font-size: .75rem; }
.accounting-vat-breakdown:focus-visible { outline: .15em solid var(--brand-orange); outline-offset: .1em; }
.accounting-manual-form .accounting-vat-breakdown span, .accounting-manual-form .accounting-vat-breakdown strong { font-size: inherit; font-weight: 400; }
.accounting-review-actions { display: grid; gap: .35em; min-width: 0; }
.accounting-entry-review .accounting-issue-note { margin: 0; font-size: .72rem; text-align: end; }
.accounting-entry-review .accounting-invoice-feedback { flex-basis: 100%; order: 3; margin: 0; padding: .6em .8em; border-inline-start: .2em solid var(--red); background: var(--surface-soft); color: var(--text); overflow-wrap: anywhere; }
.accounting-entry-review [data-accounting-recharge-summary] { flex-basis: 100%; order: 1; margin: 0; }
.accounting-entry-review .actions { gap: .65em; flex-wrap: wrap; justify-content: flex-end; margin: 0; }
.accounting-entry-review .actions .button { padding: .8em 1.1em; }
.accounting-manual-form .button { white-space: normal; overflow-wrap: anywhere; }
.accounting-manual-form [hidden] { display: none !important; }
.accounting-source-tax-details { margin-block-start: .8em; padding-block-start: .8em; border-top: 1px solid var(--line); }
html[data-theme="dark"] .accounting-manual-form :is(.accounting-source-feedback, [data-source-amount-check][data-valid="true"]) { color: var(--text); }
html[data-theme="dark"] body:has(.layout) .accounting-entry-modal .accounting-manual-form :is(.accounting-entry-fields, .accounting-entry-options fieldset, .accounting-position-total, .accounting-manual-totals > div) { background: transparent; }
html[data-theme="dark"] body:has(.layout) .accounting-entry-modal .accounting-position-remove:disabled { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
@container (max-width: 52em) {
  .accounting-position-main .accounting-position-service { flex-basis: calc(100% - 5ch); }
  .accounting-position-main :is(.accounting-position-quantity, .accounting-position-price, .accounting-position-tax) { flex-grow: 1; }
  .accounting-manual-form .accounting-position-row .accounting-position-total { flex: 1 1 16ch; flex-direction: row; align-items: center; justify-content: flex-end; gap: .7em; }
  .accounting-position-total > strong { flex: none; }
  .accounting-manual-form .accounting-position-row .accounting-position-remove { margin-block-start: 0; }
}
@container (max-width: 35em) {
  .accounting-entry-modal > header { padding: .65em .8em; }
  .accounting-invoice-head, .accounting-lines-section, .accounting-attachments-section, .accounting-entry-extras { padding-inline: .8em; }
  .accounting-entry-review .accounting-issue-note { display: none; }
  .accounting-manual-form .accounting-entry-review { padding: .6em .8em; gap: .5em; }
  .accounting-manual-form .accounting-manual-totals { justify-content: space-between; gap: .4em 1em; }
  .accounting-review-actions { width: 100%; }
  .accounting-entry-review .actions .button { flex: 1 1 12ch; padding-inline: .7em; }
  .accounting-manual-form .accounting-manual-totals > .accounting-total-payable { padding-inline-start: .7em; }
  .accounting-source-heading .actions { width: 100%; }
  .accounting-source-fields > label:first-child { grid-column: 1 / -1; }
}
@media (max-height: 34em) {
  .modal.accounting-entry-modal { overflow: auto; }
  .accounting-manual-form { display: block; }
  .accounting-editor-scroll { overflow: visible; }
  .accounting-entry-modal > header { position: static; }
}
@media (pointer: coarse) { .accounting-entry-options summary, .accounting-manual-form .accounting-position-row .accounting-position-remove { min-block-size: 2.75em; } }

/* The canonical select keeps the form contract; its searchable view wraps long names. */
.accounting-search-select-native { position: absolute !important; inline-size: 1px !important; block-size: 1px !important; min-block-size: 0 !important; padding: 0 !important; clip-path: inset(50%); overflow: hidden; }
.accounting-search-select { display: grid; min-width: 0; font-family: var(--font-brand); font-weight: 400; }
.accounting-search-select-trigger { display: flex; align-items: center; justify-content: space-between; gap: .6em; width: 100%; min-width: 0; padding: .65em .75em; border: 1px solid var(--line); border-radius: .45em; background: var(--surface); color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.accounting-search-select-trigger > :first-child { min-width: 0; overflow-wrap: anywhere; }
.accounting-search-select-trigger > :last-child { flex: none; }
.accounting-search-select-trigger:focus-visible, .accounting-search-select input:focus-visible { outline: .15em solid var(--brand-orange); outline-offset: .12em; }
.accounting-search-select-trigger:disabled { opacity: .6; cursor: default; }
.accounting-search-select-panel { display: grid; gap: .5em; padding: .6em; border: 1px solid var(--line); border-radius: .45em; background: var(--surface); margin-block-start: .3em; min-width: 0; }
.accounting-search-select-panel[hidden] { display: none !important; }
.accounting-manual-form .accounting-search-select { position: relative; }
.accounting-manual-form .accounting-search-select-panel { position: absolute; inset-inline: 0; inset-block-start: 100%; z-index: 8; box-shadow: 0 .4em 1em color-mix(in srgb, var(--brand-navy) 15%, transparent); }
.accounting-invoice-plate .accounting-search-select-panel { inset-inline-start: auto; inline-size: max(100%, 26ch); max-inline-size: calc(100dvw - 4em); }
.accounting-manual-form .accounting-search-select.opens-above .accounting-search-select-panel { inset-block-start: auto; inset-block-end: 100%; margin-block: 0 .3em; }
.accounting-search-select-panel > input { width: 100%; min-width: 0; margin: 0; font: inherit; }
.accounting-search-select-options { display: grid; max-block-size: min(18em, 34dvh); overflow-y: auto; overscroll-behavior: contain; min-width: 0; }
.accounting-search-select-options > [role="option"] { display: block; padding: .65em .6em; border-radius: .3em; cursor: pointer; color: var(--text); overflow-wrap: anywhere; line-height: 1.4; }
.accounting-search-select-options mark { background: var(--search-match-background); color: var(--search-match-text); font: inherit; padding: 0; }
.accounting-search-select-options > [aria-selected="true"] { font-weight: 700; }
.accounting-search-select-options > :is(.is-active, :hover) { background: var(--surface-blue); }
.accounting-search-select-options > .is-active { outline: 1px solid var(--brand-blue); outline-offset: -1px; }
.accounting-search-select-options > [aria-disabled="true"] { opacity: .55; cursor: default; }
.accounting-search-select-status { display: block; margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.accounting-search-select-status:empty { display: none; }
html[data-theme="dark"] .accounting-search-select-options > .is-active { outline-color: var(--text); }
@media (pointer: coarse) { .accounting-search-select-trigger, .accounting-search-select-options > [role="option"] { min-block-size: 2.75em; } }

/* Export confirmation stays compact while long translated column names wrap. */
.modal.accounting-export-modal { width: min(100%, 75ch); }
.accounting-export-modal .commercial-grid { gap: .7rem; }
.accounting-export-modal .commercial-grid p { margin: 0; overflow-wrap: anywhere; }
.accounting-export-modal .commercial-form-actions { margin-top: .9rem; padding-top: .8rem; }
.accounting-export-modal select { min-width: 0; max-width: 100%; }

.accounting-attachment-list { display: grid; gap: .4em; list-style: none; padding: 0; margin: .5em 0 0; }
.accounting-attachment-list li { display: flex; align-items: center; gap: .6em; border-top: 1px solid var(--line); padding-top: .4em; }
.accounting-attachment-list li > div { display: grid; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.accounting-attachment-list li > button { flex-shrink: 0; }
.accounting-attachment-list a { color: var(--brand-blue); }
.accounting-document-upload { display: grid; gap: .5em; padding-block: .6em; font-family: var(--font-brand); }
.accounting-document-upload > label { justify-self: start; }
.accounting-document-upload input[type="file"] { max-inline-size: 100%; min-inline-size: 0; }
.accounting-document-upload p { margin: 0; overflow-wrap: anywhere; }

/* The dispatch editor shares attachment controls without loading invoice lines. */
.modal.accounting-send-modal { width: min(100%, 54em); font-family: var(--font-brand); }
.accounting-send-modal .accounting-dialog-form { display: grid; gap: .65em; }
.accounting-send-modal .accounting-dialog-form > p { margin: 0; }
.accounting-send-copies { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16em), 1fr)); gap: .65em; }
.accounting-send-modal label, .accounting-send-modal input, .accounting-send-modal textarea { min-width: 0; }
.accounting-send-modal textarea { min-height: 10em; field-sizing: content; max-height: 45vh; resize: vertical; }
.accounting-send-attachments { display: grid; gap: .5em; min-width: 0; border: 1px solid var(--line); padding: .65em; }
.accounting-send-attachments .check { display: flex; align-items: flex-start; gap: .5em; }
.accounting-send-attachments .check input { flex: none; width: auto; }
.accounting-send-attachments .check span { overflow-wrap: anywhere; }
.accounting-send-embedded { display: grid; gap: .25em; margin-inline-start: .5em; padding-inline-start: .75em; border-inline-start: .2em solid var(--brand-blue); }
.accounting-send-file { padding-block: .3em; cursor: pointer; }
.accounting-send-file-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3em .65em; min-width: 0; }
.accounting-send-file-status { font-family: var(--font-brand); font-size: .85em; font-weight: 400; color: var(--muted); border: 1px solid var(--line); border-radius: .3em; padding: .1em .4em; }
.accounting-send-file:has(input:focus-visible) { outline: 2px solid var(--brand-blue); outline-offset: .15em; }
.accounting-send-extra { display: grid; gap: .2em; padding-block: .4em; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.accounting-send-recipients { display: flex; flex-wrap: wrap; gap: .3em 1em; }
.accounting-send-recipients .check { align-items: center; padding-block: .25em; font-weight: 400; }
.accounting-send-modal .actions .button { white-space: normal; overflow-wrap: anywhere; }
.accounting-send-modal .actions { flex-wrap: wrap; }

.accounting-send-attachments > p { margin: .25em 0; }
.accounting-send-attachments > p:empty { display: none; }

/* Invoice creation: recipient, claim and dates above a shared line-item grid. */
.accounting-entry-modal .accounting-editor-title h2 { font-size: 1.55em; }
.accounting-entry-modal .accounting-editor-title .pill { font-size: .85em; }
.accounting-entry-modal > header { align-items: center; border: 0; padding-block: .65em; }
.accounting-entry-modal .accounting-invoice-head { display: flex; flex-wrap: wrap; gap: .65em; padding-block: 0 .65em; }
.accounting-invoice-head > .accounting-entry-section { flex: 1 1 27ch; border: 1px solid var(--line); border-radius: .5em; background: var(--surface-soft); }
.accounting-invoice-head > .accounting-dates-section { flex: 1.7 1 44ch; }
.accounting-entry-modal .accounting-entry-heading { margin: 0; padding: .4em .75em; background: var(--surface-blue); color: var(--text); border-radius: .45em .45em 0 0; }
.accounting-entry-modal .accounting-entry-heading h3 { font-size: 1em; }
.accounting-entry-modal .accounting-invoice-head .accounting-entry-grid { padding: .55em .75em; }
.accounting-entry-modal .accounting-recipient-grid:has(> input:only-child) { display: none; }
.accounting-entry-modal .accounting-recipient-grid:has(> [data-manual-recipient]:not([hidden])) { padding-top: .3em; }
.accounting-recipient-summary { padding: .55em .75em 0; overflow-wrap: anywhere; }
.accounting-recipient-summary > strong { display: block; font-size: 1.05em; }
.accounting-recipient-summary address { font-style: normal; white-space: pre-line; margin-top: .3em; line-height: 1.45; }
.accounting-recipient-summary .accounting-internal-note { display: flex; align-items: baseline; gap: .5em; font-size: .82em; white-space: pre-line; padding-top: .65em; border-top: 1px solid var(--line); }
.accounting-entry-modal .pill { white-space: normal; flex-shrink: 0; }
.accounting-entry-modal .accounting-address-editor { padding: 0 .85em .5em; }
.accounting-entry-modal .accounting-address-editor > summary { color: var(--brand-blue); font-size: .9em; }
.accounting-entry-modal .accounting-address-editor .accounting-entry-grid { padding: 0; }
.accounting-entry-modal .accounting-dates-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 27ch), 1fr)); }
.accounting-entry-modal .accounting-dates-grid > label:first-child { order: 1; }
.accounting-entry-modal .accounting-dates-grid > label:nth-child(3) { order: 2; }
.accounting-entry-modal .accounting-dates-grid > label:nth-child(4) { order: 3; }
.accounting-invoice-title { position: relative; }
.accounting-invoice-title > small { position: absolute; inset-inline-end: 0; font-weight: 400; color: var(--muted); }
.accounting-number-note { padding: 0 .85em .75em; margin: 0; }
.accounting-entry-modal .accounting-lines-section { margin: 0 1em; padding: 0; border: 1px solid var(--line); border-radius: .5em; }
.accounting-entry-modal .accounting-position-list { gap: 0; }
.accounting-entry-modal .accounting-position-row { background: var(--surface); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: .4rem .65rem; }
.accounting-entry-modal .accounting-position-row:focus-within { background: var(--surface-soft); }
.accounting-entry-modal .accounting-position-main::before { background: transparent; color: var(--text); font-weight: 400; padding-top: .6em; }
.accounting-entry-modal .accounting-position-total > strong { font-size: .95em; }
.accounting-position-pdf { flex: 1 1 21ch; min-width: 0; display: grid; gap: .25em; }
.accounting-position-pdf-label { font-weight: 700; }
.accounting-entry-modal .accounting-position-source-upload { margin: 0; padding: 0; border: 0; }
.accounting-position-pdf .accounting-source-file-label { display: flex; align-items: center; justify-content: center; gap: .6em; width: 100%; border-style: dashed; padding: .35em .5em; min-block-size: 2.75em; font-size: .85em; }
.accounting-source-file-label small { display: block; font-size: inherit; font-weight: 400; color: var(--brand-blue); }
.accounting-entry-modal .accounting-source-chip { min-width: 0; display: flex; align-items: center; justify-content: start; gap: .5em; text-align: start; padding: .4em .5em; font-size: .85em; }
.accounting-source-chip span { min-width: 0; overflow-wrap: anywhere; }
.accounting-source-chip small { display: block; font-size: .9em; font-weight: 400; }
.accounting-entry-modal .accounting-source-row > summary { cursor: pointer; color: var(--brand-blue); font-weight: 700; }
.accounting-entry-modal .accounting-source-row[open] > summary { margin-bottom: .7em; }
.accounting-entry-modal .accounting-source-row:not([open]) { padding-block: .35em; }
.accounting-entry-modal .accounting-add-position { width: fit-content; border-style: solid; padding: .5em .8em; margin: .65em; background: var(--surface); }
.accounting-entry-modal .accounting-lines-section > .accounting-source-feedback { margin-inline: .85em; }
.accounting-entry-modal .accounting-entry-extras { display: flex; flex-wrap: wrap; align-items: start; gap: .65em; padding-block: .65em; }
.accounting-entry-extras > details { flex: 0 1 auto; }
.accounting-entry-extras > details[open] { flex-basis: 100%; }
.accounting-entry-modal .accounting-entry-extras > details > summary { display: list-item; list-style-position: inside; padding: .55em .8em; border: 1px solid var(--line); border-radius: .4em; color: var(--text); background: var(--surface); font-size: .9em; }
.accounting-entry-bottom { display: flex; flex-wrap: wrap; align-items: start; gap: 1em; padding: 0 1em 1em; }
.accounting-entry-bottom > .accounting-internal-documents { flex: 1.1 1 45ch; border: 1px solid var(--line); border-radius: .5em; background: var(--surface-soft); }
.accounting-internal-documents-body { display: flex; flex-wrap: wrap; align-items: start; gap: .7em; padding: .55em .75em; }
.accounting-internal-documents-body > .accounting-source-file-label { border-style: dashed; flex: 1 1 21ch; font-size: .85em; }
.accounting-internal-documents-body .accounting-attachment-list { flex: 1 1 23ch; padding: 0; margin: 0; }
.accounting-internal-documents-body .accounting-attachment-list > li { padding: .4em; }
.accounting-internal-documents-body .accounting-attachment-list .button { font-size: .8em; padding: .4em; }
.accounting-internal-documents > p { margin: 0 .85em .75em; }
.accounting-entry-modal .accounting-entry-review { flex: 1 1 40ch; display: grid; gap: .7em; padding: 0 0 0 1em; border: 0; box-shadow: none; background: transparent; }
.accounting-entry-modal .accounting-manual-totals { display: grid; gap: .45em; margin: 0; width: min(100%, 45ch); justify-self: end; }
.accounting-entry-modal .accounting-manual-totals > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4em 1em; }
.accounting-entry-modal .accounting-manual-totals > .accounting-total-payable { border: 0; border-top: 1px solid var(--line); padding: .45em 0 0; font-weight: 700; font-size: 1.1em; }
.accounting-entry-modal .accounting-total-payable strong { font-size: 1.15em; }
.accounting-entry-modal .accounting-review-actions { margin-top: .6em; }
.accounting-entry-modal .accounting-review-actions .actions > .button { flex: 1 1 18ch; }
.accounting-entry-modal .accounting-review-actions [value="draft"] { background: var(--surface-blue); }
.accounting-entry-modal .accounting-issue-note { display: none; }
.accounting-entry-modal .accounting-vat-details { flex-basis: 100%; }
.accounting-position-table-head { display: none; }
.accounting-final-review { margin: .5em 1em 1em; padding: 1em; border: 1px solid var(--brand-blue); border-radius: .5em; background: var(--surface-blue); overflow-wrap: anywhere; }
.accounting-final-review h3 { margin-top: 0; }
.accounting-final-review li { margin-block: .5em; }
.accounting-review-text { white-space: pre-wrap; }
@container (min-width: 70em) {
  .accounting-entry-modal .accounting-position-main, .accounting-position-table-head { display: grid; grid-template-columns: 3ch minmax(16ch, 1.1fr) minmax(22ch, 2fr) minmax(5ch, .3fr) minmax(12ch, .65fr) minmax(8ch, .45fr) minmax(12ch, .65fr) minmax(18ch, 1.1fr) 5.25rem; gap: .5em; align-items: start; }
  .accounting-position-table-head { padding: .45rem .65rem; background: var(--surface-blue); font-size: .8rem; font-weight: 700; }
  .accounting-entry-modal .accounting-position-main { font-size: .8rem; }
  .accounting-entry-modal .accounting-position-main .accounting-position-service { display: contents; }
  .accounting-position-main :is(.accounting-position-choice > label, .accounting-position-additional-description, .accounting-position-quantity, .accounting-position-price, .accounting-position-tax) { font-size: 0; gap: 0; }
  .accounting-position-main :is(input, textarea, select, .accounting-search-select) { font-size: .8rem; }
  .accounting-position-main .accounting-position-total > span, .accounting-position-pdf-label { display: none; }
  .accounting-entry-modal .accounting-position-main .accounting-position-remove { margin-top: 0; }
  .accounting-entry-modal .accounting-position-main::before { font-size: .9rem; min-inline-size: 0; }
  .accounting-entry-modal .accounting-position-total > strong { min-block-size: 2.75em; }
  .accounting-entry-modal .accounting-source-chip { width: 100%; }
}
@container (max-width: 45em) {
  .accounting-entry-modal .accounting-editor-title h2 { font-size: 1.15em; }
  .accounting-entry-modal .accounting-entry-review { padding: .5em 0 0; }
  .accounting-entry-modal .accounting-manual-totals { width: 100%; }
  .accounting-entry-modal .accounting-position-main { gap: .65em; }
  .accounting-entry-modal .accounting-position-pdf { flex-basis: calc(100% - 4em); }
  .accounting-entry-modal .accounting-position-row .accounting-position-remove { align-self: end; }
  .accounting-entry-modal .accounting-invoice-head > .accounting-entry-section { flex-basis: 100%; }
}
.accounting-entry-modal .accounting-invoice-head > .accounting-damage-section { flex: .75 1 24ch; }
.accounting-entry-modal .accounting-dates-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 27ch), 1fr)); }
.accounting-entry-modal .accounting-manual-totals { grid-template-columns: minmax(0, 1fr); }
.accounting-entry-modal .accounting-manual-totals > div { border-radius: 0; }
.accounting-entry-modal .accounting-entry-heading, .accounting-entry-modal .accounting-position-table-head { background: color-mix(in srgb, var(--brand-blue) 12%, var(--surface)); }
.accounting-entry-modal .accounting-entry-extras .accounting-add-position { margin: 0; }

@container (max-width: 45em) {
  .accounting-entry-modal .accounting-invoice-head > .accounting-damage-section { flex: 1 1 100%; }
}
.accounting-entry-modal .accounting-recipient-grid:not(:has([data-manual-recipient]:not([hidden]))) { display: none; }
@container (min-width: 70em) {
  .accounting-entry-bottom { position: sticky; bottom: 0; z-index: 4; background: var(--surface); padding-top: .75em; border-top: 1px solid var(--line); }
  .accounting-internal-documents-body .accounting-attachment-list { max-block-size: 8em; overflow: auto; }
}
@container (min-width: 70em) {
  .accounting-editor-scroll { scroll-padding-block-end: calc(var(--entry-footer-size, 1em) + 1em); }
}
.accounting-entry-modal .accounting-source-row:not([open]) { display: none; }
.accounting-entry-modal .accounting-source-chip .accounting-pdf-icon { flex: none; font-size: .7em; font-weight: 700; color: var(--red); border: 1px solid currentColor; border-radius: .2em; padding: .5em .2em; }

/* Keep secondary accounting controls outside the normal single-line editor. */
.accounting-entry-modal .accounting-position-options:not([open]) { display: none; }
.accounting-position-actions { display: flex; align-self: end; gap: .15em; }
.accounting-entry-modal .accounting-position-actions > .button { margin: 0; min-inline-size: 2.4em; min-block-size: 2.4em; padding: .35em; font-size: .9rem; line-height: 1; }
.accounting-entry-modal .accounting-position-actions > [data-entry-position-options] { background: transparent; color: var(--muted); }
.accounting-entry-modal .accounting-position-actions > [aria-expanded="true"] { background: var(--surface-blue); color: var(--brand-blue); }
.accounting-entry-modal .accounting-internal-documents-body { padding: .55em .75em; gap: .5em; }
.accounting-entry-modal .accounting-entry-bottom { gap: .75em; padding-bottom: .65em; }
.accounting-entry-modal .accounting-manual-totals { gap: .3em; }
.accounting-entry-modal .accounting-review-actions { margin-top: .3em; }
.accounting-entry-modal .accounting-internal-documents-body:has(> label[hidden]) { display: none; }
@container (min-width: 70em) {
  .accounting-entry-modal .accounting-position-actions { align-self: start; }
  .accounting-entry-modal .accounting-position-main .accounting-position-choice:has([data-accounting-free-label]:not([hidden])) { display: flex; gap: .3em; align-items: start; }
  .accounting-position-choice:has([data-accounting-free-label]:not([hidden])) > label { flex: 0 0 2.1rem; }
  .accounting-position-choice:has([data-accounting-free-label]:not([hidden])) .accounting-search-select-trigger > :first-child { position: absolute; inline-size: 1px; block-size: 1px; clip-path: inset(50%); overflow: hidden; }
  .accounting-entry-modal .accounting-position-service [data-accounting-free-label] { flex: 1; min-width: 0; margin: 0; }
  .accounting-position-main [data-accounting-position-label] { font-size: 0; gap: 0; }
  .accounting-position-choice .accounting-search-select-panel { min-inline-size: min(32ch, calc(100dvw - 6em)); }
  .accounting-entry-modal .accounting-position-additional-description textarea:not(:focus) { field-sizing: fixed; block-size: 2.6em; white-space: pre; overflow: auto; resize: none; }
  .accounting-entry-modal .accounting-position-additional-description textarea:focus { field-sizing: content; white-space: pre-wrap; }
  .accounting-entry-modal .accounting-position-main :is(input, select, textarea, .accounting-search-select-trigger) { padding: .45em .55em; }
}
@media (pointer: coarse) {
  .accounting-entry-modal .accounting-position-actions > .button { min-inline-size: 2.75em; min-block-size: 2.75em; }
}

/* Shorter invoice workspace; the prose editor opens as a local modal. */
.accounting-entry-modal .accounting-invoice-head { padding-bottom: .45em; gap: .5em; }
.accounting-entry-modal .accounting-invoice-head .accounting-entry-grid { padding: .4em .7em; gap: .45em .65em; }
.accounting-entry-modal .accounting-entry-heading { padding: .3em .7em; }
.accounting-entry-modal .accounting-recipient-summary { padding: .4em .7em 0; }
.accounting-entry-modal .accounting-recipient-summary address { margin-top: .2em; line-height: 1.35; }
.accounting-entry-modal .accounting-recipient-summary .accounting-internal-note { padding-top: .35em; margin-block: .45em; }
.accounting-entry-modal .accounting-reference-field { position: relative; gap: 0; }
.accounting-entry-modal .accounting-reference-required { position: absolute; inset-block-start: 0; inset-inline-end: 0; font-size: .75rem; }
.accounting-reference-caption { max-inline-size: calc(100% - 12ch); }
.accounting-entry-modal .accounting-position-row { padding-block: .25rem; }
.accounting-entry-modal .accounting-entry-extras { gap: .5em; padding-block: .45em; }
.accounting-entry-modal .accounting-entry-bottom { padding-top: .45em; padding-bottom: .45em; }
.accounting-entry-modal .accounting-internal-documents-body { padding: .4em .7em; }
.accounting-entry-modal .accounting-number-note { padding-bottom: .45em; }
.accounting-entry-modal .accounting-lines-section > .accounting-source-feedback:empty { display: none; }
.accounting-invoice-text-dialog { width: min(64ch, calc(100vw - 2em)); max-width: none; max-height: calc(100dvh - 2em); margin: auto; padding: 1.2em; border: 1px solid var(--line); border-radius: .5em; color: var(--text); background: var(--surface); font-family: var(--font-brand); overflow: auto; }
.accounting-invoice-text-dialog::backdrop { background: color-mix(in srgb, var(--brand-navy) 35%, transparent); }
.accounting-invoice-text-dialog > header { display: flex; justify-content: space-between; align-items: start; gap: 1em; margin-bottom: .8em; }
.accounting-invoice-text-dialog h2 { margin: 0; font-size: 1.35em; }
.accounting-invoice-text-dialog .accounting-dialog-form { display: grid; gap: .5em; }
.accounting-invoice-text-dialog label { gap: .3em; }
.accounting-invoice-text-dialog label > small { display: contents; font-weight: 400; }
.accounting-invoice-text-dialog .fine { margin: 0 0 .35em; }
.accounting-invoice-text-dialog textarea { min-height: 4em; field-sizing: content; max-height: 35dvh; overflow: auto; }
.accounting-invoice-text-dialog .accounting-text-scope { border-top: 1px solid var(--line); padding-top: .65em; }
.accounting-invoice-text-dialog .actions { display: flex; flex-wrap: wrap; justify-content: end; gap: .6em; margin-top: .3em; }

.accounting-entry-modal .accounting-source-chip { border: 1px solid var(--line); border-radius: .4em; background: var(--surface-soft); }
.accounting-entry-modal .accounting-source-chip > span:nth-child(2) { flex: 1; }
.accounting-entry-modal .accounting-source-chip > button { flex: none; padding: .3em; min-inline-size: 2em; min-block-size: 2em; }

/* Invoice review keeps the persisted draft editable until an explicit issue action. */
.modal.accounting-review-modal { width: min(100%, 110em); display: flex; flex-direction: column; max-height: calc(100dvh - 1em); overflow: hidden; }
.accounting-review-modal > header { flex: 0 0 auto; }
.accounting-invoice-review-workspace { padding: .3em .8em .8em; display: flex; flex-wrap: wrap; gap: 1em; overflow: auto; min-height: 0; align-items: flex-start; }
.accounting-review-pdf { flex: 1.3 1 40ch; min-width: 0; position: sticky; top: 0; }
.accounting-review-compose { flex: 1 1 38ch; min-width: 0; }
.accounting-review-compose > .note-box { margin-top: 0; }
.accounting-review-pdf-heading { display: flex; align-items: center; justify-content: space-between; gap: .6em; flex-wrap: wrap; margin-bottom: .5em; }
.accounting-review-pdf-heading h3 { margin: 0; }
.accounting-review-modal .accounting-pdf-page { max-block-size: 75dvh; }
.accounting-review-modal textarea { min-height: 7em; }
.accounting-review-modal .accounting-review-compose .actions { position: sticky; bottom: 0; background: var(--surface); padding-block: .5em; border-top: 1px solid var(--line); }
.accounting-review-modal .accounting-review-compose .actions .button { flex: 1 1 18ch; }
@media (max-width: 50em) {
  .accounting-review-pdf { position: static; }
  .accounting-review-modal .accounting-pdf-page { max-block-size: 48dvh; }
}

/* Confirm a position PDF without replacing or saving the invoice editor. */
.accounting-source-import-dialog { width: min(132ch, calc(100vw - 2em)); max-width: none; max-height: calc(100dvh - 2em); margin: auto; padding: .85em; border: 1px solid var(--line); border-radius: .5em; background: var(--surface); color: var(--text); font-family: var(--font-brand); overflow: auto; }
.accounting-source-import-dialog::backdrop { background: color-mix(in srgb, var(--brand-navy) 40%, transparent); }
.accounting-source-import-dialog > header { display: flex; align-items: start; justify-content: space-between; gap: .6em; margin-bottom: .7em; }
.accounting-source-import-dialog h2 { margin: 0; font-size: 1.35em; }
.accounting-source-import-dialog header p { margin: .3em 0 0; }
.accounting-source-import-columns { display: flex; flex-wrap: wrap; gap: .8em; align-items: start; }
.accounting-source-import-columns > section { flex: 1 1 42ch; min-width: 0; border: 1px solid var(--line); border-radius: .45em; overflow: hidden; }
.accounting-source-import-columns > .accounting-source-import-data { flex-grow: 1.15; }
.accounting-source-import-dialog h3 { margin: 0; padding: .5em .65em; font-size: 1.05em; background: var(--surface-blue); }
.accounting-source-import-file { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5em; padding: .55em; overflow-wrap: anywhere; }
.accounting-source-import-dialog form { display: grid; gap: .65em; padding: .65em; }
.accounting-source-import-dialog label { min-width: 0; gap: .3em; }
.accounting-source-import-dialog input, .accounting-source-import-dialog select, .accounting-source-import-dialog textarea { width: 100%; min-width: 0; }
.accounting-source-import-modes { display: flex; flex-wrap: wrap; gap: .3em; border: 0; padding: 0; margin: 0; }
.accounting-source-import-modes label { flex: 1 1 20ch; display: flex; align-items: center; justify-content: center; padding: .55em; border: 1px solid var(--line); border-radius: .4em; cursor: pointer; text-align: center; }
.accounting-source-import-modes label:has(:checked) { background: var(--brand-blue-soft); color: var(--brand-blue); border-color: var(--brand-blue); }
.accounting-source-import-modes label:focus-within { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
.accounting-source-import-modes input { width: auto; flex: 0 0 auto; accent-color: var(--brand-blue); }
.accounting-source-import-fields, .accounting-source-import-amounts { display: flex; flex-wrap: wrap; gap: .65em; }
.accounting-source-import-fields label { flex: 1 1 21ch; }
.accounting-source-import-amounts label { flex: 1 1 10ch; }
.accounting-source-import-dialog [hidden] { display: none !important; }
.accounting-source-import-dialog p { margin: 0; }
.accounting-source-import-dialog textarea { min-height: 5em; resize: vertical; }
.accounting-source-import-dialog .note-box { padding: .5em .65em; }
.accounting-source-import-dialog footer { border-top: 1px solid var(--line); padding-top: .6em; display: grid; gap: .6em; }
.accounting-source-import-dialog .actions { display: flex; justify-content: end; flex-wrap: wrap; gap: .5em; }
.accounting-source-import-dialog .accounting-pdf-page { max-height: 65dvh; background: var(--surface-soft); }
.accounting-source-import-dialog .accounting-pdf-toolbar { padding: .4em; }
@media (max-width: 50rem) {
  .accounting-source-import-dialog { width: calc(100vw - 1em); max-height: calc(100dvh - 1em); padding: .6em; }
  .accounting-source-import-dialog .accounting-pdf-page { max-height: 38dvh; }
}
