/* SPDX-FileCopyrightText: Vernum Projecten B.V.
 * SPDX-License-Identifier: Apache-2.0
 *
 * The palette of the house style (docs/huisstijl.md), the one source of a
 * brand colour. Every token carries a `safe:` claim: what it may be used
 * for, on which ground. WCAG 2.2 asks 4.5:1 for running text and 3:1 for a
 * graphic element or large text; scripts/checks/brand-contrast.sh measures
 * every token against the two grounds and fails on a claim that no longer
 * holds. A meaning colour (goed, let op, fout) is no brand colour and is
 * defined per surface, never here. The Dutch name of each colour, which is
 * what the owner reads, stands beside it in docs/huisstijl.md section 4. */
:root {
  --branding-mist: #F5F4EF;       /* the light ground; safe: ground-light */
  --branding-ink: #15201B;        /* ink and the dark ground; safe: text-on-light ground-dark */
  --branding-foliage: #1E5A44;    /* the brand green: the tile, headings, links; safe: text-on-light graphic-on-light */
  --branding-leaf: #7FBF9E;       /* the green on dark; safe: text-on-dark graphic-on-dark */
  --branding-gold: #A67C1F;       /* the accent on light: the balance point, a total row, a seal; safe: graphic-on-light graphic-on-dark */
  --branding-gold-light: #D9B44A; /* the accent on dark and on the tile; safe: text-on-dark graphic-on-dark */
  --branding-slate: #586560;      /* muted text on light; safe: text-on-light */
  --branding-haze: #A7B1AB;       /* muted text on dark; safe: text-on-dark graphic-on-dark */
  --branding-silver: #D8DAD4;     /* rules and borders on light; safe: rule */
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/activa/inter-693b77d4f32ee9b8.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/activa/inter-italic-e564f652916db6c1.woff2") format("woff2");
}
/* SPDX-FileCopyrightText: Vernum Projecten B.V.
 * SPDX-License-Identifier: Apache-2.0
 *
 * The tokens, the layout helpers and the components every screen is built
 * from (#2198). src/assets.rs serves this file after assets/brand/tokens.css
 * and the faces of the font, as one stylesheet. A screen composes the
 * components of src/views/component and the layout helpers below;
 * tests/it/components.rs refuses a class a template uses that this file does
 * not define (#2331).
 *
 * The look is the one the owner approved on 2026-10-10. Every colour is a
 * token: the brand colours come from assets/brand/tokens.css, the three
 * meaning colours are the ones docs/huisstijl.md section 4 leaves to the
 * screen (on mist, let op #7A4E0A is 6,53:1 and fout #8E1C1C is 8,17:1; on
 * ink, fout #EFA0A0 is 8,14:1, and goed and let op take leaf and gold-light),
 * and every tint is a mix of one of those with the surface, so the dark
 * theme follows from the same lines. */

/* Tokens. Three themes, and the person picks which one (docs/schermen.md).
 * The html element carries the choice as data-theme; without a cookie it
 * reads "systeem" and the screen follows the machine. The dark values stand
 * twice, because CSS has no way to put one block under two conditions: once
 * for the machine that reports dark where the person did not choose light,
 * once for the choice of dark. */
:root {
  color-scheme: light;

  /* Spacing on a scale of 4 px. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* The height of one control in a row of controls: a chip, a step, the
   * button of the period picker and the search field. */
  --control-height: 2.25rem;

  /* Radii: a field, a control, a tile, a card, a pill and a sheet. */
  --radius-field: 6px;
  --radius-control: 8px;
  --radius-tile: 12px;
  --radius-card: 14px;
  --radius-pill: 999px;
  --radius-paper: 6px;

  /* Type sizes, from the label in capitals to the title of a page. */
  --text-label: 11.5px;
  --text-small: 12.5px;
  --text-control: 13px;
  --text-body: 14px;
  --text-base: 16px;
  --text-figure: 24px;
  --text-title: 26px;

  /* Shadows: a raised control, an open menu and a sheet of paper. */
  --shadow-raised: 0 1px 2px rgb(0 0 0 / 4%);
  --shadow-menu: 0 10px 30px rgb(0 0 0 / 12%);
  --shadow-paper: 0 2px 8px rgb(0 0 0 / 5%);

  /* Colours. */
  --ground: var(--branding-mist);
  --text: var(--branding-ink);
  --brand: var(--branding-foliage);
  --brand-text: var(--branding-mist);
  --muted: var(--branding-slate);
  --rule: var(--branding-silver);
  --accent: var(--branding-gold);
  --good: var(--branding-foliage);
  --warning: #7a4e0a;
  --error: #8e1c1c;
  --error-text: #ffffff;
  --info: var(--branding-slate);
  /* The ground of a card, white on mist. */
  --surface: #ffffff;
  /* The tints a component is filled with, each a mix with the surface. */
  --surface-muted: color-mix(in srgb, var(--ground) 55%, var(--surface));
  --surface-soft: color-mix(in srgb, var(--brand) 8%, var(--surface));
  --rule-soft: color-mix(in srgb, var(--rule) 55%, var(--surface));
  --good-tint: color-mix(in srgb, var(--good) 9%, var(--surface));
  --warning-tint: color-mix(in srgb, var(--warning) 10%, var(--surface));
  --error-tint: color-mix(in srgb, var(--error) 10%, var(--surface));
  --info-tint: color-mix(in srgb, var(--muted) 9%, var(--surface));
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: var(--branding-ink);
    --text: var(--branding-mist);
    --brand: var(--branding-leaf);
    --brand-text: var(--branding-ink);
    --muted: var(--branding-haze);
    /* haze at 30% opacity, the one rule colour on dark. */
    --rule: rgb(167 177 171 / 30%);
    --accent: var(--branding-gold-light);
    --good: var(--branding-leaf);
    --warning: var(--branding-gold-light);
    --error: #efa0a0;
    --error-text: var(--branding-ink);
    --info: var(--branding-haze);
    --surface: color-mix(in srgb, var(--branding-mist) 6%, var(--branding-ink));
    --shadow-raised: 0 1px 2px rgb(0 0 0 / 30%);
    --shadow-menu: 0 10px 30px rgb(0 0 0 / 45%);
    --shadow-paper: 0 2px 8px rgb(0 0 0 / 30%);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: var(--branding-ink);
  --text: var(--branding-mist);
  --brand: var(--branding-leaf);
  --brand-text: var(--branding-ink);
  --muted: var(--branding-haze);
  --rule: rgb(167 177 171 / 30%);
  --accent: var(--branding-gold-light);
  --good: var(--branding-leaf);
  --warning: var(--branding-gold-light);
  --error: #efa0a0;
  --error-text: var(--branding-ink);
  --info: var(--branding-haze);
  --surface: color-mix(in srgb, var(--branding-mist) 6%, var(--branding-ink));
  --shadow-raised: 0 1px 2px rgb(0 0 0 / 30%);
  --shadow-menu: 0 10px 30px rgb(0 0 0 / 45%);
  --shadow-paper: 0 2px 8px rgb(0 0 0 / 30%);
}

/* Base: the elements every page carries before a component dresses them,
 * the scale of docs/huisstijl.md sections 5 to 7. A component sets its own
 * look with a class, which outranks every rule of this block. */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--ground);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

main {
  padding: var(--space-8) var(--space-6) var(--space-12);
}

p {
  max-width: 68ch;
}

a {
  color: var(--brand);
}

h1 {
  margin: 0 0 var(--space-6);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
}

h2 {
  margin: var(--space-8) 0 var(--space-3);
  font-size: 24px;
  font-weight: 600;
}

h3 {
  margin: var(--space-6) 0 var(--space-2);
  font-size: 20px;
  font-weight: 600;
}

/* A heading of one long compound, such as the name of the investment
 * deduction, breaks inside the word where the column is narrower than the
 * word, so it never pushes the page sideways (docs/schermen.md). */
h1,
h2,
h3 {
  overflow-wrap: break-word;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}

tbody td,
tbody th {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--rule);
  font-weight: 400;
  text-align: left;
  vertical-align: top;
}

caption {
  margin-bottom: var(--space-2);
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

form {
  margin: 0 0 var(--space-6);
}

fieldset {
  margin: 0 0 var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-field);
}

legend {
  padding: 0 var(--space-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input,
select,
textarea {
  padding: var(--space-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-field);
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

/* A button that carries none of the classes of the button component, such
 * as the one Enter presses in a form, still reads as a button (#2200). */
button:not(.btn) {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--brand);
  border-radius: var(--radius-field);
  background: none;
  color: var(--brand);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
}

/* The icons (docs/huisstijl.md section 7). The sprite with the symbols
 * stands at the top of every page and is never drawn itself; every icon
 * stands beside a text label, takes the text colour and is 20 px, at a
 * stroke width of 1.5 so it stays lighter than the text beside it. */
.icons {
  display: none;
}

.icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
}

/* The search field the script puts before a long select (#1677). */
.choice-search {
  display: block;
  margin-bottom: var(--space-2);
}

/* Fact list: names and their values as a grid, a name in the first column
 * and every value of it in the last, so a second value under one name
 * stays under the first. The value column is `minmax(0, 1fr)` and a value
 * breaks anywhere, so a long address, key or digest wraps inside it and
 * never pushes the page sideways; the name column takes at most half the
 * list (#1703). */
.fact-list {
  display: grid;
  grid-template-columns: fit-content(50%) minmax(0, 1fr);
  gap: var(--space-1) var(--space-4);
  margin: 0 0 var(--space-4);
  font-size: var(--text-body);
}

.fact-list dt {
  grid-column: 1;
  color: var(--muted);
  font-weight: 500;
}

.fact-list dd {
  grid-column: -2;
  margin: 0;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* Layout helpers. A screen lays its components out with these and with
 * nothing of its own: two equal columns, three equal columns, a wide
 * column beside a narrow one, and a block of its own under a heading. Each
 * falls to one column under 60 rem. */
.layout-2,
.layout-3,
.layout-side {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.layout-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.layout-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.layout-side {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}

/* A narrow column of facts before the wide column of what plays, such as
 * the details of a relation beside its figures and its documents. */
.layout-aside {
  display: grid;
  grid-template-columns: minmax(16rem, 19rem) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
  margin-bottom: var(--space-4);
}

/* A document beside the fields read from it: the sheet a little narrower
 * than the form, so a row of lines keeps its columns. */
.layout-document {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.layout-section {
  margin: 0 0 var(--space-8);
}

/* One column of a layout whose blocks stand one under the other with the
 * gap of the layout between them. */
.layout-stack {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: var(--space-4);
}

.layout-section > h2 {
  margin: 0 0 var(--space-3);
  font-size: 15px;
  font-weight: 650;
}

@media (max-width: 60rem) {
  .layout-2,
  .layout-3,
  .layout-side,
  .layout-aside,
  .layout-document {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* A table wider than its column scrolls inside this frame, so the page
 * never scrolls sideways (#1234). The frame also holds what a cell places
 * absolutely, such as the hidden words of a copy button, which would
 * otherwise widen the page from outside it. */
.table-scrolls {
  position: relative;
  overflow-x: auto;
}

/* A button a form carries for Enter alone, such as the copy of its saving
 * verb at its top, stays out of sight whatever draws buttons; the second
 * selector outweighs the base rule of a button without a class. */
button[hidden],
button[hidden]:not(.btn) {
  display: none;
}

/* A text a screen reader reads and the screen does not show. */
.hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Button: the one action of a screen in the brand colour, every other one
 * outlined on the surface, an action that undoes something in the colour of
 * an error, and a way on that reads as a link. A link and a submit button
 * look the same. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-2) 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-control);
  font-weight: 550;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn:hover,
.btn:focus-visible {
  border-color: var(--brand);
}

.btn.btn-secondary {
  border-color: var(--rule);
  background: var(--surface);
  color: var(--text);
}

.btn.btn-primary {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--brand-text);
}

.btn.btn-danger {
  border-color: var(--error);
  background: var(--error);
  color: var(--error-text);
}

.btn.btn-link {
  padding-right: 0;
  padding-left: 0;
  border-color: transparent;
  background: none;
  color: var(--brand);
  font-weight: 600;
}

.btn.btn-link:hover,
.btn.btn-link:focus-visible {
  border-color: transparent;
  text-decoration: underline;
}

/* A button with a form of its own stands where a link would, so its form
 * takes no room of its own. */
.inline-form {
  display: inline-flex;
  margin: 0;
}

/* Copy field: a value the reader copies into another program, as text the
 * reader selects, with the button that copies it beside it. The button
 * needs the script, so it is hidden where the script did not run, and it
 * says it copied once the value stands on the clipboard. */
.copy-field {
  display: grid;
  min-width: 0;
}

.copy-field-box {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.copy-field-box > code {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  overflow-wrap: anywhere;
  user-select: all;
}

:root:not([data-script]) .copy-field-button,
.copy-field-done,
.copy-field-button[data-copied] .copy-field-idle {
  display: none;
}

.copy-field-button[data-copied] .copy-field-done {
  display: inline;
}

/* A figure of a list of concepts with its copy button beside it, without
 * the frame of a field, so the column keeps the width of its figures and
 * the button stays the one control of the cell. */
.concept-copy {
  display: inline-flex;
  justify-content: flex-end;
  padding: 0;
  border: none;
  background: none;
}

.concept-copy .copy-field-button {
  min-height: 0;
  padding: 2px var(--space-2);
}

/* A row of buttons or pills beside one another, wrapping where it must. */
.layout-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* Pill: the standing of a row, always with the word in it and never colour
 * alone. It is filled with a tint of its meaning colour and the word keeps
 * that colour; a standing that asks nothing of the reader stays grey. */
.pill {
  display: inline-block;
  white-space: nowrap;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--info-tint);
  color: var(--text);
  font-size: var(--text-label);
  font-weight: 650;
  line-height: 1.5;
}

.pill.good {
  background: var(--good-tint);
  color: var(--good);
}

.pill.warning {
  background: var(--warning-tint);
  color: var(--warning);
}

.pill.error {
  background: var(--error-tint);
  color: var(--error);
}

.pill.info {
  background: var(--info-tint);
  color: var(--info);
}

/* Notice: one sentence over the page after an action, in the tint of its
 * meaning, with the drawing of that meaning in its colour in front: a check
 * for done, a triangle for look out, a cross for not done and why, an i for
 * a fact. A notice that may be put away carries a link to the same page
 * without it. */
.notice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: none;
  margin: 0 0 var(--space-2);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--info-tint);
  color: var(--text);
  font-size: var(--text-body);
  line-height: 1.45;
}

/* The session warning stands hidden until its script shows it, and the
 * display of a notice would undo that (#2457). */
.notice[hidden] {
  display: none;
}

.notice > .icon {
  align-self: flex-start;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--info);
}

.notice + :not(.notice) {
  margin-top: var(--space-4);
}

.notice.good {
  background: var(--good-tint);
}

.notice.good > .icon {
  color: var(--good);
}

.notice.warning {
  background: var(--warning-tint);
}

.notice.warning > .icon {
  color: var(--warning);
}

.notice.error {
  background: var(--error-tint);
}

.notice.error > .icon {
  color: var(--error);
}

.notice-link {
  color: var(--brand);
  font-weight: 600;
  white-space: nowrap;
}

.notice-dismiss {
  display: inline-flex;
  margin-left: auto;
  color: var(--muted);
}

.notice-dismiss .icon {
  width: 16px;
  height: 16px;
}

/* Remark: one muted sentence that says what the part around it holds or why
 * it offers nothing, with no tint because it asks nothing of the reader. */
.remark {
  max-width: 68ch;
  margin: 0 0 var(--space-3);
  color: var(--muted);
  font-size: var(--text-small);
}

/* Page head: the breadcrumb, the title with its pill and one sentence on
 * the left, the actions on the right; under 60 rem the actions wrap under
 * the title. */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: 22px;
}

