/* ICPv2's own rules. app.css stays a byte copy of the old system's stylesheet
   (UI.md §1); anything new goes here. */

/* A page stays hidden until web/js/shell.js has checked the session and drawn it. */
html.is-pending body {
  visibility: hidden;
}

/* The icon sprite is hidden by class, not by an inline style, so the CSP needs no 'unsafe-inline' (plan C5). */
.icon-sprite {
  display: none;
}

/* The dashboard gaps banner's "see all" link after its three rows (decision 0022), in the banner's amber text. */
.company-gaps-banner__more {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
}

.company-gaps-banner__more a {
  color: #92400e;
  font-weight: 600;
}

/* The company page's Invoice layout card: the logo thumbnail beside the kind and the last change (invoice layouts, Task 5). */
.company-layout-card__body {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.company-layout-card__logo {
  max-width: 8rem;
  max-height: 3rem;
  object-fit: contain;
}

/* While a page reads its data, its content area shows a skeleton under the frame (decision 0023; owner's choice 2026-10-14): a title
   bar and four lines with a sweep of light. It appears only after 150ms, so a quick page never flashes it. */
.page-loading {
  padding: 0.5rem 0 2rem;
  opacity: 0;
  animation: page-loading-in 0s 150ms forwards;
}

@keyframes page-loading-in {
  to {
    opacity: 1;
  }
}

.page-loading__bar {
  height: 0.875rem;
  width: 100%;
  margin-bottom: 1rem;
  border-radius: 0.375rem;
  background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 50%, #e2e8f0 100%);
  background-size: 200% 100%;
  animation: page-loading-sweep 1.4s ease-in-out infinite;
}

.page-loading__bar--title {
  height: 1.75rem;
  width: 40%;
  margin-bottom: 1.75rem;
}

.page-loading__bar--short {
  width: 70%;
}

@keyframes page-loading-sweep {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-loading__bar {
    animation: none;
  }
}

/* An error summary's links (each to its field) carry no underline; it comes back under the pointer and on keyboard focus, so they still
   read as links (owner 2026-10-15). */
#form-validation-summary a,
#payment-plan-errors a,
#login-validation-summary a {
  text-decoration: none;
}

#form-validation-summary a:hover,
#form-validation-summary a:focus-visible,
#payment-plan-errors a:hover,
#payment-plan-errors a:focus-visible,
#login-validation-summary a:hover,
#login-validation-summary a:focus-visible {
  text-decoration: underline;
}

/* The invoice layout settings page (invoice layouts, Task 6): the settings beside a live preview from 992px, the preview below them on
   narrower screens. The preview is an A4 page (210mm) drawn smaller with zoom, so it fits its column; it scrolls inside its own box
   when the column is narrower still. The zoom is 80% of what fits the column: the preview is a demonstration, recognisable is enough
   (the owner, 2026-10-22). */
.company-layout__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (min-width: 992px) {
  .company-layout__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }

  .company-layout__preview-column {
    position: sticky;
    top: 1rem;
  }
}

.company-layout__standard {
  min-width: 0;
}

.company-layout__standard:disabled {
  opacity: 0.55;
}

/* A group of choices is a fieldset whose legend reads as the other fields' labels (Bootstrap draws a legend larger). */
.company-layout legend.form-label {
  font-size: inherit;
  line-height: inherit;
}

.company-layout__logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.company-layout__logo:not(:empty) {
  margin-bottom: 0.5rem;
}

.company-layout__logo-thumb {
  max-width: 10rem;
  max-height: 3.5rem;
  object-fit: contain;
}

.company-layout__font {
  font-size: 1.0625rem;
}

.company-layout__font--fira-sans {
  font-family: 'Fira Sans', sans-serif;
}

.company-layout__font--noto-sans {
  font-family: 'Noto Sans', sans-serif;
}

.company-layout__font--noto-serif {
  font-family: 'Noto Serif', serif;
}

.company-layout__font--lora {
  font-family: 'Lora', serif;
}

.company-layout__swatches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Each swatch is a 44px touch target (UI.md §2) around a round colour; the chosen one has a ring. */
.company-layout__swatch {
  width: 2.75rem;
  height: 2.75rem;
  border: 3px solid var(--app-surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--app-border);
  cursor: pointer;
}

.btn-check:checked + .company-layout__swatch {
  box-shadow: 0 0 0 3px var(--app-primary);
}

.btn-check:focus-visible + .company-layout__swatch {
  outline: 2px solid var(--app-primary);
  outline-offset: 3px;
}

.btn-check:disabled + .company-layout__swatch {
  cursor: default;
}

.company-layout__swatch--1e3a8a {
  background-color: #1e3a8a;
}

.company-layout__swatch--2563eb {
  background-color: #2563eb;
}

.company-layout__swatch--0f766e {
  background-color: #0f766e;
}

.company-layout__swatch--15803d {
  background-color: #15803d;
}

.company-layout__swatch--9f1239 {
  background-color: #9f1239;
}

.company-layout__swatch--c2410c {
  background-color: #c2410c;
}

.company-layout__swatch--6d28d9 {
  background-color: #6d28d9;
}

.company-layout__swatch--334155 {
  background-color: #334155;
}

.company-layout__swatches .form-control-color {
  width: 3.5rem;
  min-height: 2.75rem;
}

.company-layout__preview-title {
  margin-bottom: 0.75rem;
}

.company-layout__preview {
  overflow: auto;
  max-height: calc(100vh - 6rem);
  padding: 1rem;
  border: 1px solid var(--app-card-border);
  border-radius: var(--app-card-radius);
  background-color: #e5e7eb;
}

.company-layout__page {
  zoom: 0.28;
}

@media (min-width: 576px) {
  .company-layout__page {
    zoom: 0.56;
  }
}

@media (min-width: 992px) {
  .company-layout__page {
    zoom: 0.48;
  }
}

@media (min-width: 1400px) {
  .company-layout__page {
    zoom: 0.64;
  }
}

/* A new project whose company's invoice layout is still the untouched
   default (2026-10-16): the amber of the "not set up" banner, so it is
   noticed. It slides in and glows three times, its button pulses, then both
   rest; the page marks it seen so a redraw does not replay them. */