.page-head-main {
  min-width: 0;
}

.page-head-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 6px;
  padding: 0;
  color: var(--muted);
  font-size: var(--text-small);
  list-style: none;
}

.page-head-crumbs li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-head-crumbs .icon {
  width: 14px;
  height: 14px;
}

.page-head-crumbs a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.page-head-body {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-head-text {
  min-width: 0;
}

.avatar.page-head-mark {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-tile);
  font-size: 17px;
}

.page-head-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.page-head-title h1,
.page-head-title h2 {
  margin: 0;
  font-size: var(--text-title);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-head-lead {
  max-width: 68ch;
  margin: var(--space-1) 0 0;
  color: var(--muted);
  font-size: var(--text-body);
}

.page-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* Dropdown: a menu behind a button, a details element, so it opens on a
 * click and on the keyboard without the script. */
.dropdown {
  position: relative;
}

.dropdown > summary {
  list-style: none;
}

.dropdown > summary::-webkit-details-marker {
  display: none;
}

.dropdown-panel {
  position: absolute;
  z-index: 5;
  top: calc(100% + var(--space-1));
  right: 0;
  min-width: 14rem;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-tile);
  background: var(--surface);
  box-shadow: var(--shadow-menu);
  list-style: none;
}

.dropdown-panel a {
  display: block;
  padding: var(--space-2) 10px;
  border-radius: var(--radius-control);
  color: var(--text);
  font-size: var(--text-control);
  text-decoration: none;
}

.dropdown-panel a:hover,
.dropdown-panel a:focus-visible {
  background: var(--surface-soft);
}

/* A panel of sentences, such as what a report explains of itself: wider,
 * so a sentence reads on a few lines, and never wider than the window. */
.dropdown-panel-text {
  width: 22rem;
  max-width: 80vw;
  padding: var(--space-2) 10px;
}

.dropdown-panel-text > p {
  margin: 0 0 var(--space-2);
  font-size: var(--text-control);
}

.dropdown-panel-text > p:last-child {
  margin-bottom: 0;
}

/* Stat card: a key figure on its card, the name above it, the figure large
 * and one line under it; a figure that asks something takes the colour of
 * its meaning. A row stands two to four cards side by side. */
.stat-row {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.stat-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-row-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 60rem) {
  .stat-row-3,
  .stat-row-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 30rem) {
  .stat-row-2,
  .stat-row-3,
  .stat-row-4 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.stat-card {
  padding: var(--space-4) 18px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 600;
}

.stat-label .icon {
  width: 16px;
  height: 16px;
}

.stat-card.good .stat-label .icon {
  color: var(--good);
}

.stat-card.warning .stat-label .icon {
  color: var(--warning);
}

.stat-card.error .stat-label .icon {
  color: var(--error);
}

.stat-figure {
  margin: 6px 0 0;
  font-size: var(--text-figure);
  font-variant-numeric: tabular-nums;
  font-weight: 680;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-foot {
  margin: var(--space-1) 0 0;
  color: var(--muted);
  font-size: var(--text-small);
}

.stat-card .bar-figure {
  margin: var(--space-3) 0 0;
}

.stat-card.good .stat-figure {
  color: var(--good);
}

.stat-card.warning .stat-figure {
  color: var(--warning);
}

.stat-card.error .stat-figure {
  color: var(--error);
}

/* Filter bar: the chips with their counts on the left, the one the list
 * stands under in ink, the switches beside them and the search at the
 * right. Every chip and switch is a link and the search a form, so the
 * server filters. */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.filter-chips ul,
.filter-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.filter-chip,
.filter-toggle {
  display: inline-flex;
  box-sizing: border-box;
  height: var(--control-height);
  align-items: center;
  gap: 6px;
  padding: 0 var(--space-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-control);
  font-weight: 550;
  text-decoration: none;
}

.filter-chip-count {
  color: var(--muted);
  font-weight: 600;
}

.filter-chip[aria-current="true"] {
  border-color: var(--text);
  background: var(--text);
  color: var(--ground);
}

.filter-chip[aria-current="true"] .filter-chip-count {
  color: var(--ground);
}

.filter-chip:hover,
.filter-chip:focus-visible,
.filter-toggle:hover,
.filter-toggle:focus-visible {
  border-color: var(--brand);
}

.filter-toggle.filter-toggle-on {
  border-color: var(--brand);
  background: var(--surface-soft);
  color: var(--brand);
}

.filter-bar > .period-picker {
  align-items: center;
  margin: 0;
}

/* A step of the period picker is a square chip with its drawing alone;
 * its name is its label and its title. */
.period-step {
  justify-content: center;
  width: var(--control-height);
  padding: 0;
}

@media (max-width: 48rem) {
  .filter-search {
    flex-basis: 100%;
  }
}

.filter-search {
  display: flex;
  flex: 1 1 14rem;
  align-items: center;
  gap: var(--space-2);
  min-width: 14rem;
  margin: 0 0 0 auto;
}

.filter-search-box {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.filter-search-submit {
  position: absolute;
  top: 50%;
  right: var(--space-1);
  display: inline-flex;
  padding: var(--space-1);
  border: 0;
  border-radius: var(--radius-field);
  background: none;
  color: var(--muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.filter-search-submit:hover,
.filter-search-submit:focus-visible {
  color: var(--brand);
}

.filter-search input {
  box-sizing: border-box;
  width: 100%;
  height: var(--control-height);
  padding: 0 36px 0 var(--space-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: var(--text-control);
}

.filter-search-clear {
  color: var(--brand);
  font-size: var(--text-small);
}

/* Period picker: the chip that states the chosen period, the panel behind
 * it over two fiscal years and the two steps beside it. Every choice is a
 * chip of the filter bar that links, and the panel is a details element, so
 * the picker works without the script (#2219). */
.period-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
}

.period-picker-button {
  cursor: pointer;
}

.period-picker-menu[open] > .period-picker-button {
  border-color: var(--brand);
}

.period-panel {
  position: absolute;
  z-index: 5;
  top: calc(100% + var(--space-1));
  left: 0;
  width: 44rem;
  max-width: calc(100vw - var(--space-8));
  padding: var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-tile);
  background: var(--surface);
  box-shadow: var(--shadow-menu);
}

.period-picker-open .period-panel {
  position: static;
  margin-top: var(--space-2);
  box-shadow: var(--shadow-raised);
}

.period-panel-heading {
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.period-year {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--rule);
}

/* The chip of a calendar year stretches under the quarters it holds and the
 * chip of the fiscal year under the whole block, as the last line, so the
 * length of a chip shows the months it covers. */
.period-year-whole {
  margin: var(--space-3) 0 0;
}

.period-year-whole .filter-chip,
.period-calendar-whole .filter-chip {
  display: flex;
  justify-content: center;
}

.period-from-1 {
  grid-column-start: 1;
}

.period-from-2 {
  grid-column-start: 2;
}

.period-from-3 {
  grid-column-start: 3;
}

.period-from-4 {
  grid-column-start: 4;
}

.period-to-1 {
  grid-column-end: 2;
}

.period-to-2 {
  grid-column-end: 3;
}

.period-to-3 {
  grid-column-end: 4;
}

.period-to-4 {
  grid-column-end: 5;
}

.period-calendar + .period-calendar {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--rule);
}

.period-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0 0 var(--space-2);
  padding: 0;
  list-style: none;
}

/* The four quarters of a calendar year stand in four columns, each quarter
 * in its own column whatever the fiscal year leaves out, with its chip over
 * the chips of its three months, so a reader sees which months it holds. */
.period-quarters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.period-quarter {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-1);
  border: 1px solid var(--rule);
  border-radius: var(--radius-tile);
  background: var(--surface-soft);
}

.period-quarter-1 {
  grid-column: 1;
}

.period-quarter-2 {
  grid-column: 2;
}

.period-quarter-3 {
  grid-column: 3;
}

.period-quarter-4 {
  grid-column: 4;
}

.period-quarter-months {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.period-month-1 {
  grid-column: 1;
}

.period-month-2 {
  grid-column: 2;
}

.period-month-3 {
  grid-column: 3;
}

.period-quarter .filter-chip {
  display: flex;
  justify-content: center;
}

.period-quarter-months .filter-chip {
  padding-right: 0;
  padding-left: 0;
}

.period-step {
  white-space: nowrap;
}

/* The two days of a period of your own and the button that applies them
 * stand on one line, the button level with the fields. */
.period-own {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--rule);
}

.period-own .field-group {
  flex: 1 1 20rem;
  margin: 0;
}

.period-own .form-field {
  margin-bottom: 0;
}

.period-own-apply {
  margin: 0;
}

/* Under 60 rem the panel stands in the flow of the page, because a
 * floating panel of tens of rem pushes the page sideways. */
@media (max-width: 60rem) {
  .period-panel {
    position: static;
    width: auto;
    max-width: none;
    margin-top: var(--space-2);
  }
}

/* On a phone two quarters stand side by side, in the order of the year. */
@media (max-width: 30rem) {
  .period-quarters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .period-quarter-1,
  .period-quarter-2,
  .period-quarter-3,
  .period-quarter-4 {
    grid-column: auto;
  }

  .period-calendar-whole {
    grid-column: 1 / -1;
  }
}

/* Year switcher: an arrow to the year before, the chosen year with its
 * standing and an arrow to the year after, as one input group; under it
 * every year the books carry, newest first. Without the script the years
 * stand as a list of links under the group; the script hides the list and
 * opens it from the year as a menu (#2476). */
.year-switch {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}

.year-switch-bar {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.year-switch-bar > * + * {
  border-left: 1px solid var(--rule);
}

.year-switch-arrow {
  display: grid;
  place-items: center;
  width: var(--control-height);
  min-height: var(--control-height);
  color: var(--muted);
}

a.year-switch-arrow:hover,
a.year-switch-arrow:focus-visible {
  background: var(--surface-soft);
  color: var(--brand);
}

.year-switch-end {
  opacity: 0.35;
}

.year-switch-current {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: 0 var(--space-3);
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: var(--text-control);
  font-weight: 650;
}

button.year-switch-current {
  cursor: pointer;
}

button.year-switch-current:hover,
button.year-switch-current:focus-visible,
button.year-switch-current[aria-expanded="true"] {
  background: var(--surface-soft);
}

.year-switch-current small,
.year-switch-list small {
  color: var(--muted);
  font-weight: 500;
}

span.year-switch-current > .icon {
  display: none;
}

.year-switch-menu {
  box-sizing: border-box;
  width: 18.75rem;
  max-width: calc(100vw - 2rem);
  padding: 6px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-tile);
  background: var(--surface);
}

.year-switch-menu[hidden] {
  display: none;
}

:root[data-script] .year-switch:not(.year-switch-open) .year-switch-menu {
  position: absolute;
  z-index: 8;
  top: calc(var(--control-height) + 2px + var(--space-1));
  right: 0;
  box-shadow: var(--shadow-menu);
}

.year-switch-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.year-switch-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: var(--space-2) 10px;
  border-radius: var(--radius-control);
  color: var(--text);
  font-size: var(--text-control);
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.year-switch-list a:hover,
.year-switch-list a:focus-visible {
  background: var(--surface-soft);
}

.year-switch-list a[aria-current] {
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  font-weight: 650;
}

.year-switch-foot {
  margin: 6px -6px -6px;
  padding: var(--space-2) 14px;
  border-top: 1px solid var(--rule-soft);
  color: var(--muted);
  font-size: var(--text-small);
}

/* Data list: a table on a card, the heads in small capitals on a muted
 * band, a mark at the start of a row, a title with a second line, cells
 * beside it with every amount at the right in tabular figures, a heading
 * over a group of rows and a summary at the foot. On a phone each row is a
 * block of its own and the heads fall away. */
.data-list {
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.data-list table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-list thead th {
  padding: 10px 18px;
  border-bottom: none;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
}

.data-list tbody td,
.data-list tbody th {
  padding: var(--space-3) 18px;
  border-top: 1px solid var(--rule-soft);
  border-bottom: none;
  text-align: left;
  vertical-align: middle;
}

.data-list .data-list-mark {
  width: 34px;
  padding-right: 0;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--brand);
  font-size: var(--text-control);
  font-weight: 700;
}

.avatar .icon {
  width: 18px;
  height: 18px;
}

.avatar.good {
  background: var(--good-tint);
  color: var(--good);
}

.avatar.warning {
  background: var(--warning-tint);
  color: var(--warning);
}

.avatar.error {
  background: var(--error-tint);
  color: var(--error);
}

.data-list-title {
  display: block;
  color: var(--text);
  font-weight: 600;
}

a.data-list-title {
  text-decoration: none;
}

a.data-list-title:hover,
a.data-list-title:focus-visible {
  color: var(--brand);
  text-decoration: underline;
}

.data-list-detail {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: var(--text-small);
}

.data-list .data-list-text {
  overflow-wrap: anywhere;
}

/* A pill at the end of a row keeps its words on one line, so a short
 * standing such as "draait nu" never breaks inside its pill. */
.data-list .data-list-end > .pill {
  white-space: nowrap;
}

/* Several pills in one cell stand side by side and wrap as words do. */
.data-list .data-list-tags .pill {
  margin: 0 var(--space-1) 2px 0;
}

.data-list .data-list-date {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The number of a document reads as one word. */
.data-list .data-list-number {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.data-list .data-list-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  text-align: right;
  white-space: nowrap;
}

.data-list .data-list-amount.good {
  color: var(--good);
}

.data-list .data-list-end,
.data-list thead .data-list-end {
  text-align: right;
}

/* A flag reads in full: a short one stays on one line, and a long one, such
 * as the name of a file, wraps inside its cell rather than pushing the list
 * past its card. */
.data-list .data-list-flag {
  min-width: 12rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* A cell that shows how far something has come: the words over a bar, as
 * wide as the words need and never narrower than a short bar. */
.data-list .data-list-progress {
  min-width: 16rem;
}

.data-list .data-list-progress .bar-figure {
  margin: 0;
}

.data-list .data-list-progress .bar-figure-label {
  flex-wrap: wrap;
  justify-content: flex-start;
  column-gap: var(--space-2);
  row-gap: 0;
  font-size: var(--text-small);
}

.data-list .data-list-progress .bar-figure-label span {
  white-space: nowrap;
}

.data-list .data-list-flag.good {
  color: var(--good);
}

.data-list .data-list-flag.warning {
  color: var(--warning);
}

.data-list .data-list-flag.error {
  color: var(--error);
}

.data-list .data-list-flag.info {
  color: var(--info);
}

/* A row may fold its whole text and its facts under the second line: the
 * line is the summary of a details element, so it opens on a click and on
 * the keyboard without the script. */
.data-list-more > summary {
  cursor: pointer;
  list-style: none;
}

.data-list-more > summary::-webkit-details-marker {
  display: none;
}

.data-list-more > summary .data-list-detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-list-more[open] > summary .data-list-detail {
  white-space: normal;
}

.data-list-more > p {
  max-width: none;
  margin: var(--space-2) 0 0;
  font-size: var(--text-small);
}

/* A text a row folds as it stands, such as the arguments of a call: kept
 * whole, wrapped where it must, in the small type of the second line. */
.data-list-code {
  margin: var(--space-2) 0 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-field);
  background: var(--surface-soft);
  font-size: var(--text-small);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.data-list tbody .data-list-day {
  padding-top: 18px;
  color: var(--muted);
  font-size: var(--text-label);
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* A heading inside a group, such as the side of a balance sheet under the
 * balance sheet in a list of concepts: ordinary type, a step under the
 * heading of the group. */
.data-list tbody .data-list-day-sub {
  padding-top: var(--space-4);
  color: var(--text);
  font-size: var(--text-small);
  font-weight: 650;
}

/* A group of rows may carry a line of ordinary type under its heading and
 * links beside it, such as the description of one posting and the document
 * it came from. A link opens the heading at its id, below the bar of the
 * page. */
.data-list tbody .data-list-day[id] {
  scroll-margin-top: var(--space-12);
}

.data-list-day-detail {
  display: block;
  margin-top: var(--space-1);
  color: var(--text);
  font-size: var(--text-small);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.data-list-day-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin-top: var(--space-1);
  font-size: var(--text-small);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

/* The stored documents a row hangs from: one name a line, each a link that
 * saves it, or its name alone where no fiscal year carries it any more. */
.data-list .data-list-files {
  min-width: 8rem;
}

.data-list-file-names {
  margin: 0;
  padding: 0;
  font-size: var(--text-small);
  list-style: none;
  overflow-wrap: anywhere;
}

/* A row that adds the rows above it up, such as the totals of the trial
 * balance, under a gold rule in strong figures. */
.data-list tbody .data-list-total td,
.data-list tbody .data-list-total th {
  border-top: 2px solid var(--accent);
  font-weight: 600;
}

.data-list tfoot td {
  padding: 10px 18px;
  border-top: 1px solid var(--rule-soft);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: var(--text-small);
}

.data-list-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-6);
}

.data-list-summary strong {
  color: var(--text);
}

.data-list-summary .btn {
  margin-left: auto;
}

@media (max-width: 48rem) {
  .data-list thead {
    display: none;
  }

  .data-list table,
  .data-list tbody,
  .data-list tfoot {
    display: block;
  }

  .data-list tbody tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-3);
    padding: 10px var(--space-3);
    border-top: 1px solid var(--rule-soft);
  }

  .data-list tfoot tr,
  .data-list tbody td,
  .data-list tbody th,
  .data-list tfoot td {
    display: block;
    padding: 0;
    border: none;
  }

  .data-list tfoot td {
    padding: 10px var(--space-3);
  }

  .data-list .data-list-main {
    flex: 1 1 60%;
  }
}

/* Pager: under a long list, which rows the page shows, the steps to the
 * page before and after with the page numbers around the current one, and
 * the choice of how many rows a page shows. Inside a data list it is the
 * band at its foot; on a phone the parts wrap under each other. */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
  padding: 10px 18px;
  color: var(--muted);
  font-size: var(--text-small);
}