.layout-hint {
  padding: 1rem 1.25rem;
  background-color: #fffbeb;
  border: 1px solid #fcd34d;
  border-left: 5px solid #f59e0b;
  border-radius: 0.75rem;
  animation: layout-hint-in 0.35s ease-out, layout-hint-glow 1.6s ease-out 0.4s 3;
}

.layout-hint__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.375rem;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #92400e;
}

.layout-hint__title .icon {
  width: 1.25rem;
  height: 1.25rem;
  color: #d97706;
}

[data-layout-hint-seen] .layout-hint,
[data-layout-hint-seen] .layout-hint .btn-pulse {
  animation: none;
}

@keyframes layout-hint-in {
  from {
    opacity: 0;
    transform: translateY(-0.5rem);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes layout-hint-glow {
  0% {
    box-shadow: 0 0 0 0 rgb(245 158 11 / 55%);
  }

  100% {
    box-shadow: 0 0 0 0.75rem rgb(245 158 11 / 0%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .layout-hint,
  .layout-hint .btn-pulse {
    animation: none;
  }
}

/* The invoice layout editor re-laid after the colleagues' mockup (spec 2026-10-21 E4–E8): the company line under the head, three
   sections with icon titles, an upload box in front of the file input, a segmented position control (btn-check radios), placeholder
   chips, check-mark switches in two columns from 576px, and a footer whose buttons wrap on a phone. The read-only form (no
   change_company) is one disabled fieldset. */
.company-layout__company {
  color: var(--app-muted);
  margin: -0.5rem 0 1rem;
}

.company-layout__all,
.company-layout__standard-rest {
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
}

.company-layout__all:disabled .company-layout__chip {
  pointer-events: none;
  opacity: 0.6;
}

.company-layout__standard-rest:disabled {
  opacity: 0.55;
}

.company-layout__section + .company-layout__section,
.company-layout__standard-rest > .company-layout__section {
  margin-top: 1rem;
}

.company-layout__section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.company-layout__section-title .icon {
  width: 1.125rem;
  height: 1.125rem;
  color: var(--app-muted);
}

.company-layout__logo-drop {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px dashed var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-bg);
  cursor: pointer;
}

.company-layout__logo-drop:hover {
  border-color: var(--app-primary);
}

.company-layout__logo-drop-icon {
  display: inline-flex;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--app-radius);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  color: var(--app-muted);
}

.company-layout__logo-drop-icon .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.company-layout__logo-drop strong {
  display: block;
}

/* The native file input stays in the page for the keyboard, the browser tool and the tests, but out of sight: the dashed box (its label)
   is the one place to choose a file (the owner, 2026-10-21: two upload controls looked like two uploads). Focus shows on the box. */
.company-layout__logo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.company-layout__logo-box:focus-within .company-layout__logo-drop {
  outline: 2px solid var(--app-primary);
  outline-offset: 2px;
}

.company-layout__logo-box:has(.company-layout__logo-input.is-invalid) .company-layout__logo-drop {
  border-color: var(--bs-danger, #dc3545);
}

.company-layout__segmented {
  display: flex;
  width: 100%;
  background: var(--app-bg);
  border-radius: 999px;
  padding: 0.25rem;
}

.company-layout__segmented .btn {
  flex: 1 1 0;
  border: 0;
  border-radius: 999px;
  color: var(--app-muted);
}

.company-layout__segmented .btn-check:checked + .btn {
  background: var(--app-surface);
  color: var(--app-text);
  box-shadow: var(--app-card-shadow);
}

.company-layout__segmented .btn-check:focus-visible + .btn {
  outline: 2px solid var(--app-primary);
  outline-offset: 2px;
}

.company-layout__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.company-layout__chip {
  font-family: var(--app-font-mono);
  font-size: 0.8125rem;
  min-height: 2rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface);
  color: var(--app-text);
}

.company-layout__chip:hover,
.company-layout__chip:focus-visible {
  border-color: var(--app-primary);
  color: var(--app-primary);
}

.company-layout__switches {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem 1.5rem;
}

@media (min-width: 576px) {
  .company-layout__switches {
    grid-template-columns: 1fr 1fr;
  }
}

.company-layout__switch .form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  margin-top: 0.125rem;
}

.company-layout__switch .form-check-input:checked {
  background-color: var(--app-text);
  border-color: var(--app-text);
}

.company-layout__footer {
  flex-wrap: wrap;
  align-items: center;
}

.company-layout__footer .company-layout__copy {
  width: auto;
  min-width: 12rem;
}

/* Invoice designs (2026-10-21): the preview column's head holds the "Preview as" company select beside the title; the used-by note
   under the sections. */
.company-layout__preview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}

.company-layout__preview-head .company-layout__preview-title {
  margin-bottom: 0;
}

.company-layout__preview-as {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--app-muted);
}

.company-layout__preview-as .form-select {
  width: auto;
}

.company-layout__used-by {
  margin-top: 1rem;
}

/* The preview sits in a card like the settings, so both columns start on the same line (the owner, 2026-10-21); the card's head holds
   the title and the "Preview as" select; the preview box fills the card's width. */
.company-layout__preview-card .company-layout__preview-head {
  margin-bottom: 1rem;
}

.company-layout__preview-card .company-layout__preview-title {
  font-weight: 600;
}

.company-layout__logo-box {
  position: relative;
}

/* The uploaded logo shows inside the upload box in place of the document icon (the owner, 2026-10-21). */
.company-layout__logo-drop-icon.has-logo {
  width: auto;
  max-width: 10rem;
  height: 3.5rem;
  padding: 0.25rem;
  background: #ffffff;
}

.company-layout__logo-drop-icon.has-logo .company-layout__logo-thumb {
  max-height: 3rem;
  max-width: 9.5rem;
}

/* With a logo, the box shows it large at the left and says how to change it; Remove logo sits beside the box, in the same row
   (the owner, 2026-10-21). */
.company-layout__logo-box {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.company-layout__logo-box .company-layout__logo-drop {
  flex: 1 1 auto;
  min-width: 0;
}

.company-layout__logo-box .company-layout__logo {
  flex: none;
  align-self: center;
}

.company-layout__logo-box .company-layout__logo:not(:empty) {
  margin-bottom: 0;
}

.company-layout__logo-drop-icon.has-logo {
  flex: none;
  width: auto;
  max-width: 12rem;
  height: 4.5rem;
  padding: 0.375rem;
}

.company-layout__logo-drop-icon.has-logo .company-layout__logo-thumb {
  max-height: 3.75rem;
  max-width: 11rem;
}

/* The agreement template editor (agreement templates, 2026-10-23): the editor and its history beside the placeholder panel from 992px,
   the panel under them on narrower screens; the preview under both, wider than the invoice one, so its page is drawn larger. The editor
   shows the body in the document's face; read-only it is greyed. Long tokens and titles wrap rather than widen the page. */
.agreement-editor { min-height: 24rem; font-family: Calibri, "Carlito", sans-serif; font-size: 12pt; line-height: 1.4; padding: 0.75rem;
  border: 1px solid var(--app-border); border-radius: var(--app-card-radius); overflow-wrap: anywhere; }
.agreement-editor p { margin: 0 0 .25rem; min-height: 1em; }
.agreement-editor:focus { outline: 2px solid var(--bs-primary); }
.agreement-editor--readonly { background: var(--bs-tertiary-bg); }

.agreement-template__toolbar {
  position: relative;
  display: flex;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
}

.agreement-template__main {
  min-width: 0;
}

@media (min-width: 992px) {
  /* 7:5 with a floor for the side column (the compact rows need about 20rem); the panel is a sticky flex column whose list alone scrolls. */
  .agreement-template__grid {
    grid-template-columns: minmax(0, 7fr) minmax(20rem, 5fr);
  }

  .agreement-template__panel {
    position: sticky;
    top: 1rem;
    /* 1rem above, and the sticky save bar (its height plus its 12px offset) below. */
    max-height: calc(100vh - 7.5rem);
    display: flex;
    flex-direction: column;
  }

  .agreement-template__panel > .form-card__body {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .agreement-variables__list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
  }
}

.agreement-kind-form { margin-bottom: 1.5rem; }

.agreement-template__preview-card {
  margin-top: 1.25rem;
}

/* Template editor guidance (spec 2026-10-29): the coloured placeholders (paint only, CSS Custom Highlight API), the toolbar's insert
   menu (a details element); the variable panel follows. */
.agreement-editor::highlight(agreement-token) { color: var(--bs-primary-text-emphasis); background-color: var(--bs-primary-bg-subtle); }
.agreement-editor::highlight(agreement-token-unknown) { color: var(--bs-danger-text-emphasis); background-color: var(--bs-danger-bg-subtle); }

.agreement-insert { position: static; }
.agreement-insert > summary { list-style: none; cursor: pointer; }
.agreement-insert > summary::-webkit-details-marker { display: none; }
.agreement-insert[aria-disabled] > summary { opacity: 0.6; cursor: default; }
.agreement-insert__panel {
  position: absolute; z-index: 10; top: 100%; left: 0; margin-top: 0.25rem;
  width: min(34rem, 100%); max-height: 60vh; overflow-y: auto;
  background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: var(--app-radius);
  box-shadow: var(--bs-box-shadow); padding: 0.5rem 0.75rem 0.75rem; display: grid; gap: 0.625rem;
}
.agreement-insert__group { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.agreement-insert__title { flex-basis: 100%; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--app-muted); }
.agreement-insert__item { max-width: 100%; text-align: left; }
.agreement-insert__meaning { font-family: var(--bs-body-font-family); font-size: 0.75rem; color: var(--app-muted); margin-left: 0.25rem; }
/* The editor's card lets the insert menu's panel escape it (the fix wave of 2026-10-29); app.css is a frozen copy of the old system, so the modifier lives here. */
.form-card--overflow-visible { overflow: visible; }

/* The variable panel (spec 2026-10-29 variable panel; compact layout 2026-10-29 from the owner's reference image): head, warnings strip,
   search, wrapping tabs, borderless groups, one row per variable on one line (name | chip + meaning | Insert). White background, light
   dividers, colour only on the chips, the active tab and the buttons. */
.agreement-variables__help > summary { cursor: pointer; font-size: 0.875rem; color: var(--bs-primary); }
.agreement-variables__warnings { padding: 0.5rem 0.75rem; font-size: 0.875rem; margin: 0.75rem 0; }
.agreement-variables__warnings ul { padding-left: 1.1rem; }
.agreement-variables__search { margin: 0.75rem 0 0.5rem; }
.agreement-variables__tabs { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 0.5rem; }
.agreement-variables__tab { border: 1px solid var(--bs-border-color); background: var(--bs-body-bg); color: var(--bs-body-color); border-radius: 999px; padding: 0.2rem 0.7rem; font-size: 0.8125rem; line-height: 1.3; white-space: nowrap; }
.agreement-variables__tab .agreement-variables__count { font-size: inherit; }
.agreement-variables__tab[aria-pressed="true"] { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; }
.agreement-variables__tab[aria-pressed="true"] .agreement-variables__count { color: rgba(255, 255, 255, 0.85); }
.agreement-variables__group { margin: 0; }
.agreement-variables__group + .agreement-variables__group { margin-top: 0.5rem; }
.agreement-variables__group-head { margin: 0; font-size: 0.875rem; }
.agreement-variables__fold { display: flex; align-items: center; gap: 0.375rem; width: 100%; text-align: left; padding: 0.375rem 0.5rem; border: 0; border-radius: var(--app-radius); background: var(--bs-tertiary-bg); color: inherit; font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.agreement-variables__fold .icon { flex: none; width: 1rem; height: 1rem; color: var(--bs-primary); }
.agreement-variables__count { color: var(--app-muted); font-weight: 400; font-size: 0.8125rem; }
.agreement-variables__fold::after { margin-left: auto; color: var(--app-muted); font-size: 0.75rem; }
.agreement-variables__fold[aria-expanded="false"]::after { content: "▸"; }
.agreement-variables__fold[aria-expanded="true"]::after { content: "▾"; }
.agreement-variables__rows { list-style: none; margin: 0; padding: 0; container-type: inline-size; }
.agreement-variables__row { display: grid; grid-template-columns: minmax(4.5rem, 6.5rem) minmax(0, 1fr) auto; gap: 0.25rem 0.625rem; align-items: start; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--bs-border-color-translucent); }
.agreement-variables__row[hidden] { display: none; }
.agreement-variables__title { min-width: 0; padding-top: 0.2rem; font-size: 0.875rem; line-height: 1.3; }
.agreement-variables__name { font-weight: 600; overflow-wrap: anywhere; }
.agreement-variables__used { display: inline-block; margin-left: 0.125rem; font-size: 0.6875rem; color: var(--app-muted); white-space: nowrap; }
.agreement-variables__token { min-width: 0; }
.agreement-variables__token .company-layout__chip { display: inline-block; max-width: 100%; min-height: 0; padding: 0.15rem 0.5rem; border-color: transparent; border-radius: 0.375rem; background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); font-size: 0.75rem; line-height: 1.4; overflow-wrap: anywhere; text-align: left; }
.agreement-variables__token .company-layout__chip:hover, .agreement-variables__token .company-layout__chip:focus-visible { border-color: var(--app-primary); }
.agreement-variables__meaning { font-size: 0.75rem; line-height: 1.35; color: var(--app-muted); margin-top: 0.125rem; }
.agreement-variables__insert { white-space: nowrap; min-width: 3.75rem; min-height: 0; padding: 0.2rem 0.5rem; font-size: 0.8125rem; line-height: 1.4; } /* app.css gives every button a 44px touch target; a row is as tall as its button */
/* A narrow container (a phone, or the side column on a 1024px laptop beside the navigation; the three columns need about 20rem so a
   chip does not break inside its name) keeps two lines per row: name + button, then the chip; the meaning stays on the chip's tooltip. */