.data-list .pager {
  border-top: 1px solid var(--rule-soft);
}

.pager ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pager-range {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.pager-pages {
  flex: 1 1 auto;
  justify-content: center;
}

.pager-step,
.pager-page,
.pager-size {
  display: inline-flex;
  box-sizing: border-box;
  min-width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: 0 var(--space-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 550;
  text-decoration: none;
}

.pager-step .icon {
  width: 14px;
  height: 14px;
}

.pager-step[aria-disabled="true"] {
  border-color: var(--rule-soft);
  color: var(--muted);
}

a.pager-step:hover,
a.pager-step:focus-visible,
.pager-page:hover,
.pager-page:focus-visible,
.pager-size:hover,
.pager-size:focus-visible {
  border-color: var(--brand);
}

.pager-page[aria-current="page"],
.pager-size[aria-current="true"] {
  border-color: var(--text);
  background: var(--text);
  color: var(--ground);
}

.pager-gap {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-1);
  color: var(--muted);
}

.pager-gap .icon {
  width: 16px;
  height: 16px;
}

.pager-sizes {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Table of figures: a report on a block of its own, the heads of the amount
 * columns on a muted band at the right, a group heading on a tinted band or
 * as plain text, a parent row whose mark folds the lines beneath it through
 * :has() without the script, and a total under a gold rule. Inside a card
 * or a side of a statement it stands bare. */
.report-table {
  margin: 0 0 var(--space-6);
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.report-table-bare {
  margin: 0;
  border: none;
  border-radius: 0;
  background: none;
}

.report-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-body);
}

.report-table caption {
  padding: var(--space-3) 18px var(--space-2);
  font-weight: 600;
  text-align: right;
}

.report-table thead th {
  padding: 10px 18px;
  border-bottom: none;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
  vertical-align: bottom;
}

.report-table tbody td,
.report-table tbody th {
  padding: var(--space-3) 18px;
  border: none;
  font-weight: 400;
  text-align: left;
  vertical-align: top;
}

.report-table .report-table-amount {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.report-table thead .report-table-amount {
  width: 12rem;
  white-space: normal;
}

.report-table .report-table-number {
  width: 4rem;
  font-variant-numeric: tabular-nums;
}

/* The mark beside a figure is the toggletip of a field (#1920): its panel
 * hangs under the label of the row or the figure it explains. */
.report-table .report-table-label {
  position: relative;
}

.report-table tbody .report-table-group th {
  padding-top: var(--space-6);
  font-weight: 600;
}

.report-table tbody .report-table-band th {
  padding-top: var(--space-3);
  background: var(--surface-soft);
}

.report-table tbody .report-table-total td,
.report-table tbody .report-table-total th {
  border-top: 2px solid var(--accent);
  font-weight: 600;
}

.report-table tbody .total-band td,
.report-table tbody .total-band th {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
  border-top: none;
  font-weight: 650;
}

/* The share of the net revenue under an amount, as the server wrote it. */
.report-table-share {
  display: block;
  color: var(--muted);
  font-size: var(--text-small);
}

.report-table-fold-mark {
  display: inline-block;
  margin-right: var(--space-1);
  vertical-align: middle;
}

.report-table-fold-mark > summary {
  display: inline-flex;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.report-table-fold-mark > summary::-webkit-details-marker {
  display: none;
}

.report-table-fold-mark[open] > summary .icon {
  transform: rotate(90deg);
}

.report-table-fold:has(.report-table-fold-mark:not([open])) tr:not(.report-table-parent) {
  display: none;
}

.report-table tbody .report-table-fold tr:not(.report-table-parent) .report-table-label {
  padding-left: calc(18px + var(--space-6));
}

.report-table tbody .report-table-parent td {
  font-weight: 500;
}

/* Statement of two sides: the debit side and the credit side beside each
 * other in one block, divided by a rule, and under each other on a narrow
 * window. Each side names itself in its caption. */
.report-sides {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0 0 var(--space-6);
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.report-sides-side {
  min-width: 0;
}

.report-sides-side + .report-sides-side {
  border-top: 1px solid var(--rule);
}

@media (min-width: 64rem) {
  .report-sides {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-sides-side + .report-sides-side {
    border-top: none;
    border-left: 1px solid var(--rule);
  }
}

/* Toolbar of a report: on the left the period picker that names the report
 * and its period, with the other reports at the top of its panel; on the
 * right the menu that explains the report and the menu of its files. */
.report-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
}

.report-bar > .period-picker {
  margin: 0;
}

.report-bar-menus {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Total band of a table of figures: the one total the reader acts on, such
 * as what a VAT return asks to pay, on a dark band across its foot with its
 * figure set large. */
tr.total-band th,
tr.total-band td {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
  border-top: none;
  background: var(--text);
  color: var(--ground);
  font-weight: 650;
}

tr.total-band td {
  font-size: var(--text-base);
  font-variant-numeric: tabular-nums;
}

tr.total-band a,
tr.total-band summary {
  color: var(--ground);
}

/* Card: a block of its own on the surface with a head that carries a title
 * and, at its right, a pill or a link; under the body stand rows of a name
 * and its value. */
.card-box {
  min-width: 0;
  padding: 18px var(--space-5);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.card-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: 10px;
}

.card-box-head h2 {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  color: var(--muted);
  font-size: var(--text-control);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.card-box-head h2 .icon {
  width: 16px;
  height: 16px;
}

.card-box-head a {
  color: var(--brand);
  font-size: var(--text-small);
  font-weight: 600;
  text-decoration: none;
}

.card-box-body > :first-child {
  margin-top: 0;
}

.card-box-body > :last-child {
  margin-bottom: 0;
}

.card-box-note {
  max-width: none;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: var(--text-small);
}

/* A list inside a card takes the frame of the card, so the rows stand on
 * the card rather than on a second card within it. */
.card-box-body > .data-list {
  margin-right: calc(-1 * var(--space-5));
  margin-left: calc(-1 * var(--space-5));
  border: none;
  border-top: 1px solid var(--rule-soft);
  border-radius: 0;
}

.card-box-body > .data-list:not(:last-child) {
  margin-bottom: var(--space-4);
}

.key-values {
  margin: 0;
}

/* A value that does not fit beside its name falls under it, so a pill, which
 * never wraps its word, keeps a row inside a phone. */
.key-value {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--rule-soft);
  font-size: var(--text-control);
}

.key-value:first-child {
  border-top: none;
}

.key-value dt {
  color: var(--muted);
}

.key-value dd {
  min-width: 0;
  margin: 0;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

/* Tabs: the parts of one object as links on a rule, the one the page stands
 * on in ink over a bar in the brand colour. Each part is an address of its
 * own, so the tabs work without the script. */
.tab-strip {
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--rule);
}

.tab-strip ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tab-strip-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -1px;
  padding: 9px 14px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: var(--text-body);
  font-weight: 600;
  text-decoration: none;
}

.tab-strip-tab:hover,
.tab-strip-tab:focus-visible {
  color: var(--text);
}

.tab-strip-tab[aria-current="page"] {
  border-bottom-color: var(--brand);
  color: var(--text);
}

.tab-strip-count {
  color: var(--muted);
  font-size: var(--text-small);
}

/* Disclosure: what a form asks seldom, behind one line in the brand colour
 * that names it; a details element, so it opens without the script. */
.disclosure {
  margin: 0 0 var(--space-4);
}

.disclosure-summary {
  color: var(--brand);
  cursor: pointer;
  font-size: var(--text-control);
  font-weight: 600;
}

.disclosure-body {
  margin-top: var(--space-3);
}

/* Row of fields: a few short fields side by side and one that takes the
 * room left, with the buttons that send them after the last field on the
 * line of the controls. It wraps on a narrow screen and stacks under
 * 48 rem, so every field keeps its label over its control. */
.field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0 var(--space-3);
}

.field-row .form-field {
  flex: 0 1 7.5rem;
  min-width: 6rem;
}

.field-row .form-field-wide {
  flex: 1 1 14rem;
}

.field-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

@media (max-width: 48rem) {
  .field-row .form-field,
  .field-row .form-field-wide {
    flex: 1 1 100%;
  }
}

/* Days of a week: seven tiles side by side, each a link with its day in a
 * muted tone, its figure in tabular figures and a bar of how much of the
 * longest day it holds; the chosen day carries a border in the brand
 * colour. On a phone the tiles stand in rows of four. */
.day-strip {
  margin-bottom: var(--space-4);
}

.day-strip ol {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.day-tile {
  display: block;
  padding: 10px var(--space-3) var(--space-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-tile);
  background: var(--surface);
  color: var(--text);
  text-align: center;
  text-decoration: none;
}

.day-tile:hover,
.day-tile:focus-visible {
  border-color: var(--brand);
}

.day-tile[aria-current="date"] {
  padding: 9px 11px 7px;
  border: 2px solid var(--brand);
}

.day-tile-name {
  display: block;
  color: var(--muted);
  font-size: var(--text-small);
}

.day-tile-figure {
  display: block;
  margin: 2px 0 6px;
  font-size: var(--text-base);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.day-tile-bar {
  display: block;
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: var(--radius-pill);
}

.day-tile-fill {
  fill: var(--brand);
}

@media (max-width: 48rem) {
  .day-strip ol {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Running timer: a bar on ink across the width, the drawing and the
 * sentence of since when it runs with the time it has run beside it in
 * large tabular figures, and the buttons at the right, drawn light on the
 * ink. */
.timer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  background: var(--branding-ink);
  color: var(--branding-mist);
}

.timer-bar-sentence {
  display: flex;
  flex: 1 1 16rem;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  max-width: none;
  margin: 0;
  font-size: var(--text-body);
}

.timer-bar-sentence .icon {
  width: 16px;
  height: 16px;
}

.timer-bar-figure {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.timer-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.timer-bar .btn {
  border-color: var(--branding-mist);
  background: transparent;
  color: var(--branding-mist);
}

.timer-bar .btn.btn-primary {
  background: var(--branding-mist);
  color: var(--branding-ink);
}

.timer-bar .btn:focus-visible {
  outline: 2px solid var(--branding-leaf);
  outline-offset: 2px;
}

/* Steps: numbered boxes side by side on one card, the done ones with a
 * filled green number, the current one with an ink number on a lighter
 * ground, the ones to do grey. Under 48 rem the steps stand one under the
 * other. */
.steps-bar {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  margin: 0 0 var(--space-4);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-tile);
  background: var(--surface);
  list-style: none;
}

.step-item {
  border-left: 1px solid var(--rule-soft);
}

.step-body {
  display: flex;
  height: 100%;
  align-items: center;
  gap: var(--space-2);
  padding: 10px var(--space-3);
  color: var(--text);
}

.step-item:first-child {
  border-left: none;
}

a.step-body {
  text-decoration: none;
}

a.step-body:hover .step-title,
a.step-body:focus-visible .step-title {
  color: var(--brand);
}

.step-number {
  display: grid;
  flex: none;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--info-tint);
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 700;
}

.step-title {
  display: block;
  font-size: var(--text-control);
  font-weight: 600;
}

.step-note {
  display: block;
  color: var(--muted);
  font-size: var(--text-label);
}

.step-done .step-number {
  background: var(--good);
  color: var(--brand-text);
}

.step-todo .step-title {
  font-weight: 500;
}

.step-current {
  background: var(--surface-soft);
}

.step-current .step-number {
  background: var(--text);
  color: var(--ground);
}

.step-held .step-number {
  background: var(--error);
  color: var(--error-text);
}

.step-held .step-note {
  color: var(--error);
}

@media (max-width: 48rem) {
  .steps-bar {
    grid-auto-flow: row;
  }

  .step-item {
    border-top: 1px solid var(--rule-soft);
    border-left: none;
  }

  .step-item:first-child {
    border-top: none;
  }
}

/* Tasks of a year: one row per task in its order, a mark of its state
 * before its title and the line under it, then the one figure it carries
 * and the one action that takes it. A task done carries a filled green
 * mark, the task to take now an ink mark with its number, a task that
 * waits a grey number and a muted title. Inside a card the rows take the
 * width of the card. Under 48 rem the figure and the action stand under
 * the title. */
.task-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.card-box-body > .task-list {
  margin-right: calc(-1 * var(--space-5));
  margin-left: calc(-1 * var(--space-5));
}

.task-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--rule-soft);
}

.task-item:first-child {
  border-top: none;
}

.task-mark {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: var(--info-tint);
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 700;
}

.task-done .task-mark {
  background: var(--good);
  color: var(--brand-text);
}

.task-now .task-mark {
  background: var(--text);
  color: var(--ground);
}

.task-body {
  min-width: 0;
}

.task-title {
  margin: 0;
  font-size: var(--text-body);
  font-weight: 600;
}

.task-done .task-title {
  font-weight: 500;
}

.task-later .task-title {
  color: var(--muted);
}

.task-line {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: var(--text-small);
  overflow-wrap: anywhere;
}

.task-figure {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.task-action .btn {
  white-space: nowrap;
}

@media (max-width: 48rem) {
  .task-item {
    grid-template-columns: 26px minmax(0, 1fr);
    align-items: start;
  }

  .task-figure,
  .task-action {
    grid-column: 2;
  }
}

/* Field: the label over the control, the hint under it in a muted tone and
 * the refusal of the server under it in the colour of an error, with that
 * colour on the border of a refused control. A value the form does not ask
 * stands as text. A group of fields carries a heading and may set its
 * fields two side by side. */
.field-group {
  margin: 0 0 var(--space-4);
  padding: 0;
  border: none;
}

.field-group-heading {
  margin: 0 0 var(--space-2);
  padding: 0;
  color: var(--text);
  letter-spacing: normal;
  text-transform: none;
  font-size: 15px;
  font-weight: 650;
}

.field-group-paired {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--space-3);
}

@media (max-width: 48rem) {
  .field-group-paired {
    grid-template-columns: minmax(0, 1fr);
  }
}

.form-field {
  position: relative;
  margin-bottom: var(--space-3);
}

.form-field-head {
  display: flex;
  height: 20px;
  align-items: center;
  margin-bottom: 5px;
}

.form-field-head .form-field-label {
  margin: 0;
}

.form-field-label {
  display: block;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 600;
}

.form-field-control {
  width: 100%;
  min-height: var(--control-height);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
}

.form-field-control.input-amount {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Every select of the program, of a component or of an older screen, draws
 * its own chevron: the arrow of the browser stands on the border of the
 * field, so it is turned off and two gradients draw a chevron in the muted
 * colour of the theme, with room to its right and the height of one control.
 * No image file, since the policy loads none; a list of several rows keeps
 * the look of the browser. `:not([multiple])` outweighs the base rule of a
 * field and the padding of the field component. */
select:not([multiple]) {
  min-height: var(--control-height);
  padding-right: 36px;
  appearance: none;
  background-color: var(--surface);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    right 18px top 50%,
    right 13px top 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px;
  cursor: pointer;
}

select:not([multiple]):disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.form-field-fact {
  min-width: 0;
  margin: 0;
  padding: var(--space-2) 0;
  font-size: 13.5px;
  font-weight: 600;
  /* A thumbprint or an address is one long word, which wraps inside its column. */
  overflow-wrap: anywhere;
  /* A description typed over more lines keeps its line breaks (#2371). */
  white-space: pre-line;
}

.form-field-hint {
  max-width: none;
  margin: var(--space-1) 0 0;
  color: var(--muted);
  font-size: var(--text-small);
}

.form-field-error {
  max-width: none;
  margin: var(--space-1) 0 0;
  color: var(--error);
  font-size: var(--text-small);
}

.field-refused .form-field-control {
  border-color: var(--error);
}

/* A date field: the button of its calendar joined to the text field on the
 * left, each with its own border, one pixel over the other so one line
 * divides them, and the corners where they meet square (#2465). Without the
 * script the button is hidden and the text field keeps its own corners. */
.date-field {
  position: relative;
  display: flex;
  align-items: stretch;
}

button.date-field-button {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--control-height);
  min-height: var(--control-height);
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control) 0 0 var(--radius-control);
  background: var(--surface-muted);
  color: var(--text);
}

button.date-field-button:hover {
  z-index: 1;
  background: color-mix(in srgb, var(--brand) 12%, var(--surface-muted));
}

.date-field-input {
  position: relative;
  flex: 1;
  min-width: 0;
  margin-left: -1px;
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
}

.date-field-input:focus-visible {
  z-index: 2;
}

:root:not([data-script]) .date-field-button {
  display: none;
}

:root:not([data-script]) .date-field-input {
  margin-left: 0;
  border-radius: var(--radius-control);
}

.field-refused .date-field-input {
  z-index: 1;
}

@media (pointer: coarse) {
  button.date-field-button {
    width: 2.75rem;
    min-height: 2.75rem;
  }
}

/* The calendar opens under its field as a dialog: the month in seven
 * columns, or a grid of months or years, with today outlined, the chosen
 * day filled in the brand colour and a day outside the bounds struck
 * through. */
.date-calendar {
  position: absolute;
  z-index: 5;
  top: calc(100% + var(--space-2));
  left: 0;
  width: 20rem;
  max-width: calc(100vw - 2rem);
  padding: var(--space-3);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-tile);
  background: var(--surface);
  box-shadow: var(--shadow-menu);
  font-size: var(--text-control);
}

.date-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

button.date-calendar-step,
button.date-calendar-title {
  min-height: 0;
  padding: var(--space-1) var(--space-2);
  border: 0;
  border-radius: var(--radius-field);
  background: none;
  color: var(--text);
}

button.date-calendar-title {
  gap: var(--space-1);
  font-size: var(--text-control);
  font-weight: 600;
}

button.date-calendar-step:hover,
button.date-calendar-title:hover:enabled {
  background: var(--surface-muted);
}

button.date-calendar-title:disabled {
  cursor: default;
}

button.date-calendar-title:disabled .icon {
  display: none;
}

.date-calendar-days {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.date-calendar-days th {
  padding: var(--space-1) 0;
  border: 0;
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 400;
  text-align: center;
}

.date-calendar-days td,
.date-calendar-pick button {
  border: 0;
  border-radius: var(--radius-control);
  color: var(--text);
  cursor: pointer;
  text-align: center;
}

.date-calendar-days td {
  height: 2.25rem;
  padding: 0;
}

.date-calendar-pick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.date-calendar-pick[hidden] {
  display: none;
}

.date-calendar-pick button {
  justify-content: center;
  height: 2.75rem;
  padding: 0;
  background: none;
  font-size: var(--text-control);
}

.date-calendar-days td[data-other] {
  color: var(--muted);
}

.date-calendar-days td[aria-disabled] {
  color: var(--muted);
  cursor: not-allowed;
  text-decoration: line-through;
}

.date-calendar-days td[aria-current] {
  box-shadow: inset 0 0 0 1.5px var(--brand);
  font-weight: 600;
}

.date-calendar-days td:hover:not([aria-selected], [aria-disabled]),
.date-calendar-pick button:hover:not([aria-pressed]) {
  background: var(--surface-soft);
  color: var(--brand);
}

.date-calendar-days td[aria-selected],
.date-calendar-pick button[aria-pressed] {
  background: var(--brand);
  color: var(--brand-text);
  font-weight: 600;
}

.date-calendar-days td[aria-selected]:hover,
.date-calendar-pick button[aria-pressed]:hover {
  background: color-mix(in srgb, var(--brand) 85%, var(--text));
}

.date-calendar-days td:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.date-calendar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
  color: var(--muted);
  font-size: var(--text-small);
}

.segmented {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.segmented-choice {
  position: relative;
  flex: 1;
  padding: 7px;
  font-size: var(--text-small);
  text-align: center;
  cursor: pointer;
}

.segmented-choice + .segmented-choice {
  border-left: 1px solid var(--rule-soft);
}

.segmented-choice input {
  position: absolute;
  opacity: 0;
}

.segmented-choice:has(input:checked) {
  background: var(--text);
  color: var(--ground);
  font-weight: 600;
}

.segmented-choice:has(input:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-control);
}

.check-row input {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
}

/* A field beside its label: the label and the hint on the left, the
 * control in a column of its own and the source tag after it, one row under
 * the other on a rule, as the values of a settings group stand. A fact
 * stands at the right of the control column. Under 48 rem the label stands
 * over the control again. */
.form-field-beside {
  display: grid;
  grid-template-columns: fit-content(60%) minmax(0, 1fr) minmax(0, 18rem) minmax(5.5rem, auto);
  column-gap: var(--space-2);
  align-items: center;
  margin: 0;
  padding: var(--space-3) 0;
}

.form-field-beside + .form-field-beside {
  border-top: 1px solid var(--rule-soft);
}

.form-field-beside .form-field-head {
  display: contents;
}

.form-field-beside .form-field-label {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 400;
}

.form-field-beside .form-field-head .field-info {
  grid-column: 2;
  grid-row: 1;
  justify-self: start;
}

.form-field-beside .form-field-hint {
  grid-column: 1 / span 2;
  grid-row: 2;
  margin: 2px 0 0;
}

.form-field-beside .form-field-error {
  grid-column: 3 / -1;
  grid-row: 3;
}

.form-field-beside > .form-field-control,
.form-field-beside > .picker,
.form-field-beside > .segmented,
.form-field-beside > .form-field-fact {
  grid-column: 3;
  grid-row: 1 / span 2;
  margin-left: var(--space-2);
}

.form-field-beside > .form-field-fact {
  grid-column: 3 / -1;
  text-align: right;
}

.form-field-beside:has(.form-field-source) > .form-field-fact {
  grid-column: 3;
}

.form-field-beside .form-field-source {
  grid-column: 4;
  grid-row: 1 / span 2;
  justify-self: start;
  margin: 0 0 0 var(--space-2);
}

@media (max-width: 48rem) {
  .form-field-beside {
    grid-template-columns: fit-content(70%) minmax(0, 1fr) auto;
  }

  .form-field-beside > .form-field-control,
  .form-field-beside > .picker,
  .form-field-beside > .segmented,
  .form-field-beside > .form-field-fact {
    grid-column: 1 / -1;
    grid-row: 3;
    margin: var(--space-2) 0 0;
  }

  .form-field-beside > .form-field-fact {
    text-align: left;
  }

  .form-field-beside .form-field-source {
    grid-column: 3;
    grid-row: 1;
  }

  .form-field-beside .form-field-hint {
    grid-column: 1 / -1;
  }

  .form-field-beside .form-field-error {
    grid-column: 1 / -1;
    grid-row: 4;
  }
}

/* Files the reader chooses or drops: a button of the string table over the
 * input of the browser, and the files chosen beside it. */
.file-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border: 1px dashed var(--rule);
  border-radius: var(--radius-control);
}

.file-control:has(input:focus-visible) .btn {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.file-control-chosen {
  min-width: 0;
  color: var(--muted);
  font-size: var(--text-small);
  overflow-wrap: anywhere;
}

/* The explanation of a field stands behind the mark beside its label: a
 * details element, so a click and the keyboard open it without the script,
 * shown as a small panel on hover and on focus too (#1911). The panel hangs
 * under the label and stays as wide as its column, so it never covers the
 * field it explains; under 60 rem it takes its own line in the text flow. */
.field-info {
  display: inline;
}

.field-info > summary {
  display: inline-flex;
  margin-left: var(--space-1);
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  vertical-align: -0.1em;
}

.field-info > summary::-webkit-details-marker {
  display: none;
}

.field-info > summary .icon {
  width: 16px;
  height: 16px;
}

.field-info:is(:hover, :focus-within)::details-content {
  content-visibility: visible;
}

.field-info > p {
  position: absolute;
  z-index: 2;
  top: 100%;
  left: 0;
  width: max-content;
  max-width: min(100%, 28rem);
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-field);
  background: var(--ground);
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 60rem) {
  .field-info > p {
    position: static;
    width: auto;
    max-width: none;
    margin-top: var(--space-1);
  }

  /* Beside a label the open explanation takes the width the label leaves and
   * wraps inside it, a long word too, so its text never sizes the head past
   * the column, and the head grows down to carry it (#2259). */
  .form-field-head > .field-info {
    flex: 1 1 0;
    min-width: 0;
  }

  .form-field-head:has(> .field-info:is([open], :hover, :focus-within)) {
    height: auto;
    align-items: flex-start;
  }
}