@container (max-width: 20rem) {
  .agreement-variables__row { grid-template-columns: minmax(0, 1fr) auto; }
  .agreement-variables__title { grid-column: 1; grid-row: 1; }
  .agreement-variables__insert { grid-column: 2; grid-row: 1; }
  .agreement-variables__token { grid-column: 1 / -1; grid-row: 2; }
  .agreement-variables__meaning { display: none; }
}
.agreement-variables__note, .agreement-variables__rows > li:not([data-row]) { margin: 0; padding: 0.5rem; font-size: 0.8125rem; }

.agreement-template .company-layout__preview-as {
  flex-wrap: wrap;
  max-width: 100%;
}

.agreement-template .company-layout__preview-as .form-select {
  max-width: 100%;
}

.agreement-template__note {
  margin: 1rem 0 0;
}

@media (min-width: 992px) {
  .agreement-template__preview-card .company-layout__page {
    zoom: 0.9;
  }
}

.template-panels { display: grid; gap: 2rem; }
.template-panel { padding-top: 1rem; }
.template-panel__head { margin-bottom: .75rem; }
/* The title block takes the room and may shrink (the lead wraps); the buttons keep their width and sit right, so the head stays
   one row in English too (2026-10-30: the collaboration card's head dropped its buttons to a second row, the project card's not). */
.template-panel__head .page-head__title { flex: 1 1 0; min-width: 18rem; }
.template-panel__actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; flex: none; margin-left: auto; }

/* A stage set as bad debt (BAD-018): the warning colour of its badge, beside .stage-step--overdue in the frozen app.css. */
.stage-step--bad_debt { background-color: #ffc107; color: #1f1f1f; }

/* Dashboard "Bad debt" tile (BAD-021): orange like the bad-debt badge; the amount is a link, drawn as the other tiles' amounts. */
.receivables-tile__icon--bad-debt {
  color: #c2410c;
  background-color: #ffedd5;
}

a.receivables-tile__amount {
  display: block;
  text-decoration: none;
}

a.receivables-tile__amount:hover {
  text-decoration: underline;
}

/* The ledger page (spec 2026-11-11 §5.1, decision 0039: an accounting book, which replaced the tiles and the dark banner): the filter
   panel, a statement per currency, the entries panel. Calm on purpose: hairline rules only, no zebra, no shadow on the statement, one
   text colour and one muted colour; colour only on links, badges and the Manual mark. */
/* A panel title that reads as the panel's header (the owner, round 5: the plain bold title looked like one more field label): larger,
   a divider under it across the panel. Since the owner's reference picture (2026-11-12, decision 0040 item 15) the accent before it is
   the panel's icon in the primary colour (a funnel for the filters, a document for the entries), which replaced the blue bar. */
.ledger-panel__title { display: flex; align-items: center; gap: .625rem; font-size: 1.25rem; font-weight: 700; margin: 0 0 1rem; padding-bottom: .625rem; border-bottom: 1px solid var(--app-card-border); }
.ledger-panel__title > .icon { width: 1.25rem; height: 1.25rem; color: var(--app-primary); }
/* Query and Reset with their icon (a magnifier, a refresh arrow) before the word. */
.ledger-filter-actions .btn { display: inline-flex; align-items: center; gap: .375rem; }
.ledger-filter-actions .btn > .icon { width: 1rem; height: 1rem; }
/* The void switch stands level with the inputs beside it (the filter row aligns its items to the bottom). */
.ledger-void-filter { display: flex; align-items: center; min-height: calc(1.5em + .75rem + 2px); flex: 0 1 auto; }
.ledger-void-filter .form-check { margin-bottom: 0; }
/* The statements: one grid at the panels' width (the controller's walk: a narrow block beside full-width panels was the imbalance the owner
   rejected before): one currency spans the width, two sit side by side on a wide screen and stack on a narrow one. Each statement is a
   bordered panel; the header line names company, period and currency; the table scrolls sideways in its wrapper, never the page. */
.ledger-statements { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(34rem, 100%), 1fr)); gap: 1rem; margin-top: 1.5rem; }
.ledger-statement { min-width: 0; padding: 1rem 0 .5rem; border: 1px solid var(--app-card-border); border-radius: var(--app-card-radius); background-color: var(--app-surface); }
.ledger-statement__scroll { overflow-x: auto; }
/* The head as chips (the reference picture): the company on a soft grey, then the period and the currency, each after its icon (a
   calendar, coins), on a faint primary tint. */