/* The copy of the saving verb that stands first in a form drawn with the
 * action bar, so Enter in a field saves (HTML Standard, 4.10.22.2 Implicit
 * submission). It carries hidden, which the base button rule would undo. */
.default-submit[hidden] {
  display: none;
}

/* Action bar: under a form and never over a field, one sentence of what
 * the primary button will do on the left and the buttons on the right,
 * the primary one last. */
.submit-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: 14px;
  padding: var(--space-3) 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-tile);
  background: var(--surface);
}

.submit-bar-sentence {
  flex: 1 1 14rem;
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-small);
}

.submit-bar-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-left: auto;
}

/* The source of a value the program filled in, a small soft tag beside the
 * label (uit de pdf, vorige boeking), or under the control in a row. */
.form-field-source {
  display: inline-block;
  margin-left: var(--space-2);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: var(--brand);
  font-size: var(--text-label);
  font-weight: 650;
  white-space: nowrap;
}


/* The field the one script puts before a long select and the select stand
 * in one box: the search on the left and the choice on the right, joined.
 * Without the script the select stands alone. */
.form-field:has(> .choice-search) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
}

.form-field:has(> .choice-search) > :not(.choice-search, select) {
  grid-column: 1 / -1;
}

.form-field > .choice-search {
  min-width: 0;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--rule);
  border-right: 0;
  border-radius: var(--radius-control) 0 0 var(--radius-control);
  background: var(--surface-soft);
  color: var(--text);
  font-family: inherit;
  font-size: var(--text-small);
}

.form-field > .choice-search + select {
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
}

/* Several boxes under one name, one under the other. */
.check-rows {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Reveal: a box with the fields behind it, shown while the box stands
 * ticked, without the script. */
.reveal-box:has(> .form-field input[type="checkbox"]:not(:checked)) > .reveal-box-body {
  display: none;
}

/* A segmented choice of two shows the fields while its last choice is
 * chosen, or, in the first-choice reveal, while its first is. */
.reveal-box:has(> .form-field .segmented-choice:last-child > input:not(:checked)) > .reveal-box-body,
.reveal-box-first:has(> .form-field .segmented-choice:first-child > input:not(:checked)) > .reveal-box-body {
  display: none;
}

.reveal-box-body {
  padding-left: var(--space-5);
}

/* The fields of a paired reveal stand in the columns of the paired field
 * group above them, so they take no indent of their own. */
.reveal-box-body.field-group-paired {
  padding-left: 0;
}

/* Fold: the fields a form rarely needs behind one line in the brand
 * colour, a details element. */
.fold-box {
  margin: var(--space-3) 0;
  font-size: var(--text-control);
}

.fold-box-summary {
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
}

.fold-box-body {
  margin-top: var(--space-3);
  padding-left: var(--space-4);
  border-left: 2px solid var(--rule-soft);
}

/* Line editor: each line of a document a small block on a soft ground,
 * the description at full width, then the category wide beside the rate
 * and the amounts with the button that takes the line away at the end,
 * the fold of the rare fields under it and one pill at the top right that
 * names where the program filled the line from. Under 48 rem the fields of
 * the second row stand one under the other. */
.line-editor {
  margin: var(--space-4) 0;
}

.line-editor-heading {
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 600;
}

.line-editor-row {
  position: relative;
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-4) var(--space-1);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-tile);
  background: var(--surface-muted);
}

.line-editor-mark {
  position: absolute;
  top: var(--space-3);
  right: var(--space-4);
}

.line-editor-cells {
  display: grid;
  gap: var(--space-2);
  align-items: end;
}

.line-editor-cells-1 {
  grid-template-columns: minmax(0, 1fr) auto;
}

.line-editor-cells-2 {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
}

.line-editor-cells-3 {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
}

.line-editor-cells-4 {
  grid-template-columns:
    minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
}

.line-editor-cells .form-field {
  margin-bottom: var(--space-3);
}

.line-editor-end {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.line-editor-amount {
  min-width: 6rem;
  padding: var(--space-2) 0;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  text-align: right;
}

.line-editor-remove {
  padding: var(--space-2) var(--space-1);
}

.line-editor-note {
  margin: 0 0 var(--space-2);
  color: var(--warning);
  font-size: var(--text-small);
}

.line-editor-summary {
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font-size: var(--text-small);
}

.line-editor-add {
  margin: var(--space-2) 0 0;
}

@media (max-width: 48rem) {
  .line-editor-cells {
    grid-template-columns: minmax(0, 1fr);
  }

  .line-editor-end {
    justify-self: start;
  }
}

/* The first row of a line with two fields sets them side by side, such as
 * the description beside the ledger account of a purchase line; the figure
 * at the end of the second row may carry a label, a source tag and a line
 * under it, such as the VAT a purchase line comes to. */
.line-editor-wide {
  min-width: 0;
}

.line-editor-wide-1 > .form-field + .form-field {
  margin-top: var(--space-1);
}

.line-editor-wide-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-2);
}

.line-editor-wide-2 > .form-field {
  margin-bottom: var(--space-3);
}

.line-editor-figure {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.line-editor-figure-head {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

.line-editor-figure-head .form-field-label {
  margin: 0;
}

.line-editor-figure-note {
  color: var(--muted);
  font-size: var(--text-label);
  font-weight: 500;
}

@media (max-width: 48rem) {
  .line-editor-wide-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Picker: a native select with its groups, which the picker script turns
 * into one field that filters a list under it while the reader types. The
 * select stays in the page as what the form posts. Without the script the
 * select stands as it is and the drawing of the search stays hidden. On a
 * phone the open list takes the screen, with rows of 44 px. */
.picker-glyph,
select[data-picker][hidden] {
  display: none;
}

.picker {
  position: relative;
  min-width: 0;
}

/* The button beside the picker of a party: it keeps what the form carries
 * and opens the page that records a new party (#2340). */
.picker-add {
  justify-self: start;
  width: fit-content;
  margin-top: var(--space-2);
}

.picker-box {
  display: flex;
  position: relative;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  padding: 0 36px 0 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background-color: var(--surface);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    right 18px top 50%,
    right 13px top 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px;
}

.picker-box .picker-glyph {
  display: inline-flex;
  color: var(--muted);
}

.picker[data-open] .picker-box,
.picker-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
}

.field-refused .picker-box {
  border-color: var(--error);
}

/* The field of the picker takes the room its box leaves and asks for none of
 * its own: the width a text input draws for its twenty characters would
 * otherwise widen every block around it, such as a line of the line editor,
 * past a phone. */
.picker-input {
  flex: 1;
  width: 0;
  min-width: 0;
  padding: var(--space-2) 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
}

.picker-input::placeholder {
  color: var(--muted);
}

/* The chosen choice stands over the field in its own words while the field
 * has no focus, its group muted after it. */
.picker-shown {
  display: none;
  position: absolute;
  inset: 0 36px 0 34px;
  align-items: center;
  overflow: hidden;
  font-size: 13.5px;
  pointer-events: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-shown small {
  margin-left: 6px;
  color: var(--muted);
  font-size: var(--text-small);
}

.picker-chosen .picker-input:not(:focus) {
  color: transparent;
}

.picker-chosen .picker-input:not(:focus) + .picker-shown {
  display: flex;
}

.picker-panel {
  position: absolute;
  z-index: 6;
  top: calc(100% + var(--space-1));
  left: 0;
  width: max(100%, 25rem);
  max-width: calc(100vw - var(--space-8));
  padding: 6px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-tile);
  background: var(--surface);
  box-shadow: var(--shadow-menu);
}

.picker-list {
  max-height: 22rem;
  overflow-y: auto;
}

.picker-group + .picker-group {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--rule-soft);
}

.picker-heading {
  margin: 8px 10px 4px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.picker-option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 7px 10px;
  border-radius: var(--radius-control);
  font-size: var(--text-control);
  cursor: pointer;
}

.picker-option[aria-selected="true"] {
  background: var(--surface-soft);
  box-shadow: inset 2px 0 0 var(--brand);
}

.picker-words {
  min-width: 0;
}

/* A picker whose choices carry a drawing, such as the kinds of a document:
 * the script starts each row with the drawing the server drew for it, and
 * without the script the drawing of the choice the form carries stands
 * before the select until the reader picks another. */
.picker-drawn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.picker-drawn > select,
.picker-drawn > .picker {
  flex: 1;
  min-width: 0;
}

.picker-carried {
  display: inline-flex;
  color: var(--muted);
}

:root[data-script] .picker-carried,
.form-field:has(option[selected]:not(:checked)) .picker-carried {
  display: none;
}

.picker-option > .picker-glyph {
  display: grid;
  flex: none;
  place-items: center;
  align-self: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-control);
  background: var(--surface-soft);
  color: var(--muted);
}

.picker-option > .picker-glyph + .picker-words {
  flex: 1;
}

.picker-option[aria-selected="true"] > .picker-glyph {
  color: var(--brand);
}

/* The tree of a picker: a chip per part of the list over it, a row per
 * group with its fold mark, its name and its count, and the rows under a
 * group indented on a rule. */
.picker-fold .icon {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: transform 0.12s;
}

.picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--rule-soft);
}

.picker-chip {
  min-height: 0;
  padding: 2px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-label);
  line-height: 1.5;
  cursor: pointer;
}

.picker-chip[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--brand-text);
}

.picker-branch {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-control);
  font-size: var(--text-control);
  font-weight: 600;
  cursor: pointer;
}

.picker-branch[aria-selected="true"] {
  background: var(--surface-soft);
  box-shadow: inset 2px 0 0 var(--brand);
}

.picker-branch[aria-expanded="true"] .icon {
  transform: rotate(90deg);
}

.picker-branch .picker-aside {
  margin-left: auto;
  font-weight: 400;
}

.picker-kids {
  margin-left: 14px;
  padding-left: 8px;
  border-left: 1px solid var(--rule-soft);
}

.picker-kids .picker-branch {
  font-weight: 500;
}

.picker-detail {
  display: block;
  color: var(--muted);
  font-size: var(--text-label);
}

.picker-aside {
  flex: none;
  color: var(--muted);
  font-size: var(--text-label);
  white-space: nowrap;
}

.picker-name mark,
.picker-detail mark {
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: inherit;
  font-weight: 700;
}

.picker-empty {
  margin: 8px 10px;
  color: var(--muted);
  font-size: var(--text-control);
}

.picker-foot {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 6px -6px -6px;
  padding: 7px 14px;
  border-top: 1px solid var(--rule-soft);
  border-radius: 0 0 var(--radius-tile) var(--radius-tile);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: var(--text-label);
}

.picker-foot kbd {
  padding: 0 4px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--surface);
  font-family: inherit;
  font-size: 10.5px;
}

.picker-close {
  display: none;
}

@media (max-width: 40rem) {
  .form-field:has(> .picker[data-open]) {
    position: fixed;
    z-index: 30;
    inset: 0;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: var(--space-3) var(--space-4);
    background: var(--surface);
  }

  .picker[data-open] {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
  }

  .picker[data-open] .picker-close {
    display: block;
    position: absolute;
    top: -30px;
    right: 0;
  }

  .picker[data-open] .picker-box {
    min-height: 44px;
  }

  .picker[data-open] .picker-input {
    font-size: var(--text-base);
  }

  .picker[data-open] .picker-panel {
    display: flex;
    position: static;
    flex: 1;
    flex-direction: column;
    width: 100%;
    max-width: none;
    min-height: 0;
    margin-top: var(--space-2);
    border: 0;
    box-shadow: none;
  }

  .picker[data-open] .picker-list {
    flex: 1;
    max-height: none;
  }

  .picker[data-open] .picker-option,
  .picker[data-open] .picker-branch {
    min-height: 44px;
    align-items: center;
    font-size: 15px;
  }

  .picker[data-open] .picker-kids {
    margin-left: 6px;
    padding-left: 6px;
  }

  .picker[data-open] .picker-foot {
    display: none;
  }
}

/* Totals: the figures under the lines, each name on the left and its figure
 * on the right, the total to pay larger under a rule. */
.totals {
  margin: var(--space-4) 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--rule-soft);
}

.totals-line {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-1) 0;
  font-size: 13.5px;
}

.totals-line dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.totals-grand {
  font-size: var(--text-base);
  font-weight: 700;
}

/* The copy of the saving verb that stands first in a form, so Enter in a
 * field saves (HTML Standard, implicit submission). It carries hidden, and
 * a button rule would draw it anyway, so this rule wins. */
.default-submit {
  display: none;
}

/* Document column: the document on a white sheet beside the fields, its
 * drawn pages one under the other, a tab per document where there are
 * more, and the link to the original under it. */
.viewer {
  padding: var(--space-5);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-paper);
}

@media (min-width: 60rem) {
  .viewer {
    position: sticky;
    top: 0;
    align-self: start;
  }
}

.viewer-tabs ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  padding: 0;
  list-style: none;
}

.viewer-tabs a {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-size: var(--text-small);
  text-decoration: none;
}

.viewer-sheet {
  display: none;
}

.viewer-sheet:target,
.viewer:not(:has(.viewer-sheet:target)) .viewer-sheet:first-of-type {
  display: block;
}

.viewer-page {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule-soft);
}

.viewer-page + .viewer-page {
  margin-top: var(--space-3);
}

.viewer-empty {
  margin: 0 0 var(--space-3);
  color: var(--muted);
  font-size: var(--text-body);
}

.viewer-file {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font-size: var(--text-small);
  overflow-wrap: anywhere;
}

.viewer-file a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

/* Drop zone: a dashed frame in the brand colour with an ordinary file
 * input, drawn as nothing behind the Dutch label that names the button and
 * what is chosen, and the facts the documents carry beside it. */
.file-drop {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-4);
  border: 2px dashed var(--brand);
  border-radius: var(--radius-tile);
}

.file-drop-target {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
}

.file-drop-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.file-drop-choice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  cursor: pointer;
}

.file-drop-button {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  color: var(--text);
  font-weight: 500;
}

.file-drop-choice:hover .file-drop-button,
.file-drop-input:focus-visible + .file-drop-choice .file-drop-button {
  border-color: var(--brand);
  color: var(--brand);
}

.file-drop-input:focus-visible + .file-drop-choice .file-drop-button {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.file-drop-chosen {
  color: var(--muted);
  font-size: var(--text-small);
  overflow-wrap: anywhere;
}

.file-drop-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0 var(--space-3);
}

/* Landing: a page that says one thing in the middle (the sign-in, the page
 * after signing out, a refusal, an address that leads nowhere). One card
 * with its words centred: the mark or a drawing over the title, the
 * sentence, the one way on and a muted line under it. On a page of its own
 * it stands in a column of 30 rem a little above the optical middle; in the
 * shell it fills the column under the head of the page. */
.landing-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-8) var(--space-4);
}

.landing-column {
  display: grid;
  width: 30rem;
  max-width: 100%;
  gap: var(--space-3);
  padding: 0 0 8vh;
}

.landing {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding: var(--space-8) var(--space-6);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  background: var(--surface);
  text-align: center;
}

.landing-column > .landing {
  margin: 0;
}

.landing-mark {
  display: block;
  width: 48px;
  height: 48px;
}

.landing-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: var(--radius-tile);
  background: var(--surface-soft);
  color: var(--brand);
}

.landing-title {
  margin: var(--space-2) 0 0;
  font-size: 20px;
  font-weight: 650;
}

.landing-sentence {
  max-width: 40ch;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-body);
}

.landing .btn {
  margin-top: var(--space-3);
}

.landing-foot {
  margin: var(--space-2) 0 0;
  color: var(--muted);
  font-size: var(--text-small);
}

/* Empty state: a drawing on a soft tile, a title, one sentence and the one
 * action, centred in the space the list would take. */
.empty-state {
  padding: var(--space-6);
  text-align: center;
}

.empty-state-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto;
  place-items: center;
  border-radius: var(--radius-tile);
  background: var(--surface-soft);
  color: var(--brand);
}

.empty-state-title {
  margin: var(--space-3) 0 0;
  font-size: 18px;
  font-weight: 650;
}

.empty-state-sentence {
  max-width: 48ch;
  margin: var(--space-1) auto var(--space-3);
  color: var(--muted);
  font-size: var(--text-body);
}

/* The steps that fill a list, side by side under the sentence, each a
 * drawing with its name and one line; under each other on a narrow screen. */
.empty-state-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
  margin: var(--space-4) 0 0;
  padding: var(--space-6) 0 0;
  border-top: 1px solid var(--rule);
  list-style: none;
  text-align: left;
}

.empty-state-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-1);
  font-weight: 500;
}

.empty-state-step .icon {
  color: var(--brand);
}

.empty-state-step-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-small);
}

/* A part of a screen that has nothing says so in one line where its list
 * would stand. */
.empty-state-line {
  padding: var(--space-2) 0;
  text-align: left;
}

.empty-state-line .empty-state-sentence {
  max-width: none;
  margin: 0;
}

@media (max-width: 60rem) {
  .empty-state-steps {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }
}

/* Document paper: the white sheet the invoice, the quote and the purchase
 * are drawn on, with a soft shadow, and a word in its corner while it is no
 * final document. */
.paper {
  position: relative;
  padding: 22px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-paper);
  background: var(--surface);
  box-shadow: var(--shadow-paper);
  font-size: var(--text-control);
}

.paper-stamp {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  padding: 2px var(--space-2);
  border: 1px solid var(--warning);
  border-radius: var(--radius-field);
  color: var(--warning);
  font-size: var(--text-label);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* The sheet beside its side card: the sheet takes the room and the side
 * card a column of its own, which stays in sight while the sheet scrolls;
 * under 60 rem the card follows the sheet. A stack lays cards one under the
 * other. */
.layout-sheet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: 18px;
  align-items: start;
  margin-bottom: var(--space-4);
}

.layout-stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.layout-stack > .btn:not(.btn-link) {
  justify-content: center;
  white-space: normal;
}

.layout-sheet > .layout-stack {
  position: sticky;
  top: var(--space-4);
}

@media (max-width: 60rem) {
  .layout-sheet {
    grid-template-columns: minmax(0, 1fr);
  }

  .layout-sheet > .layout-stack {
    position: static;
  }
}

/* The head of a document on its sheet: the mark of the house style at the
 * top left, the issuer at the top right in a muted tone, the party it is addressed to on the left with its address
 * under it, the dates and the references on the right, and the title of
 * the document under them with a muted note beside it. */
.paper-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.paper-mark {
  flex: none;
  width: 36px;
  height: 36px;
}

.paper-issuer {
  margin-left: auto;
  color: var(--muted);
  font-size: var(--text-small);
  font-style: normal;
  line-height: 1.55;
  text-align: right;
}

.paper-parties {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 28px;
  margin-top: 26px;
}

.paper-recipient,
.paper-meta {
  min-width: 0;
}

.paper-recipient-lines {
  margin: var(--space-2) 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.paper-title {
  margin: 28px 0 14px;
  font-size: var(--text-figure);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.paper-title-note {
  color: var(--muted);
  font-size: var(--text-base);
  font-weight: 500;
}

@media (max-width: 48rem) {
  .paper-parties {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* A day shown as text with the word that opens its field behind it, so
 * the reader changes it without the script. */
.form-field-fold > summary {
  cursor: pointer;
  list-style: none;
  font-size: var(--text-body);
  font-weight: 600;
}

.form-field-fold > summary::-webkit-details-marker {
  display: none;
}

.form-field-fold-change {
  color: var(--brand);
  font-size: var(--text-small);
  font-weight: 600;
}

.form-field-fold[open] > .date-field {
  margin-top: var(--space-2);
}

/* A short list of what a document carries: a round tick in the brand
 * colour for a point it carries and its number on a muted round for one it
 * still lacks. */
.tick-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tick-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 0;
  font-size: var(--text-control);
}

.tick-mark {
  display: grid;
  width: 20px;
  height: 20px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  font-size: var(--text-label);
  font-weight: 800;
}

.tick-mark .icon {
  width: 13px;
  height: 13px;
}

.tick-done .tick-mark {
  background: var(--brand);
  color: var(--brand-text);
}

.tick-open .tick-mark {
  background: var(--surface-muted);
  color: var(--muted);
}

/* A check that did not hold carries a cross in the colour of an error, and
 * one the program could not make a muted mark beside muted words. */
.tick-failed .tick-mark {
  color: var(--error);
}

.tick-unchecked .tick-mark,
.tick-unchecked {
  color: var(--muted);
}

.tick-failed .tick-mark .icon,
.tick-unchecked .tick-mark .icon {
  width: 18px;
  height: 18px;
}

/* Progress and ageing bars: a rounded track with the filled part in the
 * colour of its meaning, drawn as an image beside the figures that the
 * words above and the legend under it say in full. */
.bar-figure {
  margin: 0 0 var(--space-3);
}

.bar-figure-label {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0;
  font-size: var(--text-control);
}

.bar-figure-label span {
  color: var(--muted);
}

.bar-track {
  display: block;
  width: 100%;
  height: 10px;
  margin: 6px 0;
  overflow: hidden;
  border-radius: var(--radius-pill);
}

.bar-scale {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0;
  color: var(--muted);
  font-size: var(--text-small);
  font-variant-numeric: tabular-nums;
}

.bar-ground {
  fill: var(--rule-soft);
}

.bar-fill {
  fill: var(--brand);
}

.bar-fill.good {
  fill: var(--good);
}

.bar-fill.warning {
  fill: var(--accent);
}

.bar-fill.error {
  fill: var(--error);
}

.bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: var(--text-small);
  list-style: none;
}

.bar-swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 3px;
}

.bar-swatch.bar-ground {
  background: var(--rule-soft);
}

.bar-swatch.bar-fill {
  background: var(--brand);
}

.bar-swatch.bar-fill.good {
  background: var(--good);
}

.bar-swatch.bar-fill.warning {
  background: var(--accent);
}

.bar-swatch.bar-fill.error {
  background: var(--error);
}

/* Tiles of what waits: a row of tiles, each a count or a drawing in a
 * square of its meaning colour, the title and one line beside it, and an
 * arrow where it leads to the screen that settles it. One line, so every
 * tile keeps the height its own content gives it (#2166). */
.link-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: var(--space-4);
  margin: 0 0 var(--space-6);
  padding: 0;
  list-style: none;
}