.ledger-statement__head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 1rem .75rem; font-size: 1rem; font-weight: 600; }
.ledger-statement__chip { display: inline-flex; align-items: center; gap: .375rem; padding: .25rem .75rem; border-radius: 50rem; background-color: var(--bs-tertiary-bg); color: var(--app-text); }
.ledger-statement__chip--meta { font-size: .875rem; font-weight: 500; color: var(--app-muted); background-color: color-mix(in srgb, var(--app-primary) 6%, transparent); }
.ledger-statement__chip > .icon { width: 1rem; height: 1rem; color: var(--app-primary); }
/* Borders kept apart (separate, no spacing), so a rule never competes with a neighbour's hairline in collapse tie-breaking. Every cell
   has a hairline under it; a total or Net row draws its own darker rule over its amount cells, and the row before it drops the hairline
   under its amount cells so the two never stack. Each row-kind rule is scoped `.ledger-statement__table tr.<kind> > …` so it outranks
   the base `tbody th` rule (specificities in the task-5 report, fix round 1). */
.ledger-statement__table { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.ledger-statement__table th, .ledger-statement__table td { padding: .5rem 1rem; border-bottom: 1px solid var(--app-border); vertical-align: top; }
.ledger-statement__table thead th { font-size: .875rem; font-weight: 600; color: var(--app-muted); text-align: right; white-space: nowrap; }
.ledger-statement__table tbody th { font-weight: 400; text-align: left; }
.ledger-statement__table td { text-align: right; white-space: nowrap; }
/* The three amount columns shrink to their widest figure (width 1% with no wrapping: an auto-layout table gives such a column its content
   width and no more), so the label column takes all the rest; with two statements side by side (about 561px each at a 1440px window) a fixed
   9.5rem left the labels about 100px. The amount headers (the only `thead th`) never wrap either. */
.ledger-statement__table thead th, .ledger-statement__table tbody td { width: 1%; white-space: nowrap; }
.ledger-statement__table tbody tr:last-child > * { border-bottom: 0; }
.ledger-statement__table tr.ledger-statement__heading > th { padding-top: .75rem; font-weight: 600; }
.ledger-statement__table tr.ledger-statement__sub > th { padding-left: 3.5rem; color: var(--app-muted); font-size: .875rem; }
.ledger-statement__table tr.ledger-statement__sub > td { color: var(--app-muted); font-size: .875rem; }
.ledger-statement__table tr.ledger-statement__total > * { font-weight: 500; }
.ledger-statement__table tr.ledger-statement__net > * { font-weight: 600; }
.ledger-statement__table tbody tr.ledger-statement__total > td, .ledger-statement__table tbody tr.ledger-statement__net > td { border-top: 1px solid var(--app-muted); }
.ledger-statement__table tbody tr:has(+ tr.ledger-statement__total) > td, .ledger-statement__table tbody tr:has(+ tr.ledger-statement__net) > td { border-bottom-color: transparent; }
.ledger-statement__table tbody tr.ledger-statement__net > td { border-bottom: 3px double var(--app-text); }
/* The colours and icons of the owner's reference picture (2026-11-12, decision 0040 item 15), on the statement and the comparison alike;
   the rules above (the hairlines, the rule over a total, the double rule under Net) stay as they were.
   - The header row on a faint tint; its first cell (Item) left-aligned and taking the label column's width.
   - An icon before the labels of the eight rows that sum (Sales, Less: Cost of services, Gross profit, the two section headings and
     their totals, Net), in the series' colours: 1rem, so the label column grows by 1.5rem with its gap; a category or bad-debt line
     under them steps in one rem further than their text (3.5rem). Hidden on a phone (below), where the label column is narrow.
   - Gross profit on a faint purple, Net on a faint green; the last column (Total) on a faint primary tint for its whole height (a
     section heading leaves its own empty cell there), its header and its Sales, Gross profit and Net figures bold in the primary
     colour. A row's tint outranks the column's (more specific), so the Gross profit and Net cells keep their row's colour. */
.ledger-statement__table thead th { background-color: color-mix(in srgb, var(--app-secondary) 7%, transparent); }
.ledger-statement__table thead th.ledger-statement__item { width: auto; text-align: left; }
.ledger-statement__table tr > :last-child { background-color: color-mix(in srgb, var(--app-primary) 5%, transparent); }
.ledger-statement__table thead tr > th:last-child { color: var(--app-primary); background-color: color-mix(in srgb, var(--app-primary) 9%, transparent); }
.ledger-statement__table tbody tr[data-row="gross"] > * { background-color: color-mix(in srgb, var(--bs-purple) 7%, transparent); }
.ledger-statement__table tbody tr[data-row="net"] > * { background-color: color-mix(in srgb, var(--bs-success) 9%, transparent); }
.ledger-statement__table tr[data-row="sales"] > td:last-child, .ledger-statement__table tr[data-row="gross"] > td:last-child, .ledger-statement__table tr[data-row="net"] > td:last-child { font-weight: 700; color: var(--app-primary); }
.ledger-statement__table tbody th > .icon { width: 1rem; height: 1rem; margin-right: .5rem; vertical-align: -.15em; }
.ledger-statement__table tr[data-row="sales"] > th > .icon { color: var(--app-primary); }
.ledger-statement__table tr[data-row="cost"] > th > .icon, .ledger-statement__table tr[data-row="gross"] > th > .icon { color: var(--bs-purple); }
.ledger-statement__table tr[data-row="income-head"] > th > .icon, .ledger-statement__table tr[data-row="income-total"] > th > .icon, .ledger-statement__table tr[data-row="net"] > th > .icon { color: var(--bs-success); }
.ledger-statement__table tr[data-row="expense-head"] > th > .icon, .ledger-statement__table tr[data-row="expense-total"] > th > .icon { color: var(--app-accent); }
.ledger-statement__note { margin: .5rem 0 0; font-size: .8125rem; color: var(--app-muted); }
.ledger-statement__note > .icon { width: 1rem; height: 1rem; margin-right: .375rem; vertical-align: -.2em; }
/* On a phone the three amount columns stay, shrunk to their content by the rule above; the label column wraps. Only the side padding
   narrows, so the headings keep their top padding. */
@media (max-width: 575.98px) {
  .ledger-statement__table th, .ledger-statement__table td { padding-left: .5rem; padding-right: .5rem; font-size: .875rem; }
  .ledger-statement__table tr.ledger-statement__sub > th { padding-left: 1rem; }
  .ledger-statement__table tbody th > .icon { display: none; }
}
/* The period comparison (spec 2026-11-12 §7 and §8, decision 0040): one section per currency, stacked (a chart needs the width), each with
   the statement's head and table and, between them, the chart. The chart is inline SVG drawn twice (decision 0040 item 14; the owner's
   walk, round 1: a chart narrower than the table leaned left), and the screen's width shows one drawing:
   - from 1200px (Bootstrap's xl) the wide drawing, viewBox 1120 × 280, at the full width of the chart box. The box's side margins (1rem)
     are the table cells' side padding, so the drawing spans the table's text edges: the axis labels start at the label column's text and
     the gridlines end at the Total column's figures. Its text is 16 units (15.8px at 1105px wide, 12.9px at 900px);
   - below 1200px the compact drawing, viewBox 640 × 240, at most 48rem wide and centred (so at most 768px wide; on a phone the box loses
     its side margins and is about 290 to 340px wide), the legend centred at the same width. Its text is 13 units on a desktop (15.6px at
     768px, 10.4px at 512px), 25 for every chart text on a phone (11.3px at 290px; the axis gutter of ledger-compare.js is sized for it);
     on a phone the compact x headings replace the full ones and the bar amounts drop their currency code.
   Text sizes are in viewBox units, rendered at units × width / viewBox width px. A single period's chart has bars, each with its series
   name by the zero line, and its period as a caption above. Strokes keep their pixel width at any scale. Colour only carries the
   series: sales primary, cost of services purple (the owner's reference picture, decision 0040 item 15; it was muted, and a zero cost
   line melted into the zero line), expenses accent, Net success and dashed; a line chart fills a faint area under Sales and under Net
   (down to the zero line, or up to it below zero); gridlines faint, the zero line a little stronger. */
.ledger-compare-list { display: grid; gap: 1rem; margin-top: 1.5rem; }
.ledger-compare-none { margin: 1.5rem 0 0; color: var(--app-muted); }
.ledger-chart-box { margin: .25rem 1rem 1rem; }
.ledger-chart__period { margin: 0 0 .25rem; font-size: .8125rem; color: var(--app-muted); text-align: center; }
.ledger-chart { display: block; width: 100%; height: auto; overflow: visible; font-variant-numeric: tabular-nums; }
.ledger-chart--wide { display: none; }
.ledger-chart--compact, .ledger-chart-box > .ledger-chart__legend { max-width: 48rem; margin-left: auto; margin-right: auto; }
.ledger-chart text { font-size: 13px; fill: var(--app-muted); }
.ledger-chart--wide text { font-size: 16px; }
.ledger-chart .ledger-chart__value { fill: var(--app-text); }
.ledger-chart__x--short, .ledger-chart__value--short { display: none; }
/* Faint by stroke-opacity, not by color-mix: a browser without color-mix would drop the stroke and the lines would vanish. */
.ledger-chart__grid { stroke: var(--app-border); stroke-opacity: .7; stroke-width: 1; vector-effect: non-scaling-stroke; }
.ledger-chart__grid--zero { stroke: var(--app-muted); stroke-opacity: .45; }
.ledger-chart__area { stroke: none; fill-opacity: .1; }
.ledger-chart__area--sales { fill: var(--app-primary); }
.ledger-chart__area--net { fill: var(--bs-success); }
.ledger-chart__line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ledger-chart__line--dashed { stroke-dasharray: 6 4; }
.ledger-chart__point { stroke: var(--app-surface); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.ledger-chart__line--sales { stroke: var(--app-primary); }
.ledger-chart__line--cost { stroke: var(--bs-purple); }
.ledger-chart__line--expenses { stroke: var(--app-accent); }
.ledger-chart__line--net { stroke: var(--bs-success); }
.ledger-chart__point--sales, .ledger-chart__bar--sales { fill: var(--app-primary); }
.ledger-chart__point--cost, .ledger-chart__bar--cost { fill: var(--bs-purple); }
.ledger-chart__point--expenses, .ledger-chart__bar--expenses { fill: var(--app-accent); }
.ledger-chart__point--net, .ledger-chart__bar--net { fill: var(--bs-success); }
/* The legend under the chart: per series a short line with a round dot on its middle, like a line with its marker (the reference
   picture), Net's line dashed like its line. The dot is placed on the line's middle: the line is the key's first flex item, 1.5rem
   wide from its left edge, the dot .5rem wide at .5rem, both centred on the key's height. */
.ledger-chart__legend { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: .5rem 0 0; padding: 0; list-style: none; font-size: .8125rem; color: var(--app-muted); }
.ledger-chart__key { position: relative; display: inline-flex; align-items: center; gap: .375rem; }
.ledger-chart__key::before { content: ''; width: 1.5rem; border-top: 2px solid currentColor; }
.ledger-chart__key::after { content: ''; position: absolute; left: .5rem; top: 50%; width: .5rem; height: .5rem; margin-top: -.25rem; border-radius: 50%; background-color: currentColor; }
.ledger-chart__key--sales::before { border-top-color: var(--app-primary); }
.ledger-chart__key--cost::before { border-top-color: var(--bs-purple); }
.ledger-chart__key--expenses::before { border-top-color: var(--app-accent); }
.ledger-chart__key--net::before { border-top: 2px dashed var(--bs-success); }
.ledger-chart__key--sales::after { background-color: var(--app-primary); }
.ledger-chart__key--cost::after { background-color: var(--bs-purple); }
.ledger-chart__key--expenses::after { background-color: var(--app-accent); }
.ledger-chart__key--net::after { background-color: var(--bs-success); }
/* The comparison table is the statement's (same classes); its period columns shrink to their content like the statement's amount columns
   (the shared `thead th, tbody td` rule); with many periods the table scrolls sideways in its wrapper. */
@media (max-width: 575.98px) {
  .ledger-chart-box { margin-left: 0; margin-right: 0; }
  .ledger-chart text { font-size: 25px; }
  .ledger-chart__x--full, .ledger-chart__value--full { display: none; }
  .ledger-chart__x--short, .ledger-chart__value--short { display: inline; }
  .ledger-chart__point { r: 7px; }
}
@media (min-width: 1200px) {
  .ledger-chart--wide { display: block; }
  .ledger-chart--compact { display: none; }
  .ledger-chart-box > .ledger-chart__legend { max-width: none; }
}
/* The view switch and the quick ranges (spec 2026-11-12 §3, §4). The quick-range links close the filter panel under a hairline, in a row
   that wraps on a narrow screen: small rounded pills (Bootstrap's rounded-pill), the chosen one solid primary (ledger.js).
   The tabs (Bootstrap's nav-tabs through its variables; the owner's reference picture, decision 0040 item 15): each label after its icon;
   the current tab a raised tab, the card's surface with the card's border, a primary accent along its top, joined to the first results
   card under it; the other tab plain muted text. The tab row has no line of its own: the current tab's bottom (Bootstrap's -1px margin,
   raised above the card) covers the card's top border beneath it, and that card's top-left corner is square under the first tab. With
   no card under the tabs (no row, or a range over a year) the results keep their gap. */
.ledger-quick { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--app-border); }
.ledger-quick__label { font-size: .875rem; color: var(--app-muted); }
.ledger-tabs { margin-top: 1.5rem; border-bottom: 0; --bs-nav-tabs-border-color: var(--app-card-border); --bs-nav-tabs-link-hover-border-color: transparent; --bs-nav-tabs-link-active-color: var(--app-primary); --bs-nav-tabs-link-active-bg: var(--app-surface); --bs-nav-tabs-link-active-border-color: var(--app-card-border) var(--app-card-border) var(--app-surface); }
.ledger-tabs .nav-link { display: inline-flex; align-items: center; gap: .5rem; color: var(--app-muted); }
.ledger-tabs .nav-link:hover { color: var(--app-primary); }
.ledger-tabs .nav-link.active { position: relative; z-index: 1; font-weight: 600; box-shadow: inset 0 3px 0 var(--app-primary); }
.ledger-tabs .nav-link > .icon { width: 1rem; height: 1rem; }
.ledger-tabs + .ledger-statements, .ledger-tabs + .ledger-compare-list { margin-top: 0; }
.ledger-tabs + .ledger-statements > .ledger-statement:first-child, .ledger-tabs + .ledger-compare-list > .ledger-statement:first-child { border-top-left-radius: 0; }
.ledger-tabs + .ledger-compare-none, .ledger-tabs + .ledger-entries { margin-top: 1rem; }
/* The entries panel; a manual row's small mark; a voided row muted. */
.ledger-entries { margin-top: 1.5rem; margin-bottom: 1rem; }
.ledger-manual-mark { display: inline-block; margin-left: .25rem; padding: .125rem .375rem; border-radius: var(--app-radius); font-size: .75rem; font-weight: 500; line-height: 1.2; vertical-align: .0625rem; color: var(--app-primary); background-color: var(--bs-primary-bg-subtle); }
/* Bootstrap colours each cell itself (`.table > :not(caption) > * > *`, specificity (0,1,1)), so the muted colour is set on the cells and the
   date link (here (0,2,1) and (0,2,2)); the Void badge keeps its own colours (text-bg-secondary). */
.list-panel__table tr.ledger-row--void > *, .list-panel__table tr.ledger-row--void a { color: var(--app-muted); }

/* A detail page's header buttons (decision 0041, the owner 2026-11-12: the outline buttons on the grey header were easy to miss). Every
   button has its icon before the word; the ways elsewhere (a company's Projects and Ledger, a document's Preview and Download PDF) are soft
   primary; Edit is solid primary; Deactivate stays a quiet red outline on purpose. A thin divider stands between the ways elsewhere and the
   page's own buttons; on a narrow screen the row wraps (record-detail.js, layout.js DETAIL_ACTIONS_CLASS). The divider is the muted text
   colour, thinned: the card header it stands on is itself --app-border (app.css), so a line of that colour would not show. */
.detail-actions .btn { gap: .375rem; }
.detail-actions .btn > .icon { width: 1rem; height: 1rem; }
.detail-actions__divider { align-self: stretch; width: 1px; margin: .375rem .125rem; background-color: var(--app-muted); opacity: .45; }
.btn-soft-primary {
  --bs-btn-color: var(--bs-primary-text-emphasis);
  --bs-btn-bg: var(--bs-primary-bg-subtle);
  --bs-btn-border-color: var(--bs-primary-border-subtle);
  --bs-btn-hover-color: var(--bs-primary-text-emphasis);
  --bs-btn-hover-bg: color-mix(in srgb, var(--bs-primary) 28%, transparent);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--bs-primary) 55%, transparent);
  --bs-btn-active-color: var(--bs-primary-text-emphasis);
  --bs-btn-active-bg: color-mix(in srgb, var(--bs-primary) 36%, transparent);
  --bs-btn-active-border-color: color-mix(in srgb, var(--bs-primary) 65%, transparent);
  --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