.link-tile {
  display: flex;
  height: 100%;
  align-items: center;
  gap: 14px;
  padding: 14px var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-tile);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

a.link-tile:hover,
a.link-tile:focus-visible {
  border-color: var(--brand);
}

.link-tile-badge {
  display: grid;
  flex: none;
  min-width: 38px;
  height: 38px;
  padding: 0 var(--space-2);
  place-items: center;
  border-radius: 10px;
  background: var(--info-tint);
  color: var(--muted);
  font-size: 17px;
  font-weight: 750;
}

.link-tile-badge .icon {
  width: 18px;
  height: 18px;
}

.link-tile.good .link-tile-badge {
  background: var(--good-tint);
  color: var(--good);
}

.link-tile.warning .link-tile-badge {
  background: var(--warning-tint);
  color: var(--warning);
}

.link-tile.error .link-tile-badge {
  background: var(--error-tint);
  color: var(--error);
}

.link-tile-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.link-tile-title {
  font-weight: 600;
}

.link-tile-line {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-small);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-tile-go {
  margin-left: auto;
  color: var(--brand);
}

.link-tile-go .icon {
  width: 16px;
  height: 16px;
}

/* Card figure: inside a card the one figure it is about stands large, a
 * line under it in a muted tone, and two to three figures may stand side by
 * side under it with a rule between them. A figure that is a loss takes the
 * colour of an error. */
.card-box-figure {
  margin: 0;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.card-box-figure.error {
  color: var(--error);
}

.card-box-line {
  max-width: none;
  margin: var(--space-1) 0 0;
  color: var(--muted);
  font-size: var(--text-small);
}

.key-values-paired {
  display: flex;
  flex-wrap: wrap;
  margin: var(--space-3) 0 0;
}

.key-values-paired > .key-value {
  display: block;
  min-width: 0;
  flex: 1 1 8rem;
  padding: 0;
  border-top: none;
}

.key-values-paired > .key-value + .key-value {
  padding-left: var(--space-3);
  border-left: 1px solid var(--rule);
}

.key-values-paired dd {
  text-align: left;
  overflow-wrap: anywhere;
}

.card-box .key-values,
.card-box .bar-figure {
  margin-top: var(--space-3);
}

/* A card without a head and with nothing in its body opens on its rows at
 * the padding of the card; the space above the rows belongs to a head or a
 * body, and here there is neither. */
.card-box > .card-box-body:first-child:empty + .key-values {
  margin-top: 0;
}

.card-box h3 {
  margin: var(--space-4) 0 var(--space-2);
  font-size: var(--text-control);
}

/* Brand lockup: the lockup of a company on the foliage tile reads on a
 * light ground and the one on the inverted tile on a dark ground; the theme
 * decides which stands. */
.brand-lockup {
  width: auto;
  max-width: 100%;
  height: 34px;
}

.brand-lockup-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-lockup-light {
    display: none;
  }

  :root:not([data-theme="light"]) .brand-lockup-dark {
    display: inline;
  }
}

:root[data-theme="dark"] .brand-lockup-light {
  display: none;
}

:root[data-theme="dark"] .brand-lockup-dark {
  display: inline;
}

/* Agenda: what is due, each item a block of the day and the month, the
 * words beside it and the amount at the right; a near one in the colour of
 * a warning and a passed one in the colour of an error. */
.agenda {
  margin: 0;
  padding: 0;
  list-style: none;
}

.agenda-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--rule-soft);
}

.agenda-item:first-child {
  border-top: none;
}

.agenda-date {
  padding: 6px 0;
  border-radius: 10px;
  background: var(--info-tint);
  text-align: center;
}

.agenda-day {
  display: block;
  font-size: 17px;
  line-height: 1.1;
}

.agenda-month {
  color: var(--muted);
  font-size: var(--text-label);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.agenda-date.warning {
  background: var(--warning-tint);
}

.agenda-date.error {
  background: var(--error-tint);
  color: var(--error);
}

.agenda-text {
  min-width: 0;
}

.agenda-title {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.agenda-title:hover,
.agenda-title:focus-visible {
  color: var(--brand);
  text-decoration: underline;
}

.agenda-line,
.agenda-note {
  max-width: none;
  margin: var(--space-1) 0 0;
  color: var(--muted);
  font-size: var(--text-small);
}

.agenda-source {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-note {
  color: var(--text);
}

.agenda-figure {
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--info-tint);
  font-size: var(--text-small);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
}

.agenda-figure.warning {
  background: var(--warning-tint);
  color: var(--warning);
}

.agenda-figure.error {
  background: var(--error-tint);
  color: var(--error);
}

@media (max-width: 30rem) {
  .agenda-item {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .agenda-figure {
    grid-column: 2;
    justify-self: start;
  }
}

/* Section menu: the parts of one screen one under the other, each a link
 * with its name and a short line of what it holds, the part the page stands
 * on on a card of its own. It stands in the narrow column of layout-sections,
 * and over the content as a wrapping row under 60 rem. */
.layout-sections {
  display: grid;
  grid-template-columns: minmax(12rem, 14rem) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
  margin-bottom: var(--space-4);
}

.section-nav ul {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.section-nav-link {
  display: block;
  padding: 9px var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: var(--text);
  text-decoration: none;
}

.section-nav-link:hover,
.section-nav-link:focus-visible {
  border-color: var(--rule);
}

.section-nav-link[aria-current] {
  border-color: var(--rule);
  background: var(--surface);
}

.section-nav-link:has(> .icon) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: var(--space-3);
}

.section-nav-link > .icon {
  grid-row: span 2;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--muted);
}

.section-nav-title {
  display: block;
  grid-column: 2;
  font-size: 13.5px;
}

.section-nav-link[aria-current] .section-nav-title {
  font-weight: 650;
}

.section-nav-line {
  display: block;
  grid-column: 2;
  color: var(--muted);
  font-size: var(--text-small);
}

@media (max-width: 60rem) {
  .layout-sections {
    grid-template-columns: minmax(0, 1fr);
  }

  .section-nav ul {
    display: flex;
    flex-wrap: wrap;
  }
}

/* Running text: the headings, paragraphs, lists, tables and images of a
 * document the program serves, such as a chapter of the manual, on the
 * surface of a card. A block of code scrolls inside its own frame and a long
 * address or name in a paragraph breaks where it has to, so neither pushes
 * the page sideways. */
.prose {
  padding: var(--space-5);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  background: var(--surface);
  line-height: 1.6;
}

.prose > :first-child {
  margin-top: 0;
}

.prose > :last-child {
  margin-bottom: 0;
}

.prose h2 {
  margin: var(--space-6) 0 var(--space-2);
  font-size: 19px;
}

.prose h3 {
  margin: var(--space-5) 0 var(--space-2);
  font-size: var(--text-base);
}

.prose p,
.prose li {
  overflow-wrap: anywhere;
}

.prose img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
}

.prose pre {
  overflow-x: auto;
  padding: var(--space-3);
  border-radius: var(--radius-control);
  background: var(--surface-muted);
}

/* Cards to choose between: a row of cards, each a link to the screen under
 * that choice, the one the screen stands under in ink, with a title and its
 * line, a pill, a figure and a few lines under it. */
.nav-cards ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}

.nav-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  padding: 14px var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

a.nav-card:hover,
a.nav-card:focus-visible {
  border-color: var(--brand);
}

.nav-card[aria-current] {
  border-color: var(--text);
  box-shadow: inset 0 0 0 1px var(--text);
}

.nav-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-2);
}

.nav-card-title {
  font-weight: 650;
}

.nav-card-detail,
.nav-card-line {
  color: var(--muted);
  font-size: var(--text-small);
}

.nav-card-figure {
  margin-top: var(--space-1);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 680;
}

/* Two cards side by side, each half the width: the title and its line on the
 * left and the pill on the right of one line, the figure large, the facts and
 * the action on one line at the foot, and a dashed line under the pair. On a
 * phone the cards stack. */
.nav-pair {
  margin: 0 0 var(--space-4);
}

.nav-pair ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-pair .nav-card {
  align-items: stretch;
  gap: 0;
  padding: 18px var(--space-5);
}

.nav-pair .nav-card[aria-current] {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.nav-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.nav-card-names {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.nav-card-top .pill {
  flex: none;
  white-space: nowrap;
}

.nav-pair .nav-card-figure {
  margin-top: var(--space-3);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) 18px;
  margin-top: var(--space-2);
}

.nav-card-foot strong {
  color: var(--text);
  font-weight: 600;
}

.nav-card-action {
  margin-left: auto;
  color: var(--brand);
  font-size: var(--text-small);
  font-weight: 600;
}

.nav-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  max-width: none;
  margin: 10px 0 0;
  padding: 9px 14px;
  border: 1px dashed var(--rule);
  border-radius: var(--radius-control);
  color: var(--muted);
  font-size: var(--text-control);
}

.nav-note strong {
  color: var(--text);
  font-weight: 600;
}

.nav-note-link {
  margin-left: auto;
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.nav-note-link:hover,
.nav-note-link:focus-visible {
  text-decoration: underline;
}

@media (max-width: 40rem) {
  .nav-pair ul {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Checks: each check a mark of how it came out in its meaning colour, the
 * title, the sentence and a note in a muted tone. */
.check-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-item {
  padding: 10px 0;
  border-top: 1px solid var(--rule-soft);
}

.check-item:first-child {
  border-top: none;
}

.check-item p {
  max-width: none;
  margin: 0;
  font-size: var(--text-control);
}

.check-item-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
}

.check-item-title .icon {
  flex: none;
  width: 16px;
  height: 16px;
}

.check-item.good .check-item-title .icon {
  color: var(--good);
}

.check-item.warning .check-item-title .icon {
  color: var(--warning);
}

.check-item.error .check-item-title .icon {
  color: var(--error);
}

.check-item-sentence {
  margin-top: var(--space-1);
}

.check-item p.check-item-note {
  margin-top: var(--space-1);
  color: var(--muted);
  font-size: var(--text-small);
}

/* Comparison: one narrow row on the card ground, the name and the line of
 * one side on the left, of the other on the right, and between them the
 * drawing with the pill whether they agree and the difference where they
 * do not. Under 48 rem the three stand under each other. */
.compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-3);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.compare-side {
  min-width: 0;
}

.compare-side-end {
  text-align: right;
}

.compare-side p {
  max-width: none;
  margin: 0;
}

.compare-name {
  font-weight: 650;
}

.compare-line {
  color: var(--muted);
  font-size: var(--text-small);
  font-variant-numeric: tabular-nums;
}

.compare-sign {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
  color: var(--muted);
  font-size: var(--text-small);
}

.compare-difference {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 48rem) {
  .compare {
    grid-template-columns: minmax(0, 1fr);
  }

  .compare-side-end {
    text-align: left;
  }
}

/* Document cards: one card per document, the small picture of its first
 * page with the mark of its form, the title, the facts set apart by a dot,
 * one more line, a flag in the colour of a warning, and the action with
 * the link to the original at the right. On a phone the action moves under
 * the text and the picture keeps its column. */
.media-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.media-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin: 0 0 10px;
  padding: 14px 18px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.media-picture {
  position: relative;
  display: block;
  width: 64px;
  height: 82px;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: var(--shadow-raised);
}

.media-picture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.media-drawing {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: var(--surface-muted);
  color: var(--muted);
}

.media-drawing .icon {
  width: 28px;
  height: 28px;
}

.media-badge {
  position: absolute;
  bottom: 5px;
  left: 5px;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--muted);
  color: var(--surface);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.3;
}

.media-badge.error {
  background: var(--error);
}

.media-body {
  min-width: 0;
}

.media-title {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px var(--space-2);
  max-width: none;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: var(--text-small);
}

.media-facts span + span::before {
  margin-right: var(--space-2);
  content: "·";
}

.media-detail {
  max-width: none;
  margin: 6px 0 0;
  font-size: var(--text-small);
  overflow-wrap: anywhere;
}

.media-flag {
  display: inline-block;
  max-width: 100%;
  margin: var(--space-2) 0 0;
  padding: var(--space-1) 10px;
  border-radius: var(--radius-field);
  background: var(--warning-tint);
  color: var(--warning);
  font-size: var(--text-small);
  font-weight: 550;
}

.media-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}

.media-link {
  color: var(--brand);
  font-size: var(--text-small);
  font-weight: 600;
  text-decoration: none;
}

.media-link:hover,
.media-link:focus-visible {
  text-decoration: underline;
}