.btn-soft-primary:focus-visible { background-color: color-mix(in srgb, var(--bs-primary) 28%, transparent); border-color: color-mix(in srgb, var(--bs-primary) 55%, transparent); }
/* company overview (spec 2026-11-12; COV-009 … COV-016) */
.company-overview, .company-ledger-summary { margin-bottom: 1rem; }
.company-overview__row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.company-overview__row--todo { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: .75rem; }
.company-overview__tile { display: flex; flex-direction: row; align-items: center; gap: .75rem; padding: .75rem 1rem; border: 1px solid var(--app-border); border-radius: var(--app-radius); background-color: var(--app-surface); color: var(--app-text); text-decoration: none; }
.company-overview__tile:hover, .company-overview__tile:focus-visible { border-color: var(--app-primary); background-color: var(--bs-primary-bg-subtle); }
.company-overview__tile--empty { color: var(--app-muted); cursor: default; }
.company-overview__tile--empty:hover { border-color: var(--app-border); background-color: var(--app-surface); }
.company-overview__tile--warn { border-color: var(--bs-warning-border-subtle); background-color: var(--bs-warning-bg-subtle); }
.company-overview__icon { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: var(--app-radius); background-color: color-mix(in srgb, var(--app-primary) 10%, transparent); color: var(--app-primary); }
.company-overview__icon > .icon { width: 1.25rem; height: 1.25rem; }
.company-overview__icon--unpaid { background-color: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
.company-overview__icon--drafts, .company-overview__tile--empty .company-overview__icon { background-color: var(--bs-tertiary-bg); color: var(--app-muted); }
.company-overview__text { display: flex; flex-direction: column; min-width: 0; }
.company-overview__label { font-size: .875rem; color: var(--app-muted); }
.company-overview__figure { font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
.company-overview__amounts { display: flex; flex-wrap: wrap; gap: .25rem .75rem; }
.company-overview__amount { font-size: 1.25rem; font-weight: 600; white-space: nowrap; }
.company-overview__sub { font-size: .8125rem; color: var(--app-muted); }
.company-ledger-summary__head { display: flex; align-items: center; gap: .75rem; cursor: pointer; list-style: none; }
.company-ledger-summary__head::-webkit-details-marker { display: none; }
.company-ledger-summary__head::after { content: ""; flex-shrink: 0; margin-left: auto; width: .5rem; height: .5rem; border-right: 2px solid var(--app-muted); border-bottom: 2px solid var(--app-muted); transform: rotate(45deg); transition: transform .15s; }
.company-ledger-summary[open] > .company-ledger-summary__head::after { transform: rotate(-135deg); }
.company-ledger-summary__head > h2 { display: inline-flex; align-items: center; gap: .5rem; }
.company-ledger-summary__head > h2 > .icon { width: 1.25rem; height: 1.25rem; color: var(--app-primary); }
.company-ledger-summary__period { font-size: .875rem; color: var(--app-muted); }
.company-ledger-summary__body { padding: 1rem; }
.company-ledger-summary:not([open]) .company-ledger-summary__body { display: none; }
.company-ledger-summary__currency + .company-ledger-summary__currency { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--app-border); }
.company-ledger-summary__meta { display: flex; flex-wrap: wrap; gap: .5rem .75rem; margin: 0 0 1rem; }
.company-ledger-summary__block { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-bottom: 1rem; }
.company-ledger-summary__block > .company-ledger-summary__table { flex: 1 1 18rem; min-width: 0; max-width: 34rem; margin-bottom: 0; border: 1px solid var(--app-border); border-radius: var(--app-card-radius, var(--app-radius)); overflow: hidden; border-collapse: separate; border-spacing: 0; }
.company-ledger-summary__table th, .company-ledger-summary__table td { padding: .75rem 1rem; border-bottom: 1px solid var(--app-border); }
.company-ledger-summary__table th > .icon { width: 1.25rem; height: 1.25rem; margin-right: .625rem; color: var(--app-primary); vertical-align: -.2em; }
.company-ledger-summary__total th, .company-ledger-summary__total td { font-weight: 600; }
.company-ledger-summary__net th, .company-ledger-summary__net td { background-color: color-mix(in srgb, var(--app-primary) 10%, transparent); border-bottom: 0; font-weight: 700; font-size: 1.125rem; }
.company-ledger-summary__table td.company-ledger-summary__negative { color: var(--bs-danger); }
.company-ledger-summary__chart { flex: 1 1 20rem; min-width: 0; max-width: 40rem; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin: 0; }
.company-ledger-summary__bars { flex: 1 1 14rem; min-width: 0; max-width: 22rem; height: auto; }
.company-ledger-summary__bars text { font-size: 11px; fill: var(--app-muted); font-variant-numeric: tabular-nums; }
.company-ledger-summary__legend { flex: 1 1 12rem; min-width: 0; display: flex; flex-direction: column; gap: .5rem; margin: 0; padding: 0; list-style: none; font-size: .875rem; color: var(--app-muted); }
.company-ledger-summary__key { display: flex; align-items: center; gap: .5rem; }
.company-ledger-summary__key-name { flex: 1 1 auto; }
.company-ledger-summary__key-amount { margin-left: auto; color: var(--app-text); }
.company-ledger-summary__key::before { content: ''; flex: 0 0 auto; width: .625rem; height: .625rem; border-radius: 50%; }
.company-ledger-summary__key--sales::before { background-color: var(--app-primary); }
.company-ledger-summary__key--cost::before { background-color: var(--bs-purple); }
.company-ledger-summary__key--expenses::before { background-color: var(--app-accent); }
.company-ledger-summary__footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin-top: 1.25rem; padding-top: .75rem; border-top: 1px solid var(--app-border); }
.company-ledger-summary__footer > .ledger-statement__note { margin: 0; }
.company-ledger-summary__actions { display: flex; margin: 0 0 0 auto; }
.company-ledger-summary__actions > .btn { display: inline-flex; align-items: center; gap: .375rem; }
@media (max-width: 575.98px) {
  .company-overview__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .company-overview__row--todo { grid-template-columns: minmax(0, 1fr); }
}
/* chart tooltip (walk round 3; COV-018, LED-056): the hit shapes drawn over chart marks, and the one floating label chart-tip.js shows */
.chart-hit { fill: transparent; pointer-events: all; }
.chart-hit:hover { fill: color-mix(in srgb, var(--app-primary) 6%, transparent); }
.chart-tip { position: fixed; z-index: 1080; left: 0; top: 0; max-width: 20rem; padding: .25rem .5rem; border-radius: var(--app-radius); background-color: var(--app-text); color: var(--app-surface); font-size: .8125rem; line-height: 1.3; font-variant-numeric: tabular-nums; white-space: pre-line; pointer-events: none; box-shadow: var(--app-shadow); }
.chart-tip[hidden] { display: none; }
/* getting-started (decision 0049): a done step's count ("3 exist") stays whole on one line at the row's right end. Some reasons now run to
   three sentences, and without this the count is the part of the row that gives way and breaks in two. Only the count: the blocked
   sentence in the same place is long and wraps. */
.getting-started__number ~ .text-end:has(> .small > .numeric) {
  flex: none;
  white-space: nowrap;
}