@media (max-width: 40rem) {
  .media-item {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: var(--space-3) 14px;
  }

  .media-actions {
    flex-direction: row;
    flex-wrap: wrap;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
  }
}

/* Entry head: one entry as it came in, a mark of its direction on a soft
 * tile, who and what it is about with its facts and what the screen puts
 * under them, and the amount large at the right with the cents set apart,
 * green where the money came in. */
.entry-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-4);
  margin: 0 0 var(--space-4);
  padding: 18px var(--space-5);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.entry-head-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius-tile);
  background: var(--surface-soft);
  color: var(--muted);
}

.entry-head-mark.good {
  background: var(--good-tint);
  color: var(--good);
}

.entry-head-mark .icon {
  width: 20px;
  height: 20px;
}

.entry-head-main {
  min-width: 0;
}

.entry-head-main > p {
  max-width: none;
  margin: 0;
}

.entry-head-title {
  font-size: 17px;
  font-weight: 650;
}

.entry-head-text {
  overflow-wrap: anywhere;
}

.entry-head-main > .entry-head-facts {
  margin-top: var(--space-1);
  color: var(--muted);
  font-size: var(--text-small);
}

.entry-head-main details {
  margin-top: var(--space-2);
  font-size: var(--text-small);
}

.entry-head-main summary {
  color: var(--brand);
  cursor: pointer;
  font-weight: 600;
}

.entry-head-amount {
  text-align: right;
}

.entry-head-amount p {
  margin: 0;
}

.entry-head-figure {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.entry-head-figure.good {
  color: var(--good);
}

.entry-head-figure sup {
  font-size: 0.6em;
}

.entry-head-direction {
  color: var(--muted);
  font-size: var(--text-small);
}

@media (max-width: 40rem) {
  .entry-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .entry-head-amount {
    grid-column: 2;
    text-align: left;
  }
}

/* Choice as a card: a radio and its title, a figure at the right, the facts
 * and the reasons as pills, the card in ink while its radio is chosen. The
 * bar under the form shows the sentence of the chosen radio through :has(),
 * so the sentence follows the choice without the script. */
.option-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3);
  margin: 0 0 10px;
  padding: 14px var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-tile);
  background: var(--surface);
}

.option-card:has(.option-card-input:checked) {
  border-color: var(--text);
  box-shadow: inset 0 0 0 1px var(--text);
}

.option-card-input {
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  accent-color: var(--brand);
}

.option-card-body {
  display: grid;
  min-width: 0;
  gap: var(--space-1);
}

.option-card-body > p {
  max-width: none;
  margin: 0;
}

.option-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
}

.option-card-title {
  font-weight: 650;
  cursor: pointer;
}

.option-card-figure {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.option-card-facts {
  color: var(--muted);
  font-size: var(--text-small);
}

.option-card-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.option-card-body select {
  max-width: 100%;
}

.option-outcome {
  display: none;
}

.option-scope:has(.option-pick-1:checked) .option-outcome-1,
.option-scope:has(.option-pick-2:checked) .option-outcome-2,
.option-scope:has(.option-pick-3:checked) .option-outcome-3,
.option-scope:has(.option-pick-4:checked) .option-outcome-4,
.option-scope:has(.option-pick-5:checked) .option-outcome-5,
.option-scope:has(.option-pick-6:checked) .option-outcome-6,
.option-scope:not(:has(.option-card-input:checked)) .option-outcome-none {
  display: inline;
}

/* Panel over the page: hidden until the address names its id, then over a
 * dimmed page in the middle, scrolling on its own; on a phone it takes the
 * width less the gutter. */
.dialog-panel {
  display: none;
}

.dialog-panel:target,
.dialog-panel-open {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: var(--space-6) var(--space-4);
  overflow-y: auto;
  background: color-mix(in srgb, var(--branding-ink) 55%, transparent);
}

.dialog-panel-body {
  box-sizing: border-box;
  width: min(52rem, 100%);
  padding: var(--space-6);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text);
}

.dialog-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-4);
}

.dialog-panel-head h2 {
  margin: 0;
}

.dialog-panel-close {
  color: var(--brand);
  font-weight: 600;
}

@media (max-width: 40rem) {
  .dialog-panel:target,
  .dialog-panel-open {
    padding: var(--space-4);
  }

  .dialog-panel-body {
    padding: var(--space-4);
  }
}

/* Foot line: a few short facts at the foot of a page in a muted tone, a dot
 * of its meaning in front of a fact that reports a standing. */
.page-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  margin-top: var(--space-8);
  color: var(--muted);
  font-size: var(--text-small);
}

.page-foot-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: var(--space-2);
  border-radius: 50%;
  background: var(--muted);
}

.page-foot-dot.good {
  background: var(--good);
}

.page-foot-dot.warning {
  background: var(--warning);
}

.page-foot-dot.error {
  background: var(--error);
}

/* Shell: the top bar across the full width in ink, and under it the menu of
 * the screens beside the page, each scrolling on its own. The top bar and the
 * menu are the same on every page; only the page beside the menu changes. A
 * page of the program carries no menu and spans both tracks, so its column
 * centres in the window (#2166). Under 60 rem the menu stands behind the
 * button of the top bar and opens over the page through the CSS `:target` of
 * its anchor, so it opens without the script (#2199). */
body.app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  grid-template-rows: 56px minmax(0, 1fr);
  height: 100vh;
}

.app-bar {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: var(--space-4);
  padding: 0 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--branding-ink);
  color: var(--branding-mist);
}

.app-bar-brand {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  width: 196px;
  color: var(--branding-mist);
  font-size: var(--text-base);
  font-weight: 650;
  text-decoration: none;
}

.app-bar-brand img {
  width: 28px;
  height: 28px;
}

.app-bar-menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-control);
  color: var(--branding-mist);
}

.app-bar .dropdown-panel {
  color: var(--text);
}

.app-bar-brand:focus-visible,
.app-bar-menu:focus-visible,
.app-bar summary:focus-visible {
  outline: 2px solid var(--branding-leaf);
  outline-offset: 2px;
}

/* The company switcher: the badge and the name of the books being read in
 * a bordered button on the ink, which opens the companies with one line of
 * what waits in each and, under a rule, the whole group. */
.switcher {
  min-width: 0;
}

.switcher-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px var(--space-3);
  border: 1px solid rgb(167 177 171 / 35%);
  border-radius: 9px;
  color: var(--branding-mist);
  cursor: pointer;
  font-size: var(--text-control);
}

.switcher-button .switcher-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.switcher-button .icon {
  width: 14px;
  height: 14px;
}

.switcher-badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--branding-leaf);
  color: var(--branding-ink);
  font-size: 10px;
  font-weight: 800;
}

.switcher-badge .icon {
  width: 14px;
  height: 14px;
}

.switcher .dropdown-panel {
  right: auto;
  left: 0;
  width: 300px;
}

.switcher-panel a {
  display: flex;
  align-items: center;
  gap: 10px;
}

.switcher-panel a[aria-current="true"] {
  background: var(--surface-soft);
}

.switcher-panel .switcher-badge {
  background: var(--surface-muted);
  color: var(--text);
}

.switcher-panel a[aria-current="true"] .switcher-badge {
  background: var(--branding-leaf);
  color: var(--branding-ink);
}

.switcher-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.switcher-text .switcher-name {
  font-weight: 650;
}

.switcher-line {
  color: var(--muted);
  font-size: var(--text-label);
}

.switcher-group {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid var(--rule-soft);
}

/* The menu of the person: the name and a round badge of the initials at the
 * right of the top bar, which opens the doors, the three themes and the
 * sign-out. */
.user-menu {
  margin-left: auto;
}

.user-menu-button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--branding-haze);
  cursor: pointer;
  font-size: var(--text-control);
}

.user-menu-badge {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--branding-leaf);
  color: var(--branding-ink);
  font-size: 12px;
  font-weight: 750;
}

.user-menu-panel {
  width: 280px;
  padding: var(--space-2);
}

.user-menu-person {
  display: flex;
  flex-direction: column;
  margin: 0 0 var(--space-2);
  padding: var(--space-2) 10px var(--space-3);
  border-bottom: 1px solid var(--rule-soft);
}

.user-menu-person .user-menu-name {
  font-weight: 650;
}

.user-menu-role,
.user-menu-heading {
  color: var(--muted);
  font-size: var(--text-label);
}

.user-menu-heading {
  margin: var(--space-2) 10px var(--space-1);
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.user-menu-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.user-menu-links a,
.user-menu-panel button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: var(--space-2) 10px;
  border: none;
  border-radius: var(--radius-control);
  background: none;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-control);
  font-weight: 400;
  text-align: left;
  text-decoration: none;
}

.user-menu-links a:hover,
.user-menu-panel button:hover,
.user-menu-links a:focus-visible,
.user-menu-panel button:focus-visible {
  background: var(--surface-soft);
}

.user-menu-panel button[aria-current="true"] {
  color: var(--brand);
  font-weight: 650;
}

.user-menu-links .icon,
.user-menu-panel button .icon {
  width: 16px;
  height: 16px;
}

.user-menu-themes {
  margin: 0;
}

.user-menu-sign-out {
  margin: 0;
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--rule-soft);
}

.user-menu-sign-out button {
  color: var(--error);
}

/* The menu of the screens: the screens under a small label in capitals, the
 * one being read on a raised card, a count at the right where work waits, and
 * the settings and the manual at the foot under a rule. */
.app-menu {
  display: flex;
  grid-column: 1;
  grid-row: 2;
  flex-direction: column;
  gap: 1px;
  padding: 14px 10px;
  border-right: 1px solid var(--rule);
  background: var(--ground);
  font-size: 13.5px;
  overflow-y: auto;
}

.app-menu-group h2 {
  margin: 12px 10px 4px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.app-menu ul {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: var(--text);
  text-decoration: none;
}

.app-menu a .icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.app-menu a:hover,
.app-menu a:focus-visible {
  background: var(--surface-soft);
}

.app-menu a[aria-current="page"] {
  border-color: var(--rule);
  background: var(--surface);
  box-shadow: var(--shadow-raised);
  font-weight: 650;
}

.app-menu a[aria-current="page"] .icon {
  color: var(--brand);
}

.app-menu-count {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--warning-tint);
  color: var(--warning);
  font-size: var(--text-label);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.app-menu-count .icon {
  width: 14px;
  height: 14px;
}

.app-menu-back {
  margin-bottom: var(--space-2);
  font-weight: 650;
}

.app-menu-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

.app-menu .app-menu-close {
  display: none;
}

/* The page beside the menu: one column of 65 rem, centred in the space
 * beside the menu and narrower only when the window is. It fills its grid
 * cell and scrolls there, and its side padding takes up what the column
 * leaves, so every screen with a menu has the same left edge. A classic
 * scrollbar takes its width only on a page that scrolls, so the gutter is
 * kept stable (#1228), and the page holds what is placed absolutely inside
 * it (#1703). */
body.app-shell > main {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  padding: 22px max(var(--space-8), calc((100% - 65rem) / 2)) var(--space-12);
  overflow-y: auto;
  scrollbar-gutter: stable;
}

body.app-shell-program > main {
  grid-column: 1 / -1;
  scrollbar-gutter: stable both-edges;
}

/* Under 60 rem: one column, the menu behind the button of the top bar over
 * the whole page, the name of the person left out beside the badge. */
@media (max-width: 60rem) {
  body.app-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 56px auto;
    height: auto;
    min-height: 100vh;
  }

  .app-bar {
    gap: var(--space-2);
    padding: 0 var(--space-3);
  }

  .app-bar-menu {
    display: flex;
  }

  .app-bar-brand {
    width: auto;
  }

  .app-bar-name,
  .user-menu-button .user-menu-name {
    display: none;
  }

  .switcher {
    flex: 1 1 auto;
  }

  .switcher .dropdown,
  .switcher-button {
    min-width: 0;
  }

  .switcher-button {
    overflow: hidden;
  }

  .user-menu {
    flex: none;
  }

  .switcher .dropdown-panel {
    position: fixed;
    top: 56px;
    right: var(--space-4);
    left: var(--space-4);
    width: auto;
  }

  .user-menu .dropdown-panel {
    position: fixed;
    top: 56px;
    right: var(--space-4);
  }

  .app-menu[id] {
    display: none;
    position: fixed;
    z-index: 4;
    top: 56px;
    right: 0;
    bottom: 0;
    left: 0;
    padding: var(--space-4);
    border-right: none;
  }

  .app-menu[id]:target {
    display: flex;
  }

  .app-menu[id] .app-menu-close {
    display: flex;
    align-self: flex-end;
  }

  .app-menu-foot {
    margin-top: var(--space-4);
  }

  body.app-shell > main {
    grid-column: 1;
    grid-row: 2;
    padding: var(--space-6) var(--space-4) var(--space-12);
    overflow-y: visible;
  }
}

/* The shell as the catalogue draws it: the top bar wraps, an open menu
 * stands in the flow under its button rather than over the page, and the
 * menu of the screens stands on a card of its own. */
.app-bar-sample {
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: var(--space-4);
  padding: var(--space-3) 18px;
  border-radius: var(--radius-card);
}

.app-bar-sample .dropdown-panel {
  position: static;
  margin-top: var(--space-2);
}

.layout-side > .app-menu {
  grid-row: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
}
