/*
 * The components. Only design tokens from tokens.css: no colour codes, sizes, fonts or durations here
 * (scripts/check_design.py). Media queries are the exception, since they cannot read variables.
 * Breakpoints: mobile below 600, iPad portrait 820, iPad landscape 1180, desktop 1440.
 */

/* ---- Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--color-ground);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: var(--weight-heading);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-heading); /* marin: Source Sans 3 in weight 700 set slightly tighter */
  margin: 0;
}
h1 {
  font-size: var(--text-h1);
}
h2 {
  font-size: var(--text-2xl);
}
h3 {
  font-size: var(--text-xl);
}
a {
  color: var(--color-link);
}
/* A short name with its whole name in a title, as a column's Ver.nr (T2.45): no dotted underline, which the browser
   draws by default and which read as a link; the title and the aria label stay, for the pointer and a screen reader. */
abbr[title] {
  text-decoration: none;
}
:focus-visible {
  outline: var(--line-medium) solid var(--color-focus);
  outline-offset: var(--line-medium);
}
.ui-num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.ui-neg {
  color: var(--color-negative-amount);
  font-weight: var(--weight-strong);
}
/* A low value in the warning's colour, as the prototype's m-low (#501, P.0.17a, P.0.18): the portfolio's margin under 5 %
   and the ledger's days left to a due date within a week. The figure says it in itself, so the colour is never the only
   sign. */
.ui-low {
  color: var(--color-warning-text);
  font-weight: var(--weight-strong);
}
/* A saving in a deviation column, as the forecast's Diff mot kalkyl (1d.2): green, with its sign as the text. */
.ui-better {
  color: var(--color-positive-text);
  font-weight: var(--weight-medium);
}
.ui-muted {
  color: var(--color-text-3);
}
/* A date in running text, for example in a lead, is never broken at its hyphens (granskningslistan). */
.ui-date {
  white-space: nowrap;
}
/* A general comment under a table or a list: running text in italics (granskningslistan, 3/10). */
.ui-note {
  margin: 0;
  color: var(--color-text-3);
  font-style: italic;
}
/* A comment with a largest line length (measure, P.0.13): under the page's grid, where the row is as wide as the content
   and a line over the whole of a large screen is hard to read. */
.ui-note-measure {
  max-width: var(--note-measure);
}
.ui-visually-hidden {
  position: absolute;
  width: var(--line-thin);
  height: var(--line-thin);
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Display level: anything belonging to Avancerad (advanced) is hidden when an ancestor has the level Enkel (simple). */
[data-level="simple"] .ui-level-advanced {
  display: none;
}

/* ---- Page ---- */
.ui-page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--page-pad-top) var(--page-side) var(--space-11);
  display: flex;
  flex-direction: column;
  gap: var(--page-gap);
}
/* The regions of a filter that applies at once (ui-filter-flow on data-filter-view and data-filter-results, T2.59.1):
   no boxes of their own, so that the form, the message, the cards and the table stand in the page's column with its
   gap, as they did before the regions were marked. */
.ui-filter-flow {
  display: contents;
}
/* A row of actions directly under the page's head, as the prototype's .head .bar under its line (P.0.2): the island's
   first part when nothing stands before it, with --actions-after-head between them instead of the page's gap. */
.ui-page-head ~ .ui-island > .ui-editbar-plain:first-child {
  margin-top: calc(var(--actions-after-head) - var(--page-gap));
}
/* A page of cards in the page's grid (ui-page-cards, the pilot session after G1 of #535): the project's pages and pages of
   the same kind, as the economy's overviews, take a wider content, --content-max-wide, so that the grid reaches six
   tracks on a large screen; the row of tabs over it follows. Text pages, forms and the wide sheets keep --content-max.
   The views take the class in P.0.13 and P.0.14 (page_class). */
.ui-page.ui-page-cards {
  max-width: var(--content-max-wide);
}
.ui-page-cards .ui-tabs-inner {
  max-width: var(--content-max-wide);
}
/* A page over the whole width of the screen, for a sheet with many columns (the summary, 1e.6). From 1440 px the frame of its grid goes out over the page's side air (--grid-bleed, T2.51b), so that the sheet fits beside the folded side menu; the heading, the actions and the notes keep their air. */
.ui-page.ui-page-wide {
  max-width: none;
}
/* The selector meets every grid on a page over the whole width, not only the summary's (today one in each view); the 1440 px is --bp-desktop, which tests/test_sidenav.py holds equal. */
@media screen and (min-width: 1440px) {
  .ui-page.ui-page-wide .ui-grid-scroll {
    margin-left: calc(-1 * var(--grid-bleed));
    margin-right: calc(-1 * var(--grid-bleed));
  }
}
.ui-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5) var(--space-9);
}
.ui-page-head p {
  margin: 0;
  color: var(--color-text-2);
}
/* ---- The logo (brand_lockup, T2.64) ---- */
/* The symbol and the wordmark in Outfit; the vector's geometry is in em of the text, from the tokens (--brand-*). The
   colours follow the theme; on a ground that is dark in both themes (the top bar and the side menu) the dark theme's
   colours are used (ui-brand-on-dark). At 1 dppx or less the symbol is a hand-drawn one on whole pixels (T2.79, K10 D, at
   the end of this block): the small sizes (22 and 16 px) in Outfit 400 and the large one in 300. --brand-ink and
   --brand-space are the size's distances from the symbol's edge and from its square to the word, for the vector and
   for the hand-drawn symbol. */
.ui-brand {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--brand-ink) - var(--brand-vector-inset));
  font-family: var(--font-brand);
  font-weight: var(--brand-weight);
  letter-spacing: var(--brand-tracking);
  line-height: 1;
  white-space: nowrap;
  color: var(--brand-word);
}
.ui-brand-small {
  --brand-ink: var(--brand-ink-gap-22);
  --brand-space: var(--brand-hand-gap-22);
  font-size: var(--brand-size-small);
  font-weight: var(--brand-weight-small);
}
.ui-brand-large {
  --brand-ink: var(--brand-ink-gap-40);
  --brand-space: var(--brand-hand-gap-40);
  font-size: var(--brand-size-large);
}
/* Over a page's heading (lead), as on the sign-in page: left in line with the heading, the large size and, on a phone
   (under --bp-mobile, 600 px, which a media query cannot read; tests/test_brand.py holds the two equal) the small one. */
.ui-brand-lead {
  align-self: flex-start;
}
@media (max-width: 599px) {
  .ui-brand-lead {
    --brand-ink: var(--brand-ink-gap-22);
    --brand-space: var(--brand-hand-gap-22);
    font-size: var(--brand-size-small);
    font-weight: var(--brand-weight-small);
  }
}
.ui-brand-on-dark {
  --brand-symbol-line: var(--brand-on-dark-symbol-line);
  --brand-symbol-face: var(--brand-on-dark-symbol-face);
  --brand-word: var(--brand-on-dark-word);
  --brand-nav: var(--brand-on-dark-nav);
}
/* The catalog's sample of the logo on a dark ground: the top bar's ground behind it. */
.ui-brand-framed {
  padding: var(--space-6) var(--space-8);
  background: var(--color-band);
  border-radius: var(--radius-md);
}
.ui-brand-symbol {
  display: block;
  flex: none;
  width: var(--brand-symbol-height);
  height: var(--brand-symbol-height);
  margin: 0 var(--brand-symbol-room);
}
.ui-brand-face {
  fill: var(--brand-symbol-face);
}
.ui-brand-line {
  stroke: var(--brand-symbol-line);
}
.ui-brand-word {
  line-height: normal; /* the word's box is centred on the symbol's square, then moved (--brand-word-shift) */
  color: var(--brand-word);
  transform: translateY(var(--brand-word-shift));
}
.ui-brand-nav {
  color: var(--brand-nav);
}
/* The hand-drawn symbols (T2.79, K10 D, Björn 2/11 22.58): three SVG files, 23, 31 and 57 px, drawn on whole pixels, in
   the markup next to the vector and shown instead of it at 1 dppx or less (a screen at 100 %); above that the vector is
   shown. The size gives the symbol: 22 px the 31 px one, 40 px the 57 px one, 16 px (the top bar from 1180 to 1319 px)
   the 23 px one, and the lead on a phone is the small one. The square has no negative margin, the gap to the word is
   the size's (--brand-space), and the box is --brand-parity larger than the symbol in width and height, so that a row
   of 44 px, which centres it, puts the symbol's left and top edges on whole pixels. */
.ui-brand-hand {
  display: none;
  flex: none;
}
@media (max-resolution: 1dppx) {
  .ui-brand-symbol {
    display: none;
  }
  .ui-brand-small .ui-brand-hand-22,
  .ui-brand-large .ui-brand-hand-40 {
    display: block;
  }
  .ui-brand {
    gap: var(--brand-space);
  }
  .ui-brand:not(.ui-brand-framed) {
    padding-right: var(--brand-parity);
    padding-bottom: var(--brand-parity);
  }
}
@media (max-resolution: 1dppx) and (max-width: 599px) {
  .ui-brand-lead .ui-brand-hand-40 {
    display: none;
  }
  .ui-brand-lead .ui-brand-hand-22 {
    display: block;
  }
}

/* ---- The sender's line (ui-attribution, T2.72, K8, decision 0034) ---- */
/* The product's symbol and En produkt från and the product name, discreet, in the weakest text colour, last on a page of the customer's
   own and in the foot of what goes out (the print documents have the same as .doc .ui-attribution in print.css). The
   symbol is the logo's own, size mark: alone, a heavier line since it is small, and drawn as a vector also at 1 dppx or
   less, where the logo's hand-drawn symbols take over for the sizes that have one. */
.ui-attribution {
  display: inline-flex;
  align-items: center;
  gap: var(--attribution-gap);
  font-size: var(--attribution-size);
  line-height: var(--leading-normal);
  color: var(--attribution-text);
  white-space: nowrap;
}
.ui-attribution-on-dark {
  color: var(--attribution-text-on-dark);
}
.ui-attribution-row {
  display: flex;
  margin-top: var(--attribution-row-gap);
  padding-top: var(--attribution-row-space);
  border-top: var(--line-thin) solid var(--attribution-row-line);
}
.ui-brand-mark {
  gap: 0;
}
.ui-brand-mark .ui-brand-symbol {
  width: var(--attribution-symbol);
  height: var(--attribution-symbol);
  margin: 0;
}
.ui-brand-mark .ui-brand-line {
  stroke-width: var(--attribution-symbol-line);
}
@media (max-resolution: 1dppx) {
  .ui-brand-mark .ui-brand-symbol {
    display: block;
  }
  .ui-brand-mark:not(.ui-brand-framed) {
    padding: 0;
  }
}

/* ---- Navigation ---- */
.ui-band {
  background: var(--color-band);
  color: var(--color-band-text);
}
.ui-band-inner {
  position: relative; /* the top bar's popovers keep inside it */
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-6) var(--space-7);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5) var(--space-9);
}
/* The product's logo (the component brand_lockup, T2.64) and the company beside it on one row. */
.ui-logo {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-5);
  justify-content: center;
  min-height: var(--target-min);
  min-width: var(--target-min);
  font-family: var(--font-display);
  font-weight: var(--weight-heading);
  font-size: var(--text-lg);
  letter-spacing: normal;
  text-transform: none;
  color: inherit;
  text-decoration: none;
}
.ui-logo small {
  display: block;
  font-weight: var(--weight-regular);
  font-size: var(--text-xs);
  color: var(--color-band-muted);
}
.ui-band-tools {
  display: flex;
  align-items: center;
  gap: var(--space-7);
  flex-wrap: wrap;
}
.ui-user {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-band-muted);
}
.ui-user b {
  color: var(--color-band-text);
  font-weight: var(--weight-medium);
}
.ui-avatar {
  display: grid;
  place-items: center;
  width: var(--space-10);
  height: var(--space-10);
  border-radius: var(--radius-round);
  background: var(--color-brand-accent); /* the logo's salvia, a surface and never text */
  color: var(--color-band);
  font-weight: var(--weight-bold);
  font-size: var(--text-xs);
}
/* When the accounting system was last read (T7.1), and a link when something newer has come. */
.ui-fetched {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-band-muted);
  font-variant-numeric: tabular-nums;
}
.ui-fetched b {
  color: var(--color-band-text);
  font-weight: var(--weight-medium);
}
.ui-fetched-info summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--target-min);
  cursor: pointer;
  list-style: none;
}
.ui-fetched-info summary::-webkit-details-marker {
  display: none;
}
.ui-fetched-info summary::after {
  content: "?";
  display: inline-grid;
  place-items: center;
  width: var(--space-8);
  height: var(--space-8);
  border-radius: var(--radius-round);
  border: var(--line-thin) solid var(--color-band-muted);
  font-size: var(--text-2xs);
}
/* The help under Hämtat, at the right of the top row; the common placement (T2.94, ui-pop) keeps it inside the window
   and opens it over its button where there is no room under it. Its text wraps inside the box: from 1180 px the times
   in the top row stand on one line (white-space: nowrap on ui-fetched), and the help's text ran past its box and made
   the page wider (found when it was put under the common placement, T2.94). */
.ui-fetched-info p {
  position: absolute;
  z-index: 2;
  top: 100%;
  right: var(--space-7);
  width: min(var(--dialog-max), calc(100% - 2 * var(--space-7)));
  margin: var(--space-2) 0 0;
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-overlay);
  white-space: normal;
}
.ui-fetched-newer {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  color: var(--color-band-text);
  font-weight: var(--weight-bold);
}
.ui-theme {
  min-height: var(--target-min);
  padding: 0 var(--space-6);
  border-radius: var(--radius-round);
  border: var(--line-thin) solid var(--color-band-muted);
  background: var(--color-band-control);
  color: var(--color-band-text);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}
/* The top bar's menu: the areas the user may open, and signing out (E0.2). */
.ui-band-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-6);
}
.ui-band-menu a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  color: var(--color-band-muted);
  font-size: var(--text-sm);
  text-decoration: none;
}
.ui-band-menu a[aria-current="page"] {
  color: var(--color-band-text);
}
/* A planned area (1a.4): the same dot as a planned tab. */
.ui-band-menu a.ui-band-planned::after {
  content: "";
  display: inline-block;
  width: var(--dot);
  height: var(--dot);
  margin-left: var(--space-3);
  border-radius: var(--radius-round);
  background: var(--color-warning);
}
/* A number on a link of the menu, such as the new replies in the feedback (1a.5). */
.ui-band-count {
  display: inline-grid;
  place-items: center;
  min-width: var(--space-9);
  height: var(--space-9);
  margin-left: var(--space-3);
  padding: 0 var(--space-3);
  border-radius: var(--radius-round);
  /* The accent, the salvia as a surface (tokens.css) */
  background: var(--color-accent);
  color: var(--color-accent-text);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
}
.ui-band-menu form {
  margin: 0;
}
.ui-logo img {
  display: block;
  max-height: var(--space-10);
  max-width: calc(var(--space-11) * 4);
  margin-bottom: 0;
}
/* The product's logo (brand_lockup, T2.64) in the bar: the bar gives room by cutting the company name, never by
   squeezing the logo. */
.ui-logo .ui-brand {
  flex: none;
}
.ui-theme-icon {
  display: inline-grid;
  place-items: center;
  min-width: var(--target-min);
  padding: 0;
}
/* The switch shows the mode it is in: a sun in the light mode, a moon in the dark (aria-checked, components.js). */
.ui-theme-icon .ui-theme-moon,
.ui-theme-icon[aria-checked="true"] .ui-theme-sun {
  display: none;
}
.ui-theme-icon[aria-checked="true"] .ui-theme-moon {
  display: block;
}
/* The company name beside the logo is the choice of company for a user in several (T2.13). With a choice of company
   the logo and the company name are each a tap target of 44 px, side by side on one row since marin (T2.22), so the
   bar is as high for a user in several companies as for one in a single. */
.ui-logo-name {
  display: flex;
  align-items: center;
  min-height: var(--target-min);
  color: inherit;
  text-decoration: none;
}
.ui-logo-form,
.ui-logo-choice {
  margin: 0;
}
.ui-logo-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--target-min);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  list-style: none;
  cursor: pointer;
}
.ui-logo-switch::-webkit-details-marker {
  display: none;
}
.ui-logo-switch::after {
  content: "";
  flex: none;
  border: var(--space-2) solid transparent;
  border-top-color: var(--color-band-muted);
  border-bottom-width: 0;
}
/* The lists that open from the top bar stand over the tabs, which stay at the top from 1180 px (z-index 10), also when
   the compact project row (#506) puts the tabs right under the bar, where a long list of companies reaches. */
.ui-logo-list,
.ui-user-info[open] .ui-user-full {
  display: block;
  position: absolute;
  z-index: 20;
  top: 100%;
  margin: var(--space-2) 0 0;
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-overlay);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  letter-spacing: normal;
  text-transform: none;
}
.ui-logo-list {
  left: var(--space-7);
  min-width: var(--picker-min);
}
.ui-logo-list p {
  margin: 0 0 var(--space-3);
}
.ui-logo-list form {
  margin: 0;
}
.ui-logo-pick {
  display: block;
  width: 100%;
  min-height: var(--target-min);
  padding: 0 var(--space-6);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-action);
  font: inherit;
  font-weight: var(--weight-medium);
  text-align: left;
  cursor: pointer;
}
.ui-user-info {
  margin: 0;
}
.ui-user-info summary {
  min-width: var(--target-min);
  min-height: var(--target-min);
  list-style: none;
  cursor: pointer;
}
.ui-user-info summary::-webkit-details-marker {
  display: none;
}
.ui-user-full {
  display: none;
}
.ui-user-info[open] .ui-user-full {
  right: var(--space-7);
}
.ui-fetched-times {
  display: inline-flex;
  gap: var(--space-3);
}
.ui-fetched-all::before {
  content: "·";
  margin-right: var(--space-3);
}

/* The top bar on one row from 1180 px (T2.13), as the prototype's, with the same content: the company, the areas, when the
   accounting system was read, the user, light or dark, and signing out. The row is the full width of the page and gets
   room by smaller gaps and shorter texts, never by wrapping: the light or dark choice is an icon (with its name for a
   screen reader), signing out is a link in the menu's style, a long company name is cut at the end, the two times of
   the fetch stand over each other, and under 1320 px the user is the initials. Under 1180 px the bar wraps. */
@media (min-width: 1180px) {
  .ui-band-inner {
    gap: var(--space-4);
  }
  .ui-logo {
    flex: 0 1 auto;
    min-width: 0;
  }
  /* The logo (T2.22) is wider than the name was in text, so the company name is cut at 96 px in every width from
     1180 px, as the page is at most 1320 px; the whole name is in the title and in the choice of company. */
  .ui-logo small {
    max-width: calc(var(--space-11) * 2);
    letter-spacing: normal;
    text-transform: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ui-band-tools {
    gap: var(--space-4);
    min-width: 0;
  }
  .ui-band-menu {
    flex-wrap: nowrap;
    gap: var(--space-2) var(--space-4);
  }
  .ui-band-menu a {
    font-size: var(--text-xs);
    white-space: nowrap;
  }
  .ui-fetched {
    flex-wrap: nowrap;
    gap: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
    white-space: nowrap;
  }
  .ui-fetched-times {
    flex-direction: column;
    gap: 0;
    line-height: var(--leading-tight);
  }
  .ui-fetched-all::before {
    content: none;
  }
  .ui-fetched-newer {
    white-space: nowrap;
  }
  .ui-user {
    gap: var(--space-4);
    white-space: nowrap;
  }
  .ui-user b {
    max-width: calc(var(--space-11) * 2);
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .ui-band-signout {
    padding: 0;
    border-color: transparent;
    background: transparent;
    color: var(--color-band-muted);
    font-size: var(--text-xs);
    white-space: nowrap;
  }
}
/* The compact logo of the top bar (T2.79): the 23 px symbol at 1 dppx or less, in place of the 31 px one. */
@media (min-width: 1180px) and (max-width: 1319px) and (max-resolution: 1dppx) {
  .ui-logo .ui-brand .ui-brand-hand-22 {
    display: none;
  }
  .ui-logo .ui-brand .ui-brand-hand-16 {
    display: block;
  }
}
@media (min-width: 1180px) and (max-width: 1319px) {
  /* The logo a size lower, the company cut at 72 px and the gap beside it smaller where the user is only the initials
     too (T2.22), so that the bar stays on one row with room to spare: in CI's Linux the row was a few px too wide at
     1180 px for a user in several companies with long names (#381). */
  .ui-logo {
    gap: var(--space-4);
  }
  .ui-logo .ui-brand {
    --brand-ink: var(--brand-ink-gap-16);
    --brand-space: var(--brand-hand-gap-16);
    font-size: var(--brand-size-compact);
  }
  .ui-logo small {
    max-width: calc(var(--space-11) * 1.5);
  }
  .ui-user b {
    position: absolute;
    width: var(--line-thin);
    height: var(--line-thin);
    overflow: hidden;
    clip-path: inset(50%);
  }
}

/* Tabs: each tab is a link to its own address. */
.ui-tabs {
  position: relative; /* the button Tillbaka stands in the margin beside the band (T2.58) */
  background: var(--color-surface);
  border-bottom: var(--line-thin) solid var(--color-border);
  box-shadow: var(--shadow-raised);
}
.ui-tabs-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-7);
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-1);
}
/* The tabs stay when the page scrolls, from an iPad in landscape (T2.14), where they are on one row; what sticks under
   them (a table's header row, the edit bar) takes their height as its top, --sticky-top, which components.js measures. */
@media (min-width: 1180px) {
  .ui-tabs:not(.ui-tabs-sub) {
    position: sticky;
    top: 0;
    z-index: 10;
  }
}
/* What stays at the top must not cover the field the keyboard reaches (T2.140): the page scrolls a focused field into view
   below the lowest of them (the tabs, the edit bar, a table's header row), which components.js measures as --sticky-focus-top
   (the stack's height changes with the text, the width and the page, so not a value written here). The same room keeps an
   address with # below them. */
html {
  scroll-padding-top: var(--sticky-focus-top);
}
.ui-tab {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  padding: var(--space-5) var(--space-6);
  font-family: var(--font-display);
  font-weight: var(--weight-heading);
  font-size: var(--text-lg);
  letter-spacing: normal;
  text-transform: none;
  color: var(--color-text-2);
  text-decoration: none;
  border-bottom: var(--line-tab-active) solid transparent;
  white-space: nowrap;
}
/* A tab that gives nothing (muted, T2.47), such as a filter's tab with 0 in it: it stays, dimmed, so that the row does not jump. */
.ui-tab-muted {
  color: var(--color-text-3);
}
.ui-tab[aria-current="page"] {
  color: var(--color-tab-current);
  border-bottom-color: var(--color-tab-line);
}
/* Mer (T2.36): the tabs of a project on one row at every width, from 360 px. The tabs for what is built stand in the row
   and the rest in Mer, a menu at the end of the row; what does not fit the row moves into Mer from the end of the row,
   level by level (ui-tab-hide-1 is the last tab of the row, which moves first, and the first tab never moves). The row
   is its own container, so its width is what is left beside Tillbaka (shown only in the app on the home screen), and
   the levels follow the width of the row in a browser and in the app alike. Mer shows the name of the current tab when
   it is in Mer or has moved into it, and the name must fit: the row's class says how wide the name is (the server:
   -u no name, -s up to 95 px for Mer with its name, -m up to 110 px, -l up to 150 px, apps.core.tab_row), and the
   widths below are for that class, so the tabs move out earlier when Mer is wider. Where not even Projektöversikt and
   Mer with the name fit (the app at 360 px with the longest name, Levande budget: the arrow of Tillbaka, T2.39, leaves a row of 262 px), Mer says Mer and is marked, and the name is on the
   page and in the menu. The widths are measured for the project's tabs (Projektöversikt 129 px, ÄTA 49, Levande budget
   134, Prognos 81, Rapporter 94, a gap of 4, Mer 64) plus the name's width and 4 px to spare, and
   e2e/tab-row.spec.ts measures the row at every width, so that a change in the list of tabs
   (apps/projects/tab_list.py) that makes the row too wide, or a name clipped, fails there. Mer is a details: without
   JavaScript every tab is reached by opening it, and components.js adds the rest. */
.ui-tabs-inner:has(> .ui-tabs-row) {
  flex-wrap: nowrap;
}
/* On a phone the row has less air at the sides, so that Tillbaka, Projektöversikt and a name in Mer fit. */
@media (max-width: 479px) {
  .ui-tabs-inner:has(> .ui-tabs-row) {
    padding-right: var(--space-4);
    padding-left: var(--space-4);
  }
}
.ui-tabs-row {
  flex: 1 1 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 0 var(--space-1);
  min-width: 0;
  container-type: inline-size;
}
.ui-tabs-row > .ui-tab {
  flex: none;
}
.ui-tab-more {
  position: relative;
  display: flex;
  flex: 0 1 auto;
  min-width: 0;
}
.ui-tab-more-button {
  flex: 0 1 auto;
  gap: var(--space-3);
  min-width: 0;
  cursor: pointer;
  list-style: none;
}
.ui-tab-more-button::-webkit-details-marker {
  display: none;
}
.ui-tab-more-label,
.ui-tab-more-named {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ui-tab-more-named {
  display: none;
}
.ui-tab-more-caret {
  flex: none;
  border: var(--space-2) solid transparent;
  border-top-color: currentColor;
  border-bottom-width: 0;
}
.ui-tab-more[open] .ui-tab-more-caret {
  transform: rotate(180deg);
}
/* Mer is marked when the current tab is in it (and shows its name), as a current tab is. */
.ui-tab-more-current .ui-tab-more-button {
  color: var(--color-tab-current);
  border-bottom-color: var(--color-tab-line);
}
.ui-tab-more-current .ui-tab-more-label {
  display: none;
}
.ui-tab-more-current .ui-tab-more-named {
  display: block;
}
/* The menu hangs from the button (T2.49): its left edge at the button's left edge, a gap of --space-2 under it, and the same
   border, radius and shadow as the project picker's list and the user menu (--shadow-overlay). The common placement
   (T2.94, ui-pop) keeps it --pop-edge from the screen's edges: it is right-aligned to the button where it would go past
   the right edge. Without JavaScript it hangs from the button's left edge and can pass the right edge of the screen when
   Mer stands far to the right: every tab is still in the menu, and only the script keeps it inside the screen (G1 of
   T2.49). */
.ui-tab-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + var(--space-2));
  left: 0;
  display: none;
  width: max-content;
  max-width: calc(100vw - 2 * var(--space-7));
  margin: 0;
  padding: var(--space-3);
  list-style: none;
  background: var(--color-surface);
  border: var(--line-thin) solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-overlay);
}
.ui-tab-more[open] .ui-tab-menu {
  display: block;
}
.ui-tab-menu li {
  margin: 0;
}
.ui-tab-menu-item {
  display: flex;
  align-items: center;
  min-height: var(--target-min);
  padding: 0 var(--space-6);
  font-family: var(--font-display);
  font-weight: var(--weight-heading);
  font-size: var(--text-lg);
  color: var(--color-text-2);
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius-sm);
}
/* The heading of the tabs of the modules outside grundfasen in Mer (T2.41), not a link. */
.ui-tab-menu-heading {
  padding: var(--space-6) var(--space-6) var(--space-2);
  border-top: var(--line-thin) solid var(--color-border-soft);
  color: var(--color-text-2);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}
.ui-tab-menu-item:hover {
  background: var(--color-surface-2);
}
.ui-tab-menu-item[aria-current="page"] {
  color: var(--color-tab-current);
}
/* What moves into Mer is in the menu only where it has moved. */
.ui-tab-menu-hide-1,
.ui-tab-menu-hide-2,
.ui-tab-menu-hide-3,
.ui-tab-menu-hide-4 {
  display: none;
}
@container (max-width: 576px) {
  .ui-tabs-row-u .ui-tab-hide-1 {
    display: none;
  }
  .ui-tabs-row-u .ui-tab-menu-hide-1 {
    display: list-item;
  }
}
@container (max-width: 478px) {
  .ui-tabs-row-u .ui-tab-hide-2 {
    display: none;
  }
  .ui-tabs-row-u .ui-tab-menu-hide-2 {
    display: list-item;
  }
}
@container (max-width: 393px) {
  .ui-tabs-row-u .ui-tab-hide-3 {
    display: none;
  }
  .ui-tabs-row-u .ui-tab-menu-hide-3 {
    display: list-item;
  }
}
@container (max-width: 255px) {
  .ui-tabs-row-u .ui-tab-hide-4 {
    display: none;
  }
  .ui-tabs-row-u .ui-tab-menu-hide-4 {
    display: list-item;
  }
}
@container (max-width: 608px) {
  .ui-tabs-row-s .ui-tab-hide-1 {
    display: none;
  }
  .ui-tabs-row-s .ui-tab-menu-hide-1 {
    display: list-item;
  }
  .ui-tabs-row-s .ui-tab-more-hide-1 .ui-tab-more-button {
    color: var(--color-tab-current);
    border-bottom-color: var(--color-tab-line);
  }
  .ui-tabs-row-s .ui-tab-more-hide-1 .ui-tab-more-label {
    display: none;
  }
  .ui-tabs-row-s .ui-tab-more-hide-1 .ui-tab-more-named {
    display: block;
  }
}
@container (max-width: 510px) {
  .ui-tabs-row-s .ui-tab-hide-2 {
    display: none;
  }
  .ui-tabs-row-s .ui-tab-menu-hide-2 {
    display: list-item;
  }
  .ui-tabs-row-s .ui-tab-more-hide-2 .ui-tab-more-button {
    color: var(--color-tab-current);
    border-bottom-color: var(--color-tab-line);
  }
  .ui-tabs-row-s .ui-tab-more-hide-2 .ui-tab-more-label {
    display: none;
  }
  .ui-tabs-row-s .ui-tab-more-hide-2 .ui-tab-more-named {
    display: block;
  }
}
@container (max-width: 425px) {
  .ui-tabs-row-s .ui-tab-hide-3 {
    display: none;
  }
  .ui-tabs-row-s .ui-tab-menu-hide-3 {
    display: list-item;
  }
  .ui-tabs-row-s .ui-tab-more-hide-3 .ui-tab-more-button {
    color: var(--color-tab-current);
    border-bottom-color: var(--color-tab-line);
  }
  .ui-tabs-row-s .ui-tab-more-hide-3 .ui-tab-more-label {
    display: none;
  }
  .ui-tabs-row-s .ui-tab-more-hide-3 .ui-tab-more-named {
    display: block;
  }
}
@container (max-width: 287px) {
  .ui-tabs-row-s .ui-tab-hide-4 {
    display: none;
  }
  .ui-tabs-row-s .ui-tab-menu-hide-4 {
    display: list-item;
  }
  .ui-tabs-row-s .ui-tab-more-hide-4 .ui-tab-more-button {
    color: var(--color-tab-current);
    border-bottom-color: var(--color-tab-line);
  }
  .ui-tabs-row-s .ui-tab-more-hide-4 .ui-tab-more-label {
    display: none;
  }
  .ui-tabs-row-s .ui-tab-more-hide-4 .ui-tab-more-named {
    display: block;
  }
}
@container (max-width: 624px) {
  .ui-tabs-row-m .ui-tab-hide-1 {
    display: none;
  }
  .ui-tabs-row-m .ui-tab-menu-hide-1 {
    display: list-item;
  }
  .ui-tabs-row-m .ui-tab-more-hide-1 .ui-tab-more-button {
    color: var(--color-tab-current);
    border-bottom-color: var(--color-tab-line);
  }
  .ui-tabs-row-m .ui-tab-more-hide-1 .ui-tab-more-label {
    display: none;
  }
  .ui-tabs-row-m .ui-tab-more-hide-1 .ui-tab-more-named {
    display: block;
  }
}
@container (max-width: 526px) {
  .ui-tabs-row-m .ui-tab-hide-2 {
    display: none;
  }
  .ui-tabs-row-m .ui-tab-menu-hide-2 {
    display: list-item;
  }
  .ui-tabs-row-m .ui-tab-more-hide-2 .ui-tab-more-button {
    color: var(--color-tab-current);
    border-bottom-color: var(--color-tab-line);
  }
  .ui-tabs-row-m .ui-tab-more-hide-2 .ui-tab-more-label {
    display: none;
  }
  .ui-tabs-row-m .ui-tab-more-hide-2 .ui-tab-more-named {
    display: block;
  }
}
@container (max-width: 441px) {
  .ui-tabs-row-m .ui-tab-hide-3 {
    display: none;
  }
  .ui-tabs-row-m .ui-tab-menu-hide-3 {
    display: list-item;
  }
  .ui-tabs-row-m .ui-tab-more-hide-3 .ui-tab-more-button {
    color: var(--color-tab-current);
    border-bottom-color: var(--color-tab-line);
  }
  .ui-tabs-row-m .ui-tab-more-hide-3 .ui-tab-more-label {
    display: none;
  }
  .ui-tabs-row-m .ui-tab-more-hide-3 .ui-tab-more-named {
    display: block;
  }
}
@container (max-width: 303px) {
  .ui-tabs-row-m .ui-tab-hide-4 {
    display: none;
  }
  .ui-tabs-row-m .ui-tab-menu-hide-4 {
    display: list-item;
  }
  .ui-tabs-row-m .ui-tab-more-hide-4 .ui-tab-more-button {
    color: var(--color-tab-current);
    border-bottom-color: var(--color-tab-line);
  }
  .ui-tabs-row-m .ui-tab-more-hide-4 .ui-tab-more-label {
    display: none;
  }
  .ui-tabs-row-m .ui-tab-more-hide-4 .ui-tab-more-named {
    display: block;
  }
}
@container (max-width: 662px) {
  .ui-tabs-row-l .ui-tab-hide-1 {
    display: none;
  }
  .ui-tabs-row-l .ui-tab-menu-hide-1 {
    display: list-item;
  }
  .ui-tabs-row-l .ui-tab-more-hide-1 .ui-tab-more-button {
    color: var(--color-tab-current);
    border-bottom-color: var(--color-tab-line);
  }
  .ui-tabs-row-l .ui-tab-more-hide-1 .ui-tab-more-label {
    display: none;
  }
  .ui-tabs-row-l .ui-tab-more-hide-1 .ui-tab-more-named {
    display: block;
  }
}
@container (max-width: 564px) {
  .ui-tabs-row-l .ui-tab-hide-2 {
    display: none;
  }
  .ui-tabs-row-l .ui-tab-menu-hide-2 {
    display: list-item;
  }
  .ui-tabs-row-l .ui-tab-more-hide-2 .ui-tab-more-button {
    color: var(--color-tab-current);
    border-bottom-color: var(--color-tab-line);
  }
  .ui-tabs-row-l .ui-tab-more-hide-2 .ui-tab-more-label {
    display: none;
  }
  .ui-tabs-row-l .ui-tab-more-hide-2 .ui-tab-more-named {
    display: block;
  }
}
@container (max-width: 479px) {
  .ui-tabs-row-l .ui-tab-hide-3 {
    display: none;
  }
  .ui-tabs-row-l .ui-tab-menu-hide-3 {
    display: list-item;
  }
  .ui-tabs-row-l .ui-tab-more-hide-3 .ui-tab-more-button {
    color: var(--color-tab-current);
    border-bottom-color: var(--color-tab-line);
  }
  .ui-tabs-row-l .ui-tab-more-hide-3 .ui-tab-more-label {
    display: none;
  }
  .ui-tabs-row-l .ui-tab-more-hide-3 .ui-tab-more-named {
    display: block;
  }
}
@container (max-width: 341px) {
  .ui-tabs-row-l .ui-tab-hide-4 {
    display: none;
  }
  .ui-tabs-row-l .ui-tab-menu-hide-4 {
    display: list-item;
  }
  .ui-tabs-row-l .ui-tab-more-hide-4 .ui-tab-more-button {
    color: var(--color-tab-current);
    border-bottom-color: var(--color-tab-line);
  }
  .ui-tabs-row-l .ui-tab-more-hide-4 .ui-tab-more-label {
    display: none;
  }
  .ui-tabs-row-l .ui-tab-more-hide-4 .ui-tab-more-named {
    display: block;
  }
}
/* Where Projektöversikt and Mer with the name do not fit, Mer says Mer (and stays marked). */
@container (max-width: 230px) {
  .ui-tabs-row-s .ui-tab-more .ui-tab-more-label {
    display: block;
  }
  .ui-tabs-row-s .ui-tab-more .ui-tab-more-named {
    display: none;
  }
}
@container (max-width: 246px) {
  .ui-tabs-row-m .ui-tab-more .ui-tab-more-label {
    display: block;
  }
  .ui-tabs-row-m .ui-tab-more .ui-tab-more-named {
    display: none;
  }
}
@container (max-width: 284px) {
  .ui-tabs-row-l .ui-tab-more .ui-tab-more-label {
    display: block;
  }
  .ui-tabs-row-l .ui-tab-more .ui-tab-more-named {
    display: none;
  }
}
.ui-tab-planned {
  color: var(--color-text-3);
  font-weight: var(--weight-regular);
}
.ui-tab-planned::after {
  content: "";
  display: inline-block;
  width: var(--dot);
  height: var(--dot);
  margin-left: var(--space-3);
  border-radius: var(--radius-round);
  background: var(--color-warning);
}
/* Tillbaka (T2.10): first in the main row, when the portal has an earlier step (navigation.js shows it), for the
   app on the home screen. It is shown only in the app on the home screen (display-mode: standalone), where the
   browser's own Back is missing, and never in a browser, with a mouse or on a touch screen, since Safari and the others
   have a Back of their own (T2.35, Björn 31/10, which replaced T2.30's rule of a touch screen or the app). Since T2.58
   (Björn 1/11) it is the variant back of the button (.ui-button-back, in the buttons below), outside the band of the
   tabs: the band starts after it and a gap (--button-back-gap), so that the button's left edge is the left edge of the
   content and it is not taken for a tab. The button stands in the margin that the band leaves
   (--back-room), and its colours, size and corners are the tokens --button-back-*. It is the arrow alone at every width
   (T2.39, Björn 31/10: the word beside the arrow took 44 px that a name in Mer needs on a phone, and the word could be
   mixed up with the menu's choices; Björn 1/11: and one form is recognised, so not the word from 1440 px either), with
   the name Tillbaka as its aria-label and title; the token --button-back-label (none or inline) is the one place that
   says whether the word stands beside the arrow. */
:root {
  --back-room: calc(var(--button-back-width) + var(--button-back-gap)); /* the room the button takes at the left of the band */
}
@media (display-mode: standalone) {
  .ui-button-back-nav:not([hidden]) {
    display: inline-flex;
  }
  .ui-tabs:not(.ui-tabs-sub):has(> .ui-tabs-inner > .ui-button-back-nav:not([hidden])) {
    margin-left: var(--back-room);
  }
}
/* The app on the home screen as the page itself finds it (static/webapp/register.js: display-mode standalone, or
   navigator.standalone in an older iOS), which a test can set and an older browser reports. */
html[data-display="standalone"] .ui-button-back-nav:not([hidden]) {
  display: inline-flex;
}
html[data-display="standalone"] .ui-tabs:not(.ui-tabs-sub):has(> .ui-tabs-inner > .ui-button-back-nav:not([hidden])) {
  margin-left: var(--back-room);
}
/* The catalogue shows the button whatever the screen is. */
button.ui-button-back-nav.ui-button-back-preview {
  display: inline-flex;
}
.ui-tabs-back-preview {
  margin-left: var(--back-room);
}
/* Under 1180 px the tabs do not stay when the page scrolls (T2.14), so in the app the button Tillbaka, which stands in
   their row, would scroll away with it, on an iPad standing up above all (the weekly status 28/10). In the app the
   band of the tabs stays at every width, as it does from 1180 px, and with it the button and the tabs (T2.19, the
   prototype's .nav is sticky too); components.js measures the height as --sticky-top for what sticks under them. In a
   browser nothing changes, and the print rule hides the tabs. */
@media (display-mode: standalone) and (max-width: 1179px) {
  .ui-tabs:not(.ui-tabs-sub) {
    position: sticky;
    top: 0;
    z-index: 10;
  }
}
@media (max-width: 1179px) {
  html[data-display="standalone"] .ui-tabs:not(.ui-tabs-sub) {
    position: sticky;
    top: 0;
    z-index: 10;
  }
}
/* From 1180 to 1319 px the tabs' own air is a little less (T2.30, for the eleven tabs of a project beside Tillbaka; since
   T2.36 a project's row has Mer and the row's widths below are for the wider tabs, so there is room over). */
@media (min-width: 1180px) and (max-width: 1319px) {
  .ui-tabs:not(.ui-tabs-sub) .ui-tab {
    padding-right: var(--space-5);
    padding-left: var(--space-5);
  }
}
.ui-tabs-sub {
  background: var(--color-surface-2);
  box-shadow: none;
}
.ui-tabs-sub .ui-tab {
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  letter-spacing: normal;
  text-transform: none;
  border-bottom-width: var(--line-tab-active);
}
/* The row of tabs A (T2.70, Björn 1/11 via the pilot session, the layout sketch's choice "A: linje under"), the variant
   for a project's tabs: the tabs stand straight on the page's ground, with no band, no edge across the screen and no
   card's surface, and a thin line under them only as wide as the content, the cards' edges (the content box of the
   row, inside its air at the sides, so it follows the air under 480 px too). The chosen tab keeps the accent's colour
   and its line of 2 px over the thin one. The tabs themselves are as in every row (font, air and the widths that Mer
   is measured for), and the surface is the ground's, so the row still hides what scrolls under it where it sticks. */
.ui-tabs-line {
  background: var(--tabs-line-surface);
  border-bottom: 0;
  box-shadow: none;
}
.ui-tabs-line > .ui-tabs-inner {
  background: linear-gradient(to top, var(--tabs-line-edge) var(--tabs-line-width), transparent var(--tabs-line-width))
    content-box;
}
/* In a view the row stands in the page's content, which has the page's air already (P.0.14, the layout sketch): the
   row has no air of its own, so that the thin line is exactly as wide as the cards, also under 480 px, and the first
   tab has none at its left, so that its text starts at the content's edge, as the heading and the cards do. */
.ui-tabs-line > .ui-tabs-inner,
.ui-tabs-line > .ui-tabs-inner:has(> .ui-tabs-row) {
  padding-right: 0;
  padding-left: 0;
}
.ui-tabs-line .ui-tabs-row > .ui-tab:first-child,
.ui-tabs-line > .ui-tabs-inner > .ui-tab:first-of-type {
  padding-left: 0;
}

/* ---- The side menu (T2.27) ---- */
/* The portal's frame for a signed-in member since T2.73 (decision 0036): the side menu in the top bar's place
   (base.html, components/sidenav.html); the top bar stays for the pages without a member's menu. From 820 px open (names and pictures) or folded (pictures only), chosen with the button at the foot, kept
   in the browser, and by default folded under 1440 px and open from 1440 px, decided when the page loads (T2.51); the page beside it is pushed and the
   logo and every row stay where they are (T2.29). Under 820 px behind a button in a bar at the top, opened over the
   page (components.js). Every tap target is 44 px. */
.ui-sidenav {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: var(--sidenav-width);
  min-height: 0;
  padding: var(--space-6) var(--space-6) var(--space-7);
  background: var(--color-nav);
  color: var(--color-nav-text);
  font-family: var(--font-body);
}
/* The focus ring on the menu's slate is the salvia; the dark sage of the light theme is too dark on it. */
.ui-sidenav :focus-visible,
.ui-sidenav-bar :focus-visible {
  outline-color: var(--color-nav-current);
}
.ui-sidenav .ui-sidenav-usermenu :focus-visible {
  outline-color: var(--color-focus);
}
.ui-sidenav-head,
.ui-sidenav-menu,
.ui-sidenav-foot {
  align-self: stretch;
}
.ui-sidenav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
  margin-bottom: var(--space-4);
  border-bottom: var(--line-thin) solid var(--color-nav-line);
}
.ui-sidenav-logo {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  min-width: var(--target-min);
  padding: 0 var(--space-4);
  color: inherit;
  font-family: var(--font-display);
  font-weight: var(--weight-heading);
  font-size: var(--text-lg);
  text-decoration: none;
}
/* The customer's own logo in the product's logo's place (T2.73): as high as the top bar's, and within the menu's width. */
/* The image is the custom property --company-logo, which components/sidenav.html writes once (V45-4), shown as the background
   of a span with role="img" and the company's name as its label (V46-7), so that a logo of up to 87 kB is not in the page twice
   and a screen reader reads a name, not an img without a src. The span has no size of its own: it is as wide as the link and as
   high as the top bar's, and the logo is fitted inside it, from the left. */
.ui-sidenav-logo:has(.ui-sidenav-company-logo) {
  flex: 1 1 auto;
  min-width: 0;
}
.ui-sidenav-company-logo {
  display: block;
  width: 100%;
  height: var(--space-10);
  background: var(--company-logo) left center / contain no-repeat;
}
/* A logo higher than wide (V46-7, the pilot session 11/11): at the top bar's height it is about 20 px wide and its text
   cannot be read, so it stands higher; a wide one keeps its size. The folded menu keeps its width of a square but not its
   height, so that the head is as high folded as open (V46-7b). */
.ui-sidenav-company-logo-tall {
  height: var(--sidenav-logo-tall-height);
}
.ui-sidenav-close,
.ui-sidenav-open {
  display: none;
  place-items: center;
  flex: none;
  width: var(--target-min);
  height: var(--target-min);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-nav-muted);
  cursor: pointer;
}
.ui-sidenav-menu {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  /* From a window height of 700 px the areas fit and there is nothing to scroll (the group Kommande folded); under it
     the list scrolls, with a thin scrollbar in the menu's own colours and not the classic one (T2.41). */
  scrollbar-width: thin;
  scrollbar-color: var(--color-nav-scroll) transparent;
}
@supports not (scrollbar-width: thin) {
  .ui-sidenav-menu::-webkit-scrollbar {
    width: var(--sidenav-scroll-width);
  }
  .ui-sidenav-menu::-webkit-scrollbar-track {
    background: transparent;
  }
  .ui-sidenav-menu::-webkit-scrollbar-thumb {
    border-radius: var(--radius-round);
    background: var(--color-nav-scroll);
  }
}
.ui-sidenav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-6);
  min-height: var(--target-min);
  padding: 0 var(--space-6);
  border-radius: var(--radius-md);
  color: var(--color-nav-muted);
  font-size: var(--text-lg);
  font-weight: var(--weight-heading);
  text-decoration: none;
}
.ui-sidenav-icon {
  flex: none;
  width: var(--icon-nav);
  height: var(--icon-nav);
  fill: none;
  stroke: var(--color-nav-icon);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ui-sidenav-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The chosen area: a lighter surface, the salvia for its text and icon, and a mark at the edge, so not by colour alone. */
.ui-sidenav-link[aria-current="page"] {
  background: var(--color-nav-active);
  color: var(--color-nav-current);
}
.ui-sidenav-link[aria-current="page"] .ui-sidenav-icon {
  stroke: var(--color-nav-current);
}
.ui-sidenav-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: var(--space-5);
  bottom: var(--space-5);
  width: var(--line-thick);
  border-radius: var(--radius-sm);
  background: var(--color-nav-current);
}
/* A planned area (1a.4): the dot of a planned tab, and "(planerad)" for a screen reader. */
.ui-sidenav-planned .ui-sidenav-label {
  font-weight: var(--weight-regular);
}
.ui-sidenav-planned::after {
  content: "";
  flex: none;
  width: var(--dot);
  height: var(--dot);
  border-radius: var(--radius-round);
  background: var(--color-warning);
}
/* A number on an area, such as the new replies in the feedback (1a.5). */
.ui-sidenav-count {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: var(--space-8);
  height: var(--space-8);
  padding: 0 var(--space-3);
  border-radius: var(--radius-round);
  background: var(--color-nav-count);
  color: var(--color-nav-count-text);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
}
/* The group Kommande (T2.41): the modules outside grundfasen, shown when the company has chosen to see them, in one
   folded row before Instruktion. The row is a summary of a details, so a tap, Enter or Space opens it; it is open when
   it holds the current area. Its areas are the menu's links, with the dot of a planned area. */
.ui-sidenav-group {
  margin: 0;
}
.ui-sidenav-group-summary {
  cursor: pointer;
  list-style: none;
}
.ui-sidenav-group-summary::-webkit-details-marker {
  display: none;
}
.ui-sidenav-group-chevron {
  flex: none;
  width: var(--icon);
  height: var(--icon);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ui-sidenav-group[open] .ui-sidenav-group-chevron {
  transform: rotate(180deg);
}
.ui-sidenav-group-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-top: var(--space-1);
}
/* The button that folds and opens the menu (T2.29): at the foot, above the user's menu, with a picture and the words
   "Fäll ihop" or "Fäll ut", framed so that it is not taken for an area. Folded, only the picture is seen and the words are its
   label, shown beside it like an area's name (T2.90.1). Not shown under 820 px, where the menu is a drawer with its own close button. */
.ui-sidenav-toggle {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  width: 100%;
  height: var(--target-min);
  margin: 0 0 var(--space-4);
  padding: 0 var(--space-5);
  border: var(--line-thin) solid var(--color-nav-line);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-nav-muted);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
}
.ui-sidenav-toggle svg {
  flex: none;
}
.ui-sidenav-toggle-unfold {
  display: none;
}
/* The user's menu in the foot: the user and the company, the choice of company, when the accounting system was read,
   light or dark, and signing out. It opens with a tap (details), and Esc or a tap outside closes it (components.js). */
.ui-sidenav-foot {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-top: auto;
  padding-top: var(--space-5);
  border-top: var(--line-thin) solid var(--color-nav-line);
}
/* The sender's line at the foot of the menu, when the customer shows its own logo (K8); folded to the pictures it is left out. */
.ui-sidenav-attribution {
  align-self: stretch;
  padding: var(--space-4) var(--space-4) 0;
}
.ui-sidenav-user {
  margin: 0;
}
.ui-sidenav-user > summary {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  box-sizing: border-box;
  /* the same height open and folded, so that the button above it stays where it is (T2.29) */
  height: calc(var(--target-min) + var(--space-2));
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--color-nav-text);
  list-style: none;
  cursor: pointer;
}
.ui-sidenav-user > summary::-webkit-details-marker {
  display: none;
}
.ui-sidenav-user[open] > summary {
  background: var(--color-nav-active);
}
.ui-sidenav-user .ui-avatar {
  flex: none;
}
.ui-sidenav-user-text {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--color-nav-muted);
  font-size: var(--text-xs);
  line-height: var(--leading-tight);
}
.ui-sidenav-user-first {
  display: none;
}
.ui-sidenav-user-text b,
.ui-sidenav-user-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ui-sidenav-user-text b {
  color: var(--color-nav-text);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
}
.ui-sidenav-chevron {
  flex: none;
  width: var(--icon);
  height: var(--icon);
  fill: none;
  stroke: var(--color-nav-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ui-sidenav-usermenu {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: calc(100% + var(--space-2));
  display: flex;
  flex-direction: column;
  padding: var(--space-3);
  border: var(--line-thin) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-overlay);
  font-size: var(--text-md);
}
.ui-sidenav-usermenu-head {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: var(--space-4) var(--space-5) var(--space-3);
  color: var(--color-text-2);
  font-size: var(--text-xs);
  overflow-wrap: break-word;
}
.ui-sidenav-usermenu-head b {
  color: var(--color-text);
  font-size: var(--text-md);
}
.ui-sidenav-usermenu form {
  margin: 0;
}
.ui-sidenav-item {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  width: 100%;
  min-height: var(--target-min);
  margin: 0;
  padding: 0 var(--space-5);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.ui-sidenav-foot > .ui-sidenav-theme {
  color: var(--color-nav-muted);
}
/* The switch shows the mode it is in, as the top bar's: a sun in the light mode, a moon in the dark. */
.ui-sidenav-theme svg {
  flex: none;
}
.ui-sidenav-theme .ui-theme-moon,
.ui-sidenav-theme[aria-checked="true"] .ui-theme-sun {
  display: none;
}
.ui-sidenav-theme[aria-checked="true"] .ui-theme-moon {
  display: block;
}
/* The row of events not sent above Logga ut (1g.11c, K52): quiet grey with a grey edge, never a warning */
.ui-sidenav-unsent {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin: var(--space-2) 0;
  padding: var(--space-4) var(--space-5);
  border-left: var(--sidenav-unsent-edge);
  border-radius: var(--radius-sm);
  background: var(--sidenav-unsent-surface);
  color: var(--sidenav-unsent-text);
  font-size: var(--text-xs);
}
.ui-sidenav-unsent[hidden] {
  display: none;
}
.ui-sidenav-unsent p {
  margin: 0;
}
.ui-sidenav-unsent b {
  color: var(--sidenav-unsent-strong);
}
.ui-sidenav-unsent-icon {
  flex: none;
  width: var(--sidenav-unsent-icon);
  height: var(--sidenav-unsent-icon);
  margin-top: var(--space-1);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--icon-line);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ui-sidenav-usermenu .ui-fetched {
  display: flex;
  margin: var(--space-2) 0;
  padding: 0 var(--space-5);
  border-top: var(--line-thin) solid var(--color-border-soft);
  border-bottom: var(--line-thin) solid var(--color-border-soft);
  color: var(--color-text-2);
  font-size: var(--text-xs);
}
.ui-sidenav-usermenu .ui-fetched b {
  color: var(--color-text);
}
.ui-sidenav-usermenu .ui-fetched-info summary::after {
  border-color: var(--color-text-3);
}
.ui-sidenav-usermenu .ui-fetched-info p {
  position: static;
  width: auto;
  margin: 0 0 var(--space-4);
  padding: 0;
  background: transparent;
  color: var(--color-text-2);
  box-shadow: none;
}
.ui-sidenav-usermenu .ui-fetched-newer {
  color: var(--color-action);
}
/* The bar at the top under 820 px, with the button that opens the menu. */
.ui-sidenav-bar {
  display: none;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-6);
  background: var(--color-nav);
  color: var(--color-nav-text);
}
.ui-sidenav-bar .ui-sidenav-open {
  display: inline-grid;
  color: var(--color-nav-text);
}
.ui-sidenav-scrim[hidden] {
  display: none;
}
/* Folded to its icons: the catalog's sample (ui-sidenav-mini), and the page under 1440 px below, without a saved choice. The names stay
   for a screen reader. */
.ui-sidenav-mini {
  width: var(--sidenav-mini-width);
  padding-right: var(--space-5);
  padding-left: var(--space-5);
  align-items: center;
}
.ui-sidenav-mini .ui-sidenav-head {
  justify-content: center;
}
.ui-sidenav-mini .ui-sidenav-menu,
.ui-sidenav-mini .ui-sidenav-foot {
  align-items: center;
}
.ui-sidenav-mini .ui-sidenav-logo {
  padding: 0;
  justify-content: center;
}
.ui-sidenav-mini .ui-sidenav-company-logo {
  width: var(--target-min);
  height: var(--target-min);
  background-position: center;
}
/* A tall logo stands as high folded as open, so that the head and every row under it keep their place (T2.29, V46-7b). */
.ui-sidenav-mini .ui-sidenav-company-logo-tall {
  height: var(--sidenav-logo-tall-height);
}
.ui-sidenav-mini .ui-sidenav-attribution,
.ui-sidenav-mini .ui-sidenav-logo .ui-brand-word,
.ui-sidenav-mini .ui-sidenav-group-chevron,
.ui-sidenav-mini .ui-sidenav-chevron {
  display: none;
}
.ui-sidenav-mini .ui-sidenav-toggle {
  width: var(--target-min);
  padding: 0;
}
.ui-sidenav-mini .ui-sidenav-toggle-icon {
  transform: rotate(180deg);
}
.ui-sidenav-mini .ui-sidenav-toggle-fold {
  display: none;
}
.ui-sidenav-mini .ui-sidenav-toggle-unfold {
  display: inline;
}
.ui-sidenav-mini .ui-sidenav-link,
.ui-sidenav-mini .ui-sidenav-user > summary,
.ui-sidenav-mini .ui-sidenav-foot > .ui-sidenav-theme {
  width: var(--target-min);
  padding: 0;
  justify-content: center;
}
.ui-sidenav-mini .ui-sidenav-label,
.ui-sidenav-mini .ui-sidenav-user-text,
.ui-sidenav-mini .ui-sidenav-toggle-unfold {
  position: absolute;
  width: var(--line-thin);
  height: var(--line-thin);
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.ui-sidenav-mini .ui-sidenav-count {
  position: absolute;
  top: 0;
  right: 0;
  min-width: var(--space-7);
  height: var(--space-7);
  padding: 0 var(--space-2);
}
.ui-sidenav-mini .ui-sidenav-planned::after {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
}
.ui-sidenav-mini .ui-sidenav-usermenu {
  left: calc(100% + var(--space-4));
  right: auto;
  bottom: 0;
  width: var(--picker-min);
}
/* The folded menu's label (T2.90, the variant tip): the name of the area beside its picture, shown on hover with a mouse, on
   focus with the keyboard and on a long press with touch (components.js sets data-tip-open on the link, and --tip-x, the menu's
   right edge, and --tip-y, the link's middle, in pixels). It is the area's own label, the text a screen reader reads once, taken
   out of its clip and put beside the menu with a fixed position, so that the menu's list, which scrolls, cannot cut it off. It
   stands beside the menu and never over the next picture, and a planned area's "(planerad)" is shown with it. */
.ui-sidenav-mini [data-sidenav-tip][data-tip-open] > :is(.ui-sidenav-label, .ui-sidenav-user-text, .ui-sidenav-toggle-unfold),
html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav [data-sidenav-tip][data-tip-open] > :is(.ui-sidenav-label, .ui-sidenav-user-text, .ui-sidenav-toggle-unfold) {
  position: fixed;
  top: var(--tip-y);
  left: calc(var(--tip-x) + var(--sidenav-tip-gap));
  box-sizing: border-box;
  width: auto;
  max-width: calc(100vw - var(--tip-x) - var(--sidenav-tip-gap));
  height: auto;
  padding: var(--sidenav-tip-pad-y) var(--sidenav-tip-pad-x);
  overflow: visible;
  clip-path: none;
  transform: translateY(-50%);
  border: var(--line-thin) solid var(--sidenav-tip-edge);
  border-radius: var(--sidenav-tip-radius);
  background: var(--sidenav-tip-bg);
  color: var(--sidenav-tip-text);
  box-shadow: var(--shadow-overlay);
  font-size: var(--sidenav-tip-size);
  font-weight: var(--weight-heading);
  line-height: 1.2;
  pointer-events: none;
}
.ui-sidenav-link[data-tip-open] > .ui-sidenav-label > .ui-visually-hidden {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
}
/* The user's label (T2.90.1) is the user and the company on two lines, in the label's size and the strong weight for the name. */
[data-sidenav-tip][data-tip-open] > .ui-sidenav-user-text b {
  font-size: inherit;
  font-weight: var(--weight-heading);
}
/* The page's frame (base.html). From 820 px the menu is open or folded, by html[data-sidenav-state] (the inline script in
   base.html and components.js), and --sidenav-room is the width it takes and the page beside it leaves free. */
.ui-shell > .ui-shell-main {
  min-width: 0;
}
/* The drawer (T2.90.1): under 820 px the menu is behind a button in a bar at the top and opens over the page, with the names, a button that closes it, and the page behind dimmed.
   Its width is the content's own, between --drawer-width-min and --drawer-width-max (tokens.css); a long name wraps between words and never in one. It is the
   phone's menu, with a mouse or with touch. From 820 px touch has the rail below (A, Björn 8/11, T2.90.2); the drawer is not a choice there. */
@media (max-width: 819px) {
  .ui-shell > .ui-sidenav-bar {
    display: flex;
  }
  .ui-shell > .ui-sidenav {
    position: fixed;
    z-index: 30;
    top: 0;
    bottom: 0;
    left: 0;
    width: fit-content;
    min-width: var(--drawer-width-min);
    max-width: var(--drawer-width-max);
    transform: translateX(-100%);
    visibility: hidden;
  }
  .ui-shell > .ui-sidenav .ui-sidenav-toggle {
    display: none;
  }
  .ui-shell > .ui-sidenav .ui-sidenav-label {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: normal;
  }
  .ui-shell[data-sidenav-open] > .ui-sidenav {
    transform: none;
    visibility: visible;
    box-shadow: var(--shadow-overlay);
  }
  .ui-shell[data-sidenav-open] > .ui-sidenav .ui-sidenav-close {
    display: inline-grid;
  }
  .ui-shell[data-sidenav-open] > .ui-sidenav-scrim {
    position: fixed;
    z-index: 29;
    inset: 0;
    background: var(--color-nav-scrim);
  }
}
@media (min-width: 820px) {
  .ui-shell {
    --sidenav-room: var(--sidenav-width);
  }
  html[data-sidenav-state="folded"] .ui-shell {
    --sidenav-room: var(--sidenav-mini-width);
  }
  .ui-shell > .ui-sidenav {
    position: fixed;
    z-index: 30;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidenav-room);
  }
  .ui-shell-main {
    margin-left: var(--sidenav-room);
  }
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav {
    padding-right: var(--space-5);
    padding-left: var(--space-5);
    align-items: center;
  }
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-head {
    justify-content: center;
  }
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-menu,
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-foot {
    align-items: center;
  }
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-logo {
    padding: 0;
    justify-content: center;
  }
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-company-logo {
    width: var(--target-min);
    height: var(--target-min);
    background-position: center;
  }
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-company-logo-tall {
    height: var(--sidenav-logo-tall-height);
  }
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-attribution,
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-logo .ui-brand-word,
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-group-chevron,
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-chevron {
    display: none;
  }
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-link,
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-user > summary,
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-foot > .ui-sidenav-theme {
    width: var(--target-min);
    padding: 0;
    justify-content: center;
  }
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-label,
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-user-text,
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-toggle-unfold {
    position: absolute;
    width: var(--line-thin);
    height: var(--line-thin);
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-count {
    position: absolute;
    top: 0;
    right: 0;
    min-width: var(--space-7);
    height: var(--space-7);
    padding: 0 var(--space-2);
  }
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-planned::after {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
  }
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-usermenu {
    left: calc(100% + var(--space-4));
    right: auto;
    bottom: 0;
    width: var(--picker-min);
  }
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-toggle {
    width: var(--target-min);
    padding: 0;
  }
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-toggle-icon {
    transform: rotate(180deg);
  }
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-toggle-fold {
    display: none;
  }
  html[data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-toggle-unfold {
    display: inline;
  }
}
/* The side menu on touch from 820 px (A, Björn 8/11, T2.90.2; the trial of T2.90.1 is over): the folded menu is a rail where the name always stands under the picture, so
   nothing is seen only on hover or a long press. html[data-touch-menu="a"] is set on touch by the script (base.html, components.js) and is not a choice; the catalog's sample
   is ui-sidenav-rail. The rail's width is the longest word among the names (width: min-content, so no number): a name wraps between words and a word
   is never broken, and the user's name in the foot never widens it. A width that is the content's own cannot be a fixed menu with a margin beside it,
   so in the rail the page's frame is a row, and the menu stands still with the page (sticky) and the page takes what is left. */
@media screen and (min-width: 820px) {
  html[data-touch-menu="a"][data-sidenav-state="folded"] .ui-shell {
    display: flex;
    align-items: flex-start;
  }
  html[data-touch-menu="a"][data-sidenav-state="folded"] .ui-shell > .ui-shell-main {
    flex: 1 1 0;
    margin-left: 0;
  }
}
@media (min-width: 820px) {
  .ui-sidenav-mini.ui-sidenav-rail,
  html[data-touch-menu="a"][data-sidenav-state="folded"] .ui-shell > .ui-sidenav {
    width: min-content;
    min-width: calc(var(--target-min) + var(--space-2) * 2);
    padding-right: var(--space-2);
    padding-left: var(--space-2);
  }
  /* The longest word has a width with fractions, and the page beside the rail would stand on them: where the browser can, the width is rounded up to
     a whole pixel (calc-size, Chromium), so that the page and the logos in it keep their whole pixels (T2.79). Elsewhere it is the word's own width;
     the symbol at the top stands on whole pixels in every browser (below). */
  @supports (width: calc-size(min-content, size)) {
    .ui-sidenav-mini.ui-sidenav-rail,
    html[data-touch-menu="a"][data-sidenav-state="folded"] .ui-shell > .ui-sidenav {
      width: calc-size(min-content, round(up, size, var(--sidenav-rail-step)));
    }
  }
  html[data-touch-menu="a"][data-sidenav-state="folded"] .ui-shell > .ui-sidenav {
    position: sticky;
    top: 0;
    right: auto;
    bottom: auto;
    left: auto;
    flex: none;
    height: 100vh;
    height: 100dvh;
  }
  /* The logo's hand-drawn symbol stands on whole pixels (T2.79), but a rail as wide as its longest word has a width with fractions, so the symbol is not
     centred by the layout: the head is a container, and the symbol's left edge is the half of what is left beside it, rounded down to a whole pixel
     from the head's own whole left edge (at most half a pixel from the centre). */
  .ui-sidenav-mini.ui-sidenav-rail .ui-sidenav-head,
  html[data-touch-menu="a"][data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-head {
    container-type: inline-size;
    justify-content: flex-start;
  }
  .ui-sidenav-mini.ui-sidenav-rail .ui-sidenav-logo:has(.ui-brand),
  html[data-touch-menu="a"][data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-logo:has(.ui-brand) {
    box-sizing: border-box;
    width: 100%;
    justify-content: flex-start;
    padding-left: calc((100cqi - var(--brand-hand-size-22)) / 2);
    padding-left: round(down, (100cqi - var(--brand-hand-size-22)) / 2, var(--brand-hand-step));
  }
  .ui-sidenav-mini.ui-sidenav-rail .ui-sidenav-link,
  .ui-sidenav-mini.ui-sidenav-rail .ui-sidenav-user > summary,
  .ui-sidenav-mini.ui-sidenav-rail .ui-sidenav-foot > .ui-sidenav-theme,
  .ui-sidenav-mini.ui-sidenav-rail .ui-sidenav-toggle,
  html[data-touch-menu="a"][data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-link,
  html[data-touch-menu="a"][data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-user > summary,
  html[data-touch-menu="a"][data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-foot > .ui-sidenav-theme,
  html[data-touch-menu="a"][data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-toggle {
    box-sizing: border-box;
    width: 100%;
    height: auto;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-1);
    padding: var(--space-3) var(--space-1);
    text-align: center;
  }
  .ui-sidenav-mini.ui-sidenav-rail .ui-sidenav-user,
  html[data-touch-menu="a"][data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-user {
    width: 100%;
  }
  .ui-sidenav-mini.ui-sidenav-rail .ui-sidenav-label,
  .ui-sidenav-mini.ui-sidenav-rail .ui-sidenav-toggle-unfold,
  html[data-touch-menu="a"][data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-label,
  html[data-touch-menu="a"][data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-toggle-unfold {
    position: static;
    width: 100%;
    height: auto;
    flex: none;
    overflow: hidden;
    clip-path: none;
    text-align: center;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: normal;
    font-size: var(--sidenav-rail-label-size);
    font-weight: var(--weight-heading);
    line-height: 1.15;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--sidenav-rail-label-lines);
  }
  /* The user's whole name stays the summary's name for a screen reader, hidden to the eye as in the folded menu (out of the flow, so it never widens the
     rail); the first name under the picture is only what is seen (aria-hidden). */
  .ui-sidenav-mini.ui-sidenav-rail .ui-sidenav-user-first,
  html[data-touch-menu="a"][data-sidenav-state="folded"] .ui-shell > .ui-sidenav .ui-sidenav-user-first {
    display: block;
    align-self: stretch;
    contain: inline-size;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--sidenav-rail-label-size);
    font-weight: var(--weight-heading);
    line-height: 1.15;
  }
}
/* The foot of the drawer (T2.90.1, G1 round 4): the user's name and the company never widen the drawer, which the menu's own names decide (contain: inline-size gives
   them no width of their own to count); they break between words, never in one, and are cut with ... after --drawer-user-lines lines. */
@media (max-width: 819px) {
  .ui-shell > .ui-sidenav .ui-sidenav-user-text {
    contain: inline-size;
  }
  .ui-shell > .ui-sidenav .ui-sidenav-user-text > :is(b, span) {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--drawer-user-lines);
    white-space: normal;
    overflow-wrap: normal;
  }
}
@media (hover: hover) {
  .ui-sidenav-link:hover,
  .ui-sidenav-user > summary:hover {
    background: var(--color-nav-active);
    color: var(--color-nav-text);
  }
  .ui-sidenav-link[aria-current="page"]:hover {
    color: var(--color-nav-current);
  }
  .ui-sidenav-item:hover {
    background: var(--color-surface-2);
  }
  .ui-sidenav-close:hover {
    color: var(--color-nav-text);
  }
  .ui-sidenav-toggle:hover {
    background: var(--color-nav-active);
    color: var(--color-nav-text);
  }
}

/* The project bar over the tabs of Produktion (T2.13): the project picker, as in the prototype's top row, and the
   company's own views next to it as buttons in a group of their own (T2.40, ui-actions-split and ui-actions-group, the
   pattern of T2.38: the group stands at the right when there is room, and under the picker, at the left, when the row
   wraps). The bar stands inside the page's own padding, so its picker has the left edge of the tabs, the heading and the
   cards (T2.40: it had a padding of its own and stood a step to the right). */
.ui-projectbar {
  box-sizing: border-box;
  width: 100%;
  padding: var(--space-6) 0;
}
.ui-projectbar form {
  flex: 1 1 var(--picker-min);
  max-width: calc(var(--picker-min) * 2);
  margin: 0;
}
/* The compact project row (Björn 1/11 on an iPad, via the pilot session): the label beside the picker on the same row
   (ui-field-beside), --projectbar-air over and under the row instead of the page's air and gap, and the picker as high
   as a compact row of actions (ui-actions-compact: --control-min, about 36 px with a mouse and the tap target with touch)
   and at most --projectbar-picker-max wide. It is the row of every view with the project picker, through
   projects/base.html: Produktion's tabs, Levande budget, Prognos, ÄTA and Rapporter. */
.ui-projectbar-compact {
  padding: 0;
}
/* In the page (and not in the catalogue's frame): the air under the row instead of the page's gap, and over it, when it
   is the page's first part, instead of the page's air. */
.ui-page > .ui-projectbar-compact {
  margin-bottom: calc(var(--projectbar-air) - var(--page-gap));
}
.ui-page > .ui-projectbar-compact:first-child {
  margin-top: calc(var(--projectbar-air) - var(--page-pad-top));
}
.ui-projectbar-compact form {
  flex: 0 1 auto;
  max-width: 100%;
}
.ui-projectbar-compact .ui-picker-box {
  width: var(--projectbar-picker-max);
  max-width: 100%;
}

/* ---- Buttons ---- */
.ui-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: var(--target-min);
  min-width: var(--target-min); /* also a button with only an icon or a sign is a tap target of 44x44 px */
  padding: var(--space-3) var(--space-7);
  /* An edge in a darker salvia, so that the button stands out on white (3:1, T2.27), and the accent as its surface */
  border: var(--line-thin) solid var(--color-accent-border);
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: var(--color-accent-text);
  font-family: var(--font-display);
  font-weight: var(--weight-heading);
  font-size: var(--text-lg);
  letter-spacing: normal;
  line-height: var(--leading-tight);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
/* The symbol before a button's label (button.html icon, K55, 1g.11g.1): the size is a token, the colour the text's. A
   symbol drawn with no attributes of its own, as the diary's camera and image (1g.12b), takes its line from here. */
.ui-button-icon {
  flex: none;
  width: var(--button-icon-size);
  height: var(--button-icon-size);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--button-icon-line);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ui-button-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
/* The variant create (T2.47): the buttons that make something new, with a set of tokens of its own (tokens.css), so that a change
   of them changes every such button. The plus is part of the variant, in the component (button.html). */
.ui-button-create {
  background: var(--button-create-bg);
  color: var(--button-create-text);
  border-color: var(--button-create-border);
}
/* Since T2.76 (K9 B) the variant is text with no box: the soft surface shows at hover, with the keyboard's focus and
   while its menu is open, as the value picker's button does (--valuepicker-open-bg), not only with a mouse. */
.ui-button-create:focus-visible,
.ui-menu[open] > .ui-button-create {
  background: var(--button-create-hover-bg);
}
.ui-button-ghost {
  background: transparent;
  color: var(--color-action);
  border-color: transparent;
}
/* A link to another page in a row of actions (the variant link, P.0.14): the link's colour and an underline, no fill and
   no edge, at the height of the row's buttons and with their font, so that it is read as a way to another page and never
   as an action. The underline is thicker under the mouse and on focus. */
.ui-button-link {
  background: transparent;
  color: var(--button-link-text);
  border-color: transparent;
  padding-right: var(--space-3);
  padding-left: var(--space-3);
  text-decoration: underline;
  text-underline-offset: var(--button-link-underline-offset);
}
.ui-button-link:hover,
.ui-button-link:focus-visible {
  text-decoration-thickness: var(--line-tab-active);
}
/* A discreet button for what removes or ends something, set apart at the end of its row (quiet, 1c.P round 3: an ÄTA's
   Makulera and Ta bort): grey text, no fill and no edge, red under the mouse. */
.ui-button-quiet {
  background: transparent;
  color: var(--color-text-3);
  border-color: transparent;
}
.ui-button-danger {
  background: var(--color-error);
  color: var(--color-text-on-strong);
  border-color: transparent;
}
/* The variant back (T2.58, Björn 1/11): the button Tillbaka, with a weak surface, an edge and rounded corners that the
   tokens --button-back-* set (bg, text, border, radius, size, gap), so that it is not taken for a tab or a choice in a
   menu. It is --button-back-size high, and its tap target is 44 x 44 px (--target-min) all the same: the ::before
   reaches over its edge, which is also why a tap beside it is a tap on it. It is the arrow and the name, in an action row
   (Tillbaka till projektet), and the arrow alone in the tabs' row (.ui-button-back-nav). */
.ui-button-back {
  position: relative;
  gap: var(--space-3);
  min-width: var(--button-back-size);
  min-height: 0;
  height: var(--button-back-size);
  padding: 0 var(--space-6);
  background: var(--button-back-bg);
  color: var(--button-back-text);
  border: var(--line-thin) solid var(--button-back-border);
  border-radius: var(--button-back-radius);
  font-size: var(--text-md);
}
.ui-button-back::before {
  content: "";
  position: absolute;
  /* from the padding box, inside the edge, so the edge is taken off: the target is 44 x 44 px round the drawn button */
  inset: calc((var(--button-back-size) - var(--target-min)) / 2 - var(--line-thin));
}
.ui-button-back svg {
  flex: none;
}
/* In the tabs' row: out of the row's flow, in the margin beside the band, level with the text of the tabs (the tab is
   --target-min high, and the text in its middle), and the width --button-back-width. Shown by the rules above. */
.ui-button-back-nav {
  display: none;
  position: absolute;
  top: calc((var(--target-min) - var(--button-back-size)) / 2);
  left: calc(-1 * var(--back-room));
  box-sizing: border-box;
  width: var(--button-back-width);
  padding: 0;
  margin: 0;
}
.ui-button-back-nav .ui-button-back-label {
  display: var(--button-back-label);
}
/* The page a secondary button links to, when it is the one shown (the company's own views in the project bar): the line
   of the current tab under it, and aria-current for a screen reader. Only the secondary button: a primary one is
   marked as it is. */
.ui-button-secondary[aria-current="page"] {
  border-color: var(--color-action);
  box-shadow: inset 0 calc(-1 * var(--line-tab-active)) 0 var(--color-action);
}
/* A secondary button that is on or off (aria-pressed, P.0, the summary's Visa): on, it has the fill, the edge and the bold text
   of --toggle-on-*, set per theme in tokens.css and shared by no other button (in light a dark fill and white text, in dark a
   light fill and dark text, K36, Björn 7/11), so that the state is told by
   more than colour: the fill, the weight, and a mark if a variant sets one. No mark is the default (T2.93, Björn 7/11: a
   check means done, not chosen). A screen reader says the state from aria-pressed. */
.ui-button-secondary[aria-pressed="true"] {
  background: var(--toggle-on-surface);
  border-color: var(--toggle-on-border);
  color: var(--toggle-on-text);
  font-weight: var(--toggle-on-weight);
  box-shadow: inset 0 calc(-1 * var(--toggle-on-underline)) 0 var(--toggle-on-text);
}
/* The mark of the chosen one is set once: the default is none, and a variant sets the mark, a check or a line, for every toggle
   at once. The check is for the eye only: the alternative text "" after the slash hides it from a screen reader (aria-pressed
   says the state); a browser that does not know the slash (Safari before 17.4) drops the declaration, and the check is not
   drawn there, which the fill and the bold text make up for. */
.ui-toggle-mark-check {
  --toggle-on-mark: "\2713" / "";
}
.ui-toggle-mark-underline {
  --toggle-on-underline: var(--line-tab-active);
}
/* The mark is drawn off as well, but not seen, so that the button has the same width on and off and its neighbours do not move
   (the pilot session after G1 of #799). */
.ui-button-secondary[aria-pressed]::before {
  content: var(--toggle-on-mark);
}
.ui-button-secondary[aria-pressed="false"]::before {
  visibility: hidden;
}
/* The bold text of the chosen one is wider than the plain: the label's bold twin is laid under it, unseen and without height,
   so that the label is as wide as the bold text on and off (templates/components/button.html wraps the label of a toggle in
   this span with data-label). */
.ui-button-label {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}
.ui-button-label::after {
  content: attr(data-label);
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-weight: var(--toggle-on-weight);
  pointer-events: none;
}
.ui-button-small {
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-md);
}
/* A button that chooses a file (1g.6, back in 1g.5a): its input is hidden, and its focus shows on the button. */
.ui-button-file {
  cursor: pointer;
}

/* A button with a sign and no label (button.html icon, 1g.12b) is square. */
.ui-button-icon-only {
  padding: var(--space-3);
}
.ui-button-file:has(input:focus-visible) {
  outline: var(--line-medium) solid var(--color-focus);
  outline-offset: var(--line-medium);
}
/* A button that waits for its form to be saved (button.html, unsaved_form, 1g.5a): the button, and under it its line
   while the form has a change not saved; the row grows downward and the button stays where it is (T2.97). */
.ui-button-unsaved {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: flex-start;
  gap: var(--space-1);
}
.ui-button:disabled {
  opacity: 0.45;
  filter: none;
  cursor: default;
}
/* A button that waits (aria-disabled, T2.143): it dims its fill, its edge and its text, never its focus ring. It can still
   take the keyboard's focus, and opacity would dim the ring along with the button (2.1:1 on white in the pilot's side by
   side of #1992, under the 3:1 of 1.4.11), so the three colours are mixed with transparent, by --button-wait-share, one
   rule for each variant, and the ring stays --color-focus in full, as on the active button. */
.ui-button[aria-disabled="true"] {
  background: color-mix(in srgb, var(--color-accent) var(--button-wait-share), transparent);
  color: color-mix(in srgb, var(--color-accent-text) var(--button-wait-share), transparent);
  border-color: color-mix(in srgb, var(--color-accent-border) var(--button-wait-share), transparent);
  filter: none;
  cursor: default;
}
.ui-button-secondary[aria-disabled="true"] {
  background: color-mix(in srgb, var(--color-surface) var(--button-wait-share), transparent);
  color: color-mix(in srgb, var(--color-text) var(--button-wait-share), transparent);
  border-color: color-mix(in srgb, var(--color-border) var(--button-wait-share), transparent);
}
.ui-button-secondary[aria-pressed="true"][aria-disabled="true"] {
  background: color-mix(in srgb, var(--toggle-on-surface) var(--button-wait-share), transparent);
  color: color-mix(in srgb, var(--toggle-on-text) var(--button-wait-share), transparent);
  border-color: color-mix(in srgb, var(--toggle-on-border) var(--button-wait-share), transparent);
  box-shadow: inset 0 calc(-1 * var(--toggle-on-underline)) 0
    color-mix(in srgb, var(--toggle-on-text) var(--button-wait-share), transparent);
}
.ui-button-create[aria-disabled="true"] {
  background: color-mix(in srgb, var(--button-create-bg) var(--button-wait-share), transparent);
  color: color-mix(in srgb, var(--button-create-text) var(--button-wait-share), transparent);
  border-color: color-mix(in srgb, var(--button-create-border) var(--button-wait-share), transparent);
}
.ui-button-create[aria-disabled="true"]:focus-visible {
  background: color-mix(in srgb, var(--button-create-hover-bg) var(--button-wait-share), transparent);
}
.ui-button-ghost[aria-disabled="true"] {
  background: transparent;
  color: color-mix(in srgb, var(--color-action) var(--button-wait-share), transparent);
  border-color: transparent;
}
.ui-button-link[aria-disabled="true"] {
  background: transparent;
  color: color-mix(in srgb, var(--button-link-text) var(--button-wait-share), transparent);
  border-color: transparent;
}
.ui-button-quiet[aria-disabled="true"] {
  background: transparent;
  color: color-mix(in srgb, var(--color-text-3) var(--button-wait-share), transparent);
  border-color: transparent;
}
.ui-button-danger[aria-disabled="true"] {
  background: color-mix(in srgb, var(--color-error) var(--button-wait-share), transparent);
  color: color-mix(in srgb, var(--color-text-on-strong) var(--button-wait-share), transparent);
  border-color: transparent;
}
.ui-button-back[aria-disabled="true"] {
  background: color-mix(in srgb, var(--button-back-bg) var(--button-wait-share), transparent);
  color: color-mix(in srgb, var(--button-back-text) var(--button-wait-share), transparent);
  border-color: color-mix(in srgb, var(--button-back-border) var(--button-wait-share), transparent);
}
.ui-button[aria-busy="true"]::before {
  content: "";
  width: var(--icon);
  height: var(--icon);
  border-radius: var(--radius-round);
  border: var(--line-medium) solid currentColor;
  border-right-color: transparent;
  animation: ui-spin calc(var(--motion-normal) * 4) linear infinite;
}
@keyframes ui-spin {
  to {
    transform: rotate(1turn);
  }
}
/* ---- Menu (P.0): a small secondary button with a down arrow that opens a short list of actions under it ---- */
.ui-menu {
  position: relative;
  display: inline-flex;
}
.ui-menu-button {
  list-style: none;
}
.ui-menu-button::-webkit-details-marker {
  display: none;
}
.ui-menu-caret {
  border: var(--space-2) solid transparent;
  border-top-color: currentColor;
  border-bottom-width: 0;
}
.ui-menu[open] .ui-menu-caret {
  transform: rotate(180deg);
}
.ui-menu-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + var(--space-1));
  right: 0;
  width: max-content;
  min-width: 100%;
  max-width: calc(100vw - var(--space-10));
  margin: 0;
  padding: var(--space-3);
  list-style: none;
  background: var(--color-surface);
  border: var(--line-thin) solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-overlay);
}
.ui-menu-list li {
  margin: 0;
}
/* A line between two groups of items (a divider, role separator): the border's colour, with air over and under it. */
.ui-menu-list .ui-menu-divider {
  height: 0;
  margin: var(--space-3) var(--space-3);
  border-top: var(--line-thin) solid var(--color-border);
}
.ui-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--target-min);
  padding: 0 var(--space-6);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-family: var(--font-display);
  font-weight: var(--weight-heading);
  font-size: var(--text-md);
  color: var(--color-text);
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.ui-menu-item:hover,
.ui-menu-item:focus-visible {
  background: var(--color-action-soft);
}
.ui-menu-item:disabled,
.ui-menu-item[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
}
/* A menu that stands first or in the middle of its row, as the report's Skriv ut after the period (T2.45), hangs from the
   button's left edge, so that its list never passes the left edge of the screen when the row wraps on a phone. */
.ui-menu-from-start .ui-menu-list {
  right: auto;
  left: 0;
}
/* The status row of a printout being made (the report's Alla projekt, T2.45) is for the screen, not the paper, and so is
   the arrow before a linked amount in a table. */
@media print {
  .ui-print-status,
  .ui-table td > a.ui-amount-link::before {
    display: none;
  }
}
.ui-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
}
/* A filter form: fields (with labels above them) and the button that shows, aligned at the bottom, so that the upper and
   lower edge of the button are those of the fields; a centred button stood half a label too high (T2.30). Only for a form
   whose fields have no hint: a hint under a field makes it taller, so a row with hints is aligned as before, or has its
   hint outside the row (the living budget's new row). */
.ui-actions-filter {
  align-items: flex-end;
}
/* A filter beside actions (T2.38): the filter form (ui-actions-filter) and a group of the actions that belong to the page
   (ui-actions-group: PDF, Timpriser, a link as a ghost button) in one row. The row is aligned at the bottom, so the
   buttons of the group have the bottom edge of the fields, and the actions stand as a group at the right when there is
   room (space-between). A row that wraps puts the group under the filter, at the left, since a lone item in a wrapped
   line starts at the left. The group itself is centred, so a link stands on the middle line of the buttons. */
.ui-actions-split {
  justify-content: space-between;
  align-items: flex-end;
}
.ui-actions-group {
  align-items: center;
}
/* The buttons of a group that is no flex row stand on one middle line (1g.11f.1): a button with only a sign, as minus
   and plus, has no text to stand on, so on the baseline it stood about 4 px higher than Ändra beside it. */
.ui-actions-group > .ui-button {
  vertical-align: middle;
}
/* The focused button over its neighbours, so that its ring shows whole where the buttons of the group lie close (G1 of
   1g.4c: the next button's edge covered a pixel of the ring of Urval) */
.ui-actions-group > :focus-visible {
  position: relative;
  z-index: 1;
}
/* A group with a text beside its button (1g.4, the schedule's status and Visa veckodagar): the air between them is the
   token, whether the text is long or short, and a group that does not fit breaks between them. */
.ui-actions-group-spaced {
  display: flex;
  flex-wrap: wrap;
  gap: var(--actions-group-gap);
}
/* A row of choices (G1 of #1173, Bör 4, pilotsessionen 12/11): a text first in the row (strong or span) is the label of
   the group of buttons after it, as a week of Projektets kalender and Papper in Skriv ut tidplanen. With room the label
   stands beside its buttons, as before. A label over its buttons is close to them (--space-2), also one that does not
   fit beside them on a wider surface. Under --bp-mobile (600 px, which a media query cannot read) the label always has
   a line of its own over its buttons, and a row after another row of choices has the air between a panel's parts
   (--stack-gap) over it, so that a label is nearer its own buttons than the row's before it: the label stood 8 px over
   its own buttons and touched those above. By the surface's width, never by the kind of device. The rule is the
   pattern's, so a view has no rule of its own for it. */
.ui-actions-split:has(> :is(strong, span):first-child) {
  row-gap: var(--space-2);
}
/* The air of a row of choices (a bug of #1181, Björn 14/11: Ledig and Arbetar lay against the rows over and under them
   and looked as if they overlapped): the buttons of its group stand --actions-group-gap apart, where they stood as far
   apart as a space between two words (about 3 px), and a row after another row of choices has the air between a panel's
   parts (--stack-gap) over it in every width, where it had none with the label beside its buttons. Only the group of a
   row of choices: the groups that sit close, as the choice of columns, are as before. */
.ui-actions-split:has(> :is(strong, span):first-child) > .ui-actions-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--actions-group-gap);
}
.ui-actions-split:has(> :is(strong, span):first-child) ~ .ui-actions-split:has(> :is(strong, span):first-child) {
  margin-top: var(--stack-gap);
}
@media (max-width: 599px) {
  .ui-actions-split > :is(strong, span):first-child {
    flex: 1 1 100%;
  }
}
/* The discreet actions of a row set apart at its right end (1c.P round 3, an ÄTA's Makulera and Ta bort, the button's
   quiet), and at the left of their own line when the row wraps. */
.ui-actions-end {
  margin-left: auto;
}

/* The row of buttons under a field (Avbryt, Spara revision, T2.93, Björn 7/11: the buttons were too tight to the row above): the air
   between the field and the row IS the token --actions-after-field, for every such row, whether it stands straight after a
   field or is marked (G1 of #799: the token was a margin on top of the parent's gap). In a flow of its own the margin is the
   token; in a parent that has a gap between its parts (the panel and the dialog's body, --stack-gap) the margin is the token
   less that gap, as --actions-after-head is less the page's gap, so that the air is the token in all three. */
.ui-field + .ui-actions,
.ui-fields + .ui-actions,
.ui-formgrid + .ui-actions,
.ui-actions-after-field {
  margin-top: var(--actions-after-field);
}
:is(.ui-panel, .ui-dialog-body) > :is(.ui-field, .ui-fields, .ui-formgrid) + .ui-actions,
:is(.ui-panel, .ui-dialog-body) > .ui-actions-after-field {
  margin-top: calc(var(--actions-after-field) - var(--stack-gap));
}

/* The mark of a system before the text of a button or a link (button.html system, T2.117, K109) and the arrow out after it
   (external): a square on the second surface with a thin line and the neutral symbol, the arrow in the text's colour. All
   of it is --system-mark-*; the link has the smaller square, and so has a small button. Dimmed with the button when it
   waits (aria-disabled: the mark's own colours are mixed with transparent as the button's are, never opacity, which would dim a focus ring; the arrow is in the button's text colour and follows it), and with the button as a whole when it is disabled; the name keeps its words. */
.ui-system-mark {
  flex: none;
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  width: var(--system-mark-size);
  height: var(--system-mark-size);
  border: var(--line-thin) solid var(--system-mark-border);
  border-radius: var(--system-mark-radius);
  background: var(--system-mark-bg);
  color: var(--system-mark-color);
}
.ui-system-mark svg {
  width: var(--system-mark-symbol);
  height: var(--system-mark-symbol);
}
.ui-system-arrow {
  flex: none;
  width: var(--system-arrow-size);
  height: var(--system-arrow-size);
}
.ui-button-system {
  gap: var(--system-mark-gap);
  /* a text that does not fit its row breaks between its words (Ord bryts aldrig mitt i, docs/granskningslista.md): the mark
     stays at the left and the arrow at the right, and no word is cut */
  white-space: normal;
  overflow-wrap: normal;
  hyphens: none;
  text-align: start;
}
.ui-button-link .ui-system-mark,
.ui-button-small .ui-system-mark {
  width: var(--system-mark-size-link);
  height: var(--system-mark-size-link);
}
.ui-button-link .ui-system-mark svg,
.ui-button-small .ui-system-mark svg {
  width: var(--system-mark-symbol-link);
  height: var(--system-mark-symbol-link);
}
.ui-button-link .ui-system-arrow,
.ui-button-small .ui-system-arrow {
  width: var(--system-arrow-size-link);
  height: var(--system-arrow-size-link);
}
.ui-button:not(.ui-button-secondary, .ui-button-ghost, .ui-button-link) .ui-system-mark {
  background: var(--system-mark-primary-bg);
  border-color: var(--system-mark-primary-border);
  color: var(--system-mark-primary-color);
}
.ui-button[aria-disabled="true"] .ui-system-mark {
  background: color-mix(in srgb, var(--system-mark-bg) var(--button-wait-share), transparent);
  border-color: color-mix(in srgb, var(--system-mark-border) var(--button-wait-share), transparent);
  color: color-mix(in srgb, var(--system-mark-color) var(--button-wait-share), transparent);
}
.ui-button[aria-disabled="true"]:not(.ui-button-secondary, .ui-button-ghost, .ui-button-link) .ui-system-mark {
  background: color-mix(in srgb, var(--system-mark-primary-bg) var(--button-wait-share), transparent);
  border-color: color-mix(in srgb, var(--system-mark-primary-border) var(--button-wait-share), transparent);
  color: color-mix(in srgb, var(--system-mark-primary-color) var(--button-wait-share), transparent);
}

/* The mark with the name beside it, with no button (the catalogue's example of the system card in a row of states, K101) */
.ui-system-card {
  display: inline-flex;
  align-items: center;
  gap: var(--system-mark-gap);
  color: var(--color-text);
}
/* The plus of the variant create (T2.47): a sign of its own before the label, with the same space and line in every such button. */
.ui-button-plus {
  display: inline-block;
  color: var(--button-create-icon);
  margin-right: var(--space-3);
  line-height: 1;
  font-weight: var(--weight-heading);
}
/* A row of actions as dense as the prototype's (P.0.2, the pilot session 1/11, level 2; the prototype's .head .bar): with
   a mouse its buttons and pickers are --control-min-fine high, about 36 px, and with touch they keep the tap target
   (--control-min, tokens.css). A field's label in it is a plain word in the second text colour beside its field, as
   the prototype's span.period, not a field's heading. */
.ui-actions-compact .ui-button {
  min-height: var(--control-min);
  min-width: var(--control-min);
}
.ui-actions-compact .ui-input {
  min-height: var(--control-min);
}
.ui-actions-compact .ui-picker-box .ui-input {
  padding-right: var(--control-min);
}
.ui-actions-compact .ui-picker-toggle {
  width: var(--control-min);
}
.ui-actions-compact .ui-field-label {
  font-weight: var(--weight-regular);
  color: var(--color-text-2);
}

/* ---- Fields ---- */
.ui-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  position: relative;
}
.ui-field-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}
.ui-field-hint {
  font-size: var(--text-xs);
  color: var(--color-text-3);
  margin: 0;
}
.ui-field-error {
  font-size: var(--text-xs);
  color: var(--color-error);
  font-weight: var(--weight-medium);
  margin: 0;
}
.ui-input {
  width: 100%;
  min-width: var(--field-min);
  min-height: var(--target-min);
  padding: var(--space-3) var(--space-4);
  border: var(--line-thin) solid var(--field-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-field);
}
/* A date field (T2.30). WebKit (Safari, and every browser on an iPad) draws it with a look of its own: the text centred, a
   height of its own and a width of its own that runs into the next field. So it is drawn as the other fields: the same
   appearance and text alignment, the height of a tap target, and never narrower than its content, so that a row of
   fields wraps instead of the fields standing over each other. The format of the date (30 Oct 2026 or 2026-10-30) is the
   device's, not the page's: lang does not change it. */
.ui-field > .ui-input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  height: var(--target-min);
  text-align: left;
}
/* In a compact row of actions (the compact period, P.0) as high as its other controls. */
.ui-actions-compact .ui-field > .ui-input[type="date"] {
  height: var(--control-min);
}
/* The compact date field (compact, 1g.11b, K48): half the width of its box instead of the whole, as the card draws the day
   the client signed beside the name's full width; never narrower than --date-min, so that it stays whole. */
.ui-field-compact {
  width: var(--field-compact-width);
  min-width: var(--date-min);
  max-width: 100%;
}
.ui-input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
}
.ui-field:has(> .ui-input[type="date"]) {
  min-width: var(--date-min);
}
/* The design system's date field and calendar (T2.114, K108, Björns ja 12/11; components/field_date.html with
   calendar, components.js setupDateField). The field is as wide as a date with the calendar's symbol at its left edge,
   a button on the second surface with a line to its right, in the action's colour; in a row of fields it never grows,
   so the rest of the row goes to the fields of free text. Without JavaScript it is the browser's date field. */
.ui-fields > .ui-field-date {
  flex: none;
}
.ui-date-box {
  position: relative;
  display: flex;
  align-items: stretch;
  width: var(--date-field-width);
  max-width: 100%;
  /* the width's 5.6em in the input's own size, 16 px with touch, or the hint is cut at its last letter */
  font-size: var(--text-field);
}
.ui-date-box > .ui-input {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--target-min);
  font-variant-numeric: tabular-nums;
}
.ui-date-box > .ui-input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  min-width: var(--date-min);
  text-align: left;
}
.ui-actions-compact .ui-date-box > .ui-input {
  height: var(--control-min);
}
.ui-date-open {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--date-symbol-width);
  padding: 0;
  border: var(--line-thin) solid var(--field-border);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: var(--date-symbol-surface);
  color: var(--date-symbol-color);
  cursor: pointer;
}
.ui-date-open[hidden] {
  display: none;
}
.ui-date-open + .ui-input {
  border-left: 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.ui-date-open svg,
.ui-date-cal-nav svg {
  width: var(--date-symbol-size);
  height: var(--date-symbol-size);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ui-date-open:disabled {
  color: var(--color-text-3);
  cursor: default;
}
.ui-date-box.is-open > .ui-date-open,
.ui-date-box.is-open > .ui-input {
  border-color: var(--color-action);
}
/* The calendar: under the field, placed by the common placement (placePop, ui-pop); on a phone at the foot of the
   screen as the value picker's sheet, with the field's label and Stäng. Six rows every month, so that its height never
   jumps; ISO weeks, Monday first. */
.ui-date-cal {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  z-index: 40;
  display: grid;
  gap: var(--space-4);
  width: max-content;
  padding: var(--space-4) var(--date-cal-pad) var(--date-cal-pad);
  border: var(--line-thin) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-overlay);
  color: var(--color-text);
  font-family: var(--font-body);
}
.ui-date-cal[hidden] {
  display: none;
}
.ui-date-cal-sheet-head {
  display: none;
}
.ui-date-cal-head {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.ui-date-cal-nav,
.ui-date-cal-close {
  display: grid;
  flex: none;
  place-items: center;
  width: var(--date-cal-nav);
  height: var(--date-cal-nav);
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--color-action);
  cursor: pointer;
}
.ui-date-cal-month {
  flex: 0 1 calc(3.5 * var(--date-cal-day)); /* its room when there is any, less where the calendar is narrow (T2.114.1): the name wraps then */
  min-width: 0;
  text-wrap: balance;
  margin: 0;
  font-size: var(--date-cal-month);
  font-weight: var(--weight-bold);
  text-align: center;
}
.ui-date-cal-today {
  flex: none;
  min-width: var(--date-cal-nav);
  min-height: var(--date-cal-nav);
  margin-left: auto;
  padding: 0 var(--space-2);
  border: 0;
  background: none;
  color: var(--color-action);
  font: inherit;
  font-size: var(--text-md);
  font-weight: var(--weight-strong);
  text-decoration: underline;
  text-underline-offset: var(--date-cal-underline);
  cursor: pointer;
}
.ui-date-cal-grid {
  margin: calc(-1 * var(--date-cal-gap));
  border-collapse: separate;
  border-spacing: var(--date-cal-gap);
}
.ui-date-cal-grid th,
.ui-date-cal-grid td {
  padding: 0;
  text-align: center;
  vertical-align: middle;
}
.ui-date-cal-grid thead th {
  height: var(--date-cal-head-row);
  font-size: var(--date-cal-small);
  font-weight: var(--weight-strong);
  color: var(--color-text-2);
}
.ui-date-cal-grid tbody th {
  width: var(--date-cal-week);
  font-size: var(--date-cal-small);
  font-weight: var(--weight-regular);
  color: var(--color-text-3);
}
.ui-date-cal-day {
  display: grid;
  place-items: center;
  width: var(--date-cal-day);
  height: var(--date-cal-day-height);
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--color-text);
  font: inherit;
  font-size: var(--date-cal-text);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.ui-date-cal-day.is-other {
  color: var(--date-cal-other);
}
.ui-date-cal-day.is-off {
  background: var(--date-cal-off);
}
.ui-date-cal-day.is-free {
  background: repeating-linear-gradient(
    -45deg,
    var(--date-cal-free-line) 0 var(--line-thin),
    transparent var(--line-thin) var(--date-cal-hatch)
  );
  box-shadow: inset 0 0 0 var(--line-thin) var(--date-cal-free-line);
}
.ui-date-cal-day.is-today {
  box-shadow: inset 0 0 0 var(--date-cal-ring) var(--date-cal-today-ring);
  font-weight: var(--weight-bold);
}
.ui-date-cal-day[aria-pressed="true"] {
  background: var(--date-cal-chosen-surface);
  color: var(--date-cal-chosen-text);
  font-weight: var(--weight-bold);
  box-shadow: inset 0 0 0 var(--line-thin) var(--date-cal-chosen-edge);
}
.ui-date-cal-day[aria-disabled="true"],
.ui-date-quick[aria-disabled="true"] {
  color: var(--date-cal-disabled);
  cursor: default;
}
@media (hover: hover) {
  .ui-date-cal-day:hover:not([aria-disabled="true"], [aria-pressed="true"]) {
    outline: var(--line-thin) solid var(--color-action);
  }
}
.ui-date-cal-note {
  max-width: var(--date-cal-names-max);
  margin: 0;
  padding: var(--space-2) var(--space-4);
  border-left: var(--date-cal-note-line) solid var(--date-cal-note-edge);
  background: var(--date-cal-note-surface);
  font-size: var(--date-cal-names);
}
.ui-date-cal-note:empty,
.ui-date-cal-quick:empty {
  display: none;
}
.ui-date-cal-quick {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: var(--line-thin) solid var(--color-border-soft);
}
.ui-date-quick {
  display: inline-flex;
  align-items: center;
  min-height: var(--date-cal-quick-min);
  padding: 0 var(--space-5);
  border: var(--line-thin) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-md);
  font-weight: var(--weight-strong);
  white-space: nowrap;
  cursor: pointer;
}
.ui-date-quick[aria-pressed="true"] {
  border-color: var(--toggle-on-border);
  background: var(--toggle-on-surface);
  color: var(--toggle-on-text);
  font-weight: var(--toggle-on-weight);
}
.ui-date-cal-names {
  display: grid;
  gap: var(--space-2);
  max-width: var(--date-cal-names-max);
  font-size: var(--date-cal-names);
  color: var(--color-text-2);
}
.ui-date-cal-names p {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin: 0;
}
.ui-date-cal-names p::before {
  content: "";
  flex: none;
  width: var(--date-cal-swatch);
  height: var(--date-cal-swatch);
  margin-top: var(--space-1);
  border-radius: var(--radius-sm);
}
.ui-date-cal-names .is-today::before {
  box-shadow: inset 0 0 0 var(--date-cal-ring) var(--date-cal-today-ring);
}
.ui-date-cal-names .is-off::before {
  background: var(--date-cal-off);
}
.ui-date-cal-names .is-free::before {
  background: repeating-linear-gradient(
    -45deg,
    var(--date-cal-free-line) 0 var(--line-thin),
    transparent var(--line-thin) var(--space-2)
  );
  box-shadow: inset 0 0 0 var(--line-thin) var(--date-cal-free-line);
}
/* Where the calendar has a room of its own, the open one in the catalogue and the phone's sheet, the columns of the days
   shrink to what fits (T2.114.1): the table is never wider than the room, and a day is its token's size or the
   column's, whichever is less. Only on a phone: from 600 px the open one scrolls in its box, as before, and its days keep
   44 px. The popup under the field has no room to measure and keeps its tokens' sizes. */
@media (max-width: 599px) {
  .ui-field-date[data-date-inline] .ui-date-cal-grid {
    max-width: calc(100% + 2 * var(--date-cal-gap));
  }
  .ui-field-date[data-date-inline] .ui-date-cal-grid td {
    width: var(--date-cal-day);
  }
  .ui-field-date[data-date-inline] .ui-date-cal-day {
    width: 100%;
    max-width: var(--date-cal-day);
  }
}
/* In the catalogue (open) it stands in the flow under its field, so that every mark is seen without a click; in a
   phone narrower than the calendar with its 44 px days it scrolls in its own box and the page never sideways. */
.ui-field-date[data-date-inline] .ui-date-box {
  display: grid;
  grid-template-columns: var(--date-symbol-width) calc(var(--date-field-width) - var(--date-symbol-width)) minmax(0, 1fr);
  width: auto;
}
.ui-field-date[data-date-inline] .ui-date-cal {
  --pop-place: none;
  position: static;
  grid-column: 1 / -1;
  max-width: 100%;
  margin-top: var(--space-2);
  overflow-x: auto;
  box-shadow: none;
}
@media (max-width: 599px) {
  .ui-field-date:not([data-date-inline]) .ui-date-cal {
    --pop-place: none;
    position: fixed;
    inset: auto 0 0;
    z-index: 60;
    width: auto;
    max-height: var(--sheet-max-height);
    overflow: auto;
    padding: var(--space-3) var(--space-6) var(--space-6);
    border-width: var(--line-thin) 0 0;
    border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
    animation: ui-sheet-in var(--sheet-glide) var(--ease-grow);
  }
  .ui-field-date:not([data-date-inline]) .ui-date-cal::before {
    content: "";
    justify-self: center;
    width: var(--sheet-grip-width);
    height: var(--sheet-grip-height);
    border-radius: var(--sheet-grip-height);
    background: var(--sheet-grip);
  }
  .ui-field-date:not([data-date-inline]) .ui-date-box:has(> .ui-date-cal:not([hidden]))::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 58;
    background: var(--sheet-scrim);
  }
  .ui-field-date:not([data-date-inline]) .ui-date-cal-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
  }
  .ui-date-cal-sheet-head p {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
  }
  .ui-date-cal-close {
    width: auto;
    padding: 0 var(--space-2);
    font: inherit;
    font-size: var(--date-cal-month);
    font-weight: var(--weight-strong);
  }
  .ui-field-date:not([data-date-inline]) .ui-date-cal-grid {
    max-width: calc(100% + 2 * var(--date-cal-gap));
    margin-inline: auto;
  }
  .ui-field-date:not([data-date-inline]) .ui-date-cal-grid td {
    width: var(--date-cal-day);
  }
  .ui-field-date:not([data-date-inline]) .ui-date-cal-day {
    position: relative;
    width: 100%;
    max-width: var(--date-cal-day);
  }
  /* the day's tap target reaches over the gap to its neighbours, so it is 44 px wide where the drawn day is narrower (41 px at 360 px) */
  .ui-field-date:not([data-date-inline]) .ui-date-cal-day::after {
    content: "";
    position: absolute;
    inset: 0 calc(-1 * var(--date-cal-gap));
  }
}
@media (prefers-reduced-motion: reduce) {
  /* as specific as the phone's sheet above, which glides in, so that reduced motion wins there too */
  .ui-date-cal,
  .ui-field-date:not([data-date-inline]) .ui-date-cal {
    animation: none;
  }
}
textarea.ui-input {
  resize: vertical;
  field-sizing: content;
}
.ui-input-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ui-input.ui-neg {
  color: var(--color-negative-amount);
}
.ui-field-editable .ui-input {
  background: var(--color-editable);
  border-color: var(--color-action);
}
.ui-field-invalid .ui-input {
  border-color: var(--color-error);
  background: var(--color-error-soft);
}
.ui-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.ui-input[readonly] {
  background: transparent;
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}
/* A field in its read mode (read, ui-field-read; 1c.P, the pilot session 1/11): the value as text, without a form
   control, a frame or a grip to resize, for a reader who may not change it. It is text and not a control, so it takes
   one line of text with a little air (--field-read-min, --field-read-pad; T2.63) and not the height of a control,
   which has room for a frame, a tick or an arrow that is not there; a form to read is thereby denser than one to
   write. An empty value is "-", as in the tables, a text keeps its line breaks, a date stays on one line and an amount
   is right-aligned in tabular figures, red when negative. */
.ui-field-read .ui-field-value {
  margin: 0;
  min-height: var(--field-read-min);
  padding: var(--field-read-pad) 0;
  color: var(--color-text);
  font-size: var(--text-field);
  line-height: var(--leading-normal);
  white-space: pre-line;
  overflow-wrap: break-word;
}
.ui-field-read .ui-field-value-date {
  white-space: nowrap;
}
.ui-field-read .ui-field-value-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ui-field-read .ui-field-value.ui-neg {
  color: var(--color-negative-amount);
}
/* A grid of fields with at least one control (an input, a select or a text area; T2.63, round 2, the pilot session
   1/11): a field to read there takes the control's height at least, and its value stands on the same line as the
   text of the controls beside it, so that a form to write has its values on one line. The first line of the
   value stands there (its padding above is half of what the control's height has over a line of text) and a value of
   several lines grows downwards, so that a long project name does not stand higher than the controls' text. A control
   here is a field with a box for text that is as high as the others: a hidden field is none, nor is a tick box or a radio
   button, which have a size of their own and no text to stand on a line with, nor is a button of the type submit or
   button. A grid with fields to read only, or with only such things beside them, stays dense. */
:is(.ui-fields, .ui-formgrid):has(
    input:not([type="hidden"], [type="checkbox"], [type="radio"], [type="submit"], [type="button"]),
    select,
    textarea
  )
  .ui-field-read
  .ui-field-value {
  display: grid;
  align-content: start;
  min-height: var(--field-read-control-min);
  padding-top: var(--field-read-control-pad);
  padding-bottom: var(--field-read-pad);
}
/* Unsaved: a discreet corner flag and dot, not coloured rows (granskningslistan). */
.ui-field-unsaved .ui-field-label::after {
  content: "";
  display: inline-block;
  width: var(--dot);
  height: var(--dot);
  margin-left: var(--space-3);
  border-radius: var(--radius-round);
  background: var(--color-unsaved);
}
.ui-field-unsaved .ui-input {
  background-image: linear-gradient(225deg, var(--color-unsaved) var(--corner-flag), transparent var(--corner-flag));
}

/* The value picker in a form with a changed value (T19.2.2, K84): the same corner flag as the other fields. */
.ui-field-unsaved .ui-valuepicker-field {
  background-image: linear-gradient(225deg, var(--color-unsaved) var(--corner-flag), transparent var(--corner-flag));
}
/* A field with a warning (T19.2.2, K84 c): the warning's edge and its line under the field, an account that is missing
   from the chart; the field can still be saved as it is. */
.ui-field-warned .ui-valuepicker-field {
  border-color: var(--field-warn-edge);
}
.ui-field-warn {
  font-size: var(--text-xs);
  color: var(--field-warn-text);
  font-weight: var(--weight-medium);
  margin: 0;
}

/* Checkbox: never field width, the label sits next to the box. */
.ui-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  min-height: var(--target-min);
  width: auto;
  cursor: pointer;
}
.ui-check input {
  width: var(--check);
  height: var(--check);
  margin: 0;
  accent-color: var(--color-action);
  flex: none;
}
/* Fields in a grid (T2.47), as the prototype's form: four on a row from an iPad in landscape, two between a phone and
   that, and one on a phone. A field that is wide (ui-formgrid-wide), such as a note, takes the whole row. The fields are
   aligned at the top, since a hint under one makes it taller. */
.ui-formgrid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6) var(--space-7);
  align-items: start;
}
.ui-formgrid > * {
  min-width: 0;
}
@media (min-width: 600px) {
  .ui-formgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1180px) {
  .ui-formgrid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.ui-formgrid > .ui-formgrid-wide {
  grid-column: 1 / -1;
}
@media (min-width: 1180px) {
  .ui-formgrid > .ui-formgrid-half {
    grid-column: span 2;
  }
}
/* A group of fields in a form, such as one contact person: a line over it and a heading of its own. */
.ui-formgrid > .ui-formgrid-end {
  align-self: end;
}
.ui-formgrid-lines {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--space-9);
  row-gap: var(--space-2);
}
.ui-formgrid-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  border-top: var(--line-thin) solid var(--color-border-soft);
  padding-top: var(--space-5);
}
.ui-formgrid-group > h3 {
  font-size: var(--text-md);
}
/* One field per row (ui-formgrid-stack, T19.2.2, K84 fråga 4): the label in a column at the left and the fields as wide
   as each other under each other, as a default per category. The rows share the columns (subgrid), so that the fields
   line up whatever the labels' lengths; a field's line under it (a warning, a hint) stands under the field and the row
   grows downwards. A cell of the grid is the field itself or a wrapper around it (with its hidden inputs). Under 600 px
   the label stands above its field. */
.ui-formgrid-stack {
  gap: var(--formgrid-stack-gap-y) var(--formgrid-stack-gap-x);
}
.ui-formgrid-stack > .ui-field > .ui-field-label,
.ui-formgrid-stack > * > .ui-field > .ui-field-label {
  font-size: var(--formgrid-stack-label-size);
  font-weight: var(--formgrid-stack-label-weight);
}
.ui-formgrid-stack > .ui-field > :is(.ui-input, .ui-valuepicker-field),
.ui-formgrid-stack > * > .ui-field > :is(.ui-input, .ui-valuepicker-field) {
  width: 100%;
  max-width: var(--formgrid-stack-field);
}
@media (min-width: 600px) {
  .ui-formgrid-stack {
    grid-template-columns: fit-content(var(--formgrid-stack-label-max)) var(--formgrid-stack-field);
  }
  .ui-formgrid-stack > *,
  .ui-formgrid-stack > * > .ui-field {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    align-items: start;
    row-gap: var(--space-2);
  }
  .ui-formgrid-stack > .ui-field > *,
  .ui-formgrid-stack > * > .ui-field > * {
    grid-column: 2;
  }
  .ui-formgrid-stack > .ui-field > .ui-field-label,
  .ui-formgrid-stack > * > .ui-field > .ui-field-label {
    grid-area: 1 / 1;
    align-self: center;
  }
}
/* A field that is only read, as "label: value" (T2.47), with where it is changed beside it, discreet, on the same line. */
.ui-field-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--space-4);
  margin: 0;
  min-width: 0;
  overflow-wrap: break-word;
}
.ui-field-line-label {
  color: var(--color-text-3);
}
.ui-field-line-value {
  font-weight: var(--weight-medium);
  color: var(--color-text);
}
.ui-field-line-source {
  font-size: var(--text-xs);
  color: var(--color-text-3);
}
/* A group of boxes to tick or choose among in a grid (T2.47), six on a row from an iPad in landscape, as the prototype's
   categories. Each box keeps the tap target's height. */
.ui-check-grid {
  min-width: 0;
}
.ui-check-grid-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  margin: 0;
}
.ui-check-grid-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--space-7);
}
@media (min-width: 600px) {
  .ui-check-grid-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 820px) {
  .ui-check-grid-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 1180px) {
  .ui-check-grid-list {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
.ui-check-grid-list .ui-check {
  min-width: 0;
}
/* The header of a form's panel: the name at the left and where the record comes from, discreet, at the right. */
.ui-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-7);
}
.ui-panel-head > h2 {
  font-size: var(--text-xl);
}
.ui-panel-status {
  font-size: var(--text-sm);
  color: var(--color-text-3);
}

/* The text of an empty field is grey (T2.47): the accounting system's value under a field that the customer's own replaces. A
   value that is the customer's own has a small grey "eget" at its label, with a dot, so that it is seen without colour alone. */
.ui-field .ui-input::placeholder {
  color: var(--color-text-3);
  opacity: 1;
}
.ui-field-own {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  color: var(--color-text-3);
}
.ui-field-own::before {
  content: "";
  width: var(--dot);
  height: var(--dot);
  border-radius: var(--radius-round);
  background: currentcolor;
}

/* ---- Picker ---- */
.ui-picker {
  position: relative;
}
/* A field with its label beside it on the same row (beside, P.0: the compact project row), from 600 px, in two columns;
   on a phone the label stays above, as the living budget's Version (a rule further down); after .ui-field, which it changes. */
@media (min-width: 600px) {
  .ui-field-beside {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: var(--space-2) var(--space-4);
  }
  .ui-field-beside > .ui-field-label {
    white-space: nowrap;
  }
  /* The field, its list and a hint stand in the second column, so that the list opens under the field and not under the
     label: an absolutely placed child of a grid has its column as its frame. */
  .ui-field-beside > :not(.ui-field-label) {
    grid-column: 2;
  }
}
/* The field and the arrow (T2.30): a down arrow at the right shows that it is a list, and a click on it opens and closes
   the list. The arrow is a tap target (the height of the field, --target-min wide) and is shown when the script is there. */
.ui-picker-box {
  position: relative;
  display: flex;
}
.ui-picker-box .ui-input {
  padding-right: var(--target-min);
  text-overflow: ellipsis;
}
/* A picker whose width follows its options (fit, P.0.2): as many characters as the longest (--picker-chars, which the
   component sets), the field's padding and the arrow, and at most --picker-fit-max, as the prototype's select. */
.ui-picker-fit .ui-input {
  width: calc(var(--picker-chars) * 1ch + var(--space-4) + var(--target-min));
  min-width: 0;
  max-width: var(--picker-fit-max);
}
.ui-actions-compact .ui-picker-fit .ui-input {
  width: calc(var(--picker-chars) * 1ch + var(--space-4) + var(--control-min));
}
.ui-picker-toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--target-min);
  color: var(--color-text-2);
  cursor: pointer;
}
.ui-picker[data-live] .ui-picker-toggle {
  display: flex;
}
.ui-picker-toggle svg {
  width: var(--icon);
  height: var(--icon);
  transition: transform var(--motion-fast);
}
.ui-picker-box .ui-input[aria-expanded="true"] ~ .ui-picker-toggle svg {
  transform: rotate(180deg);
}
.ui-picker-box .ui-input:disabled ~ .ui-picker-toggle {
  opacity: 0.55;
}
.ui-picker-list {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 60;
  min-width: max(100%, var(--picker-min));
  max-width: min(90vw, calc(var(--picker-min) * 2));
  overflow: auto;
  margin: var(--space-1) 0 0;
  padding: var(--space-2) 0;
  list-style: none;
  background: var(--color-surface);
  border: var(--line-thin) solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-overlay);
}
.ui-picker-option {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  min-height: var(--target-min);
  padding: var(--space-2) var(--space-6);
  font-size: var(--text-sm);
  cursor: pointer;
}
.ui-picker-option b {
  font-variant-numeric: tabular-nums;
}
.ui-picker-option[aria-selected="true"] {
  font-weight: var(--weight-medium);
}
.ui-picker-option.is-active {
  background: var(--color-action-soft);
}
.ui-picker-none {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-3);
}
/* A picker in a table's cell (1c.11), as an ÄTA line's account: as wide as the other fields of the row, with the
   number first and the name cut short, while its list opens as wide as a picker's; as wide as the card's value where
   the table is cards. */
.ui-picker-cell {
  min-width: calc(var(--field-min) * 1.25);
  flex: 1 1 auto;
}
.ui-table .ui-cell-editable .ui-picker-cell .ui-input {
  padding-right: var(--target-min); /* the text ends before the arrow, as in a picker outside a table */
}
/* The name of the code chosen, under the field, smaller and grey (1c.11), as the prototype's account name. */
.ui-picker-name {
  display: block;
  max-width: calc(var(--field-min) * 1.5);
  font-size: var(--text-2xs);
  line-height: var(--leading-tight);
  color: var(--color-text-3);
  white-space: normal;
}
.ui-picker-name:empty {
  display: none;
}

/* ---- Cards ---- */
.ui-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(var(--picker-min) / 2)), 1fr));
  gap: var(--space-6);
}
/* A card has the thin frame all round and no top edge of its own (T2.70, Björn 1/11): the top edge says only a state,
   below. */
.ui-card {
  container: ui-card / inline-size;
  --card-figure: var(--text-figure);
  background: var(--color-surface);
  border: var(--line-thin) solid var(--card-edge);
  padding: var(--card-pad-top) var(--card-pad-side) var(--card-pad-bottom);
  min-width: 0;
}
.ui-card-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--color-text);
  margin: 0 0 var(--card-label-gap);
}
.ui-card-value {
  font-family: var(--font-display);
  font-weight: var(--weight-heading);
  font-size: var(--card-figure);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
/* The value fits the card (T2.132): the card is a container, and the value's size is counted from the card's width,
   never above the size of the card's kind (--card-figure) and never below the floor. The figure and its unit are two
   words that never break; where they do not fit at the floor the unit goes to a line of its own. */
.ui-card-number,
.ui-card-unit {
  white-space: nowrap;
}
@container ui-card (width > 0) {
  .ui-card-value {
    font-size: clamp(var(--text-figure-floor), calc(100cqw / var(--figure-fit)), var(--card-figure));
  }
}
.ui-card-detail {
  font-size: var(--text-xs);
  color: var(--color-text-2);
  margin: var(--card-detail-gap) 0 0;
}
/* Aligned cards (Björn 31/10 kväll, P.0): in a row of cards the big figures stand at exactly the same height. The heading
   area holds two lines in every card, so a heading that wraps never moves its figure, and the text under the figure
   follows it. Short headings first; this is the guard. */
.ui-card-aligned .ui-card-label {
  min-height: var(--card-label-min);
}
/* The compact card (compact, Björn 1/11 via the pilot session): about half the height of the standard one, with the label,
   the figure and a short line under it and less air, as the project overview's key figures and the ÄTA's cards. Aligned,
   its heading area is one line, since the labels of a compact row are short; the figures still stand at one height. */
.ui-card-compact {
  --card-pad-top: var(--card-compact-pad-top);
  --card-pad-side: var(--card-compact-pad-side);
  --card-pad-bottom: var(--card-compact-pad-bottom);
  --card-label-gap: var(--card-compact-gap);
  --card-detail-gap: var(--card-compact-gap);
  --card-label-min: var(--card-compact-label-min);
}
.ui-card-compact .ui-card-label {
  line-height: var(--leading-tight);
}
.ui-card-compact .ui-card-detail {
  line-height: var(--card-compact-leading);
}
.ui-card-compact,
.ui-cards-compact .ui-card-compact {
  --card-figure: var(--text-figure-compact);
}
.ui-card-compact.ui-card-hero {
  --card-figure: var(--text-hero-compact);
}
/* The main figure is seen by its width and its size, with no top edge of its own (T2.70, Björn 1/11; marin had a navy
   one). */
.ui-card-hero {
  --card-figure: var(--text-hero);
}
/* The card's state is the parameter tone (T2.70, Björn 1/11): the top edge means only a state, yellow a warning and red
   something that has to be done, in --line-card. The edge is drawn in the frame's place, and the room over the label
   is less by as much, so that a card with a state is as high as the others and its figure stands at the same height in
   a row of aligned cards. */
.ui-card-warning {
  border-top: var(--line-card) solid var(--card-tone-warning);
  padding-top: calc(var(--card-pad-top) - var(--line-card) + var(--line-thin));
}
.ui-card-critical {
  border-top: var(--line-card) solid var(--card-tone-critical);
  padding-top: calc(var(--card-pad-top) - var(--line-card) + var(--line-thin));
}
/* More figures under the main one (T2.14): terms to the left and values to the right, and the way to the figure's page. */
.ui-card-lines {
  display: grid;
  gap: var(--space-1);
  margin: var(--card-detail-gap) 0 0;
  font-size: var(--text-xs);
}
.ui-card-lines div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
}
.ui-card-lines dt {
  color: var(--color-text-2);
}
.ui-card-lines dd {
  margin: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* A figure that opens what it is made of (1a.19): the main figure and a line's value are links at a tap target's height,
   in the figure's own colour, and the underline says it is a link. */
.ui-card-value a {
  display: inline-flex;
  flex-wrap: wrap; /* the figure and its unit are two items that may wrap, the space between them is the gap (T2.132) */
  column-gap: var(--space-3);
  max-width: 100%;
  align-items: center;
  min-height: var(--target-min);
  color: inherit;
  text-decoration: underline;
}
.ui-card-lines dd a {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-height: var(--target-min);
  min-width: var(--target-min);
  color: inherit;
  text-decoration: underline;
}
.ui-card-lines div:has(dd a) {
  align-items: center;
}
.ui-card-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
/* A card that is one link (T2.43, Jesper 31/10): the whole card is the tap target and the name for a screen reader is its
   label and value. A chevron at the corner says it leads on, a frame in the action's colour and its soft surface mark
   hover and focus, and the focus ring is the page's. Nothing in it is underlined, since nothing in it is a link. */
.ui-card-to {
  position: relative;
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.ui-card-to:hover {
  background: var(--color-action-soft);
  box-shadow: inset 0 0 0 var(--line-thin) var(--color-action);
}
.ui-card-to:focus-visible {
  background: var(--color-action-soft);
  box-shadow: inset 0 0 0 var(--line-thin) var(--color-action);
}
.ui-card-to .ui-card-label {
  padding-right: var(--space-7);
}
/* The card whose filter the list under it shows (current, P.0.17a, K13, the prototype's tile with on): a ring inside the
   frame in the action's colour, kept at hover and focus; aria-current says it to a screen reader. */
.ui-card-to.ui-card-current,
.ui-card-to.ui-card-current:hover,
.ui-card-to.ui-card-current:focus-visible {
  box-shadow: inset 0 0 0 var(--line-card) var(--card-current-ring);
}
.ui-card-chevron {
  position: absolute;
  top: var(--card-pad-top);
  right: var(--card-pad-side);
  font-size: var(--text-xl);
  font-weight: var(--weight-strong);
  line-height: 1;
  color: var(--color-text-2);
}
.ui-card-chevron::before {
  content: "›";
}
.ui-card-to:hover .ui-card-chevron,
.ui-card-to:focus-visible .ui-card-chevron {
  color: var(--color-action);
}
/* The main figure in the compact density is twice as wide as the others (the prototype's hero tile), from an iPad in
   landscape; the other cards share the rest. Under it the cards are as wide as each other. */
@media (min-width: 1180px) {
  .ui-page-compact .ui-cards:has(> .ui-card-hero) {
    grid-template-columns: var(--cards-hero-share) minmax(0, 1fr);
  }
  .ui-page-compact .ui-cards:has(> .ui-card-hero):has(> :nth-child(3)) {
    grid-template-columns: var(--cards-hero-share) minmax(0, 1fr) minmax(0, 1fr);
  }
}
/* A title that is a link (T2.43): the text in the title's own colour and a chevron in the action's, so it shows it leads
   on without an underline; hover and focus underline it and colour it. At the height and at least the width of a tap
   target, so that a short title such as ÄTA is no smaller than 44 px wide. */
.ui-title-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--target-min);
  min-width: var(--target-min);
  color: inherit;
  text-decoration: none;
}
.ui-title-more {
  color: var(--color-action);
  font-weight: var(--weight-bold);
}
.ui-title-link:hover,
.ui-title-link:focus-visible {
  color: var(--color-action);
  text-decoration: underline;
  text-underline-offset: var(--space-2);
}
/* The way to the rest of a box's list under its table (P.0, the pilot session 1/11): a link to another view, with the
   title link's look and chevron, as the overview's Visa alla (N) to Attest. */
.ui-panel-more {
  margin: var(--space-4) 0 0;
}
/* A list's foot (T2.85, K14, components/list_foot.html): under the table of a list in a panel, "Visar 10 av 46" at the left and
   the number of rows, Visa 10 till and Visa alla 46 at the right, on a line that wraps on a narrow screen. The picker is the
   value picker's variant that hangs from its right edge (align end), whose list is narrower here and is moved by
   components.js when the line has wrapped and the picker stands further left. */
.ui-list-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--list-foot-gap);
  margin-top: var(--space-3);
  padding-top: var(--list-foot-pad-y);
  border-top: var(--line-thin) solid var(--list-foot-line);
}
.ui-list-foot-count {
  margin: 0;
  color: var(--list-foot-text);
  font-size: var(--text-sm);
}
.ui-list-foot-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1) var(--list-foot-gap);
  margin-left: auto;
}
.ui-list-foot .ui-valuepicker-end .ui-valuepicker-pop {
  width: min(var(--valuepicker-foot-pop), calc(100vw - 2 * var(--page-side)));
}
/* Cards in a box of half the page (T2.14): two by two, with a smaller figure. */
.ui-cards-compact .ui-card:not(.ui-card-compact) {
  --card-figure: var(--text-2xl);
}
.ui-cards-compact {
  gap: var(--space-5);
}
/* Fields in rows with a width after their content (1c.P, the prototype's fgrid): each field takes at least
   --field-row-min and the row shares what is left, so that a date, an amount and a phone number stand two or three
   in a row and a field in a form is never alone in the whole width unless the row is narrow. A long text (a
   description, a heading) stands under the rows, outside the block, in the whole width. */
.ui-fields {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6) var(--space-7);
  align-items: flex-start;
}
.ui-fields > * {
  flex: 1 1 var(--field-row-min);
  min-width: 0;
}
/* A part of a panel, such as one of the two columns of a form in ui-columns (1c.P): its heading and fields with the
   panel's own space between them, without an edge of its own. */
.ui-panel-part {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  min-width: 0;
}
/* Two boxes next to each other from an iPad in landscape, one over the other under it (T2.14). */
.ui-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
  align-items: stretch;
}
.ui-columns > * {
  min-width: 0;
}
/* Two small boxes, as the forecast's adjustments, next to each other already from an iPad standing up (P.0). */
@media (min-width: 820px) {
  .ui-columns-early {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* Two boxes from an iPad lying down (--bp-ipad-landscape) where the second has twice the room of the first
   (--columns-third), as Använda and Tillgängliga of Händelsetyper i projektet (1g.11f.1, K96 v7, the pilot session
   16/11); under it one over the other, the first on top, each the whole width. */
@media (min-width: 1180px) {
  .ui-columns.ui-columns-third {
    grid-template-columns: var(--columns-third);
  }
}
/* Boxes side by side that together fill the width, as many as fit, such as the living budget's three lists of income
   adjustments while one edits (P.0, round 3): no empty space at the right at 1180 and 1366 px. */
.ui-columns-fill {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--picker-min), 1fr));
  gap: var(--space-7);
}
.ui-columns-fill > * {
  min-width: 0;
}
/* The page's grid (T2.70, Björn 1/11 via the pilot session, the layout sketch): a container query on the content area,
   not on the screen, so the side menu's width is counted. One column under 900 px of content, four from 900 px and six
   from 1500 px (--page-grid-four and --page-grid-six; a container query cannot read them, so the widths are repeated
   here and tests/test_design.py keeps them equal). The key figures and the content are blocks in the same tracks, so
   their edges line up: a block spans with ui-span-1 to ui-span-4 or ui-span-all from four columns, and with
   ui-span-wide-1 to ui-span-wide-6 or ui-span-wide-all from six (without one it spans as many tracks as at four, so
   ui-span-4 is four of six there; only ui-span-all is the whole row at every width). A row of key figures with another number of cards than the tracks, as
   the ÄTA's four, is ui-page-grid-kpis: the whole row, shared evenly on one row from 900 px, two by two under it from
   two wide under it, also on a phone, an odd last card with the whole row. ui-page-grid is the container and holds the grid,
   ui-page-grid-tracks. */
.ui-page-grid {
  container-type: inline-size;
}
.ui-page-grid-tracks,
.ui-page-grid-kpis {
  display: grid;
  gap: var(--page-grid-gap);
  grid-template-columns: minmax(0, 1fr);
}
.ui-page-grid-tracks > *,
.ui-page-grid-kpis > * {
  min-width: 0;
}
/* A card alone in a block fills the block's height, so the cards of a row are as high as each other; so does Att göra
   (1c.3c: without the note and the badge it is shorter than the invoices beside it). */
.ui-page-grid-tracks > * > .ui-card:only-child,
.ui-page-grid-tracks > * > .ui-todo:only-child {
  height: 100%;
}
/* Key figures are two wide under four tracks (under 900 px of content), also on a phone (P.0.17c, K13: "nyckeltalen två i
   bredd"), and an odd last card has the whole row: one is the whole row, two are two wide, three are two and the third over
   the whole row, five are two and two and the fifth over the whole row, as the fifth of five (P.0.17d omgång 3), at 820,
   600 and 390 px (the pilot session 12/11, answer 1). One rule for the row, not one per number of cards. From four tracks
   the variants below lay the row out as the layout's grid 1/4/6 (Björn 1/11), never three and one. */
.ui-page-grid-kpis {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ui-page-grid-kpis > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
}
@container (min-width: 900px) {
  .ui-page-grid-tracks {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .ui-span-1 {
    grid-column: span 1;
  }
  .ui-span-2 {
    grid-column: span 2;
  }
  .ui-span-3 {
    grid-column: span 3;
  }
  .ui-span-4 {
    grid-column: span 4;
  }
  .ui-span-all,
  .ui-page-grid-kpis {
    grid-column: 1 / -1;
  }
  .ui-page-grid-kpis {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
  }
  /* A row of up to six key figures (ui-page-grid-kpis-six, P.0.17a, K13: the start page and Portfölj): three to a row
     at four tracks, and the whole row shared evenly at six, so that six stand in one row only where the page has room
     for them. Five key figures (ui-page-grid-kpis-five, the management's on the start page) are laid out the same way
     (P.0.17d omgång 3, the pilot session 4/11, as the sketch's "två rader om tre"): the cards are as wide as in the
     row of three, so the second row is two cards of that width and an empty place, never two stretched cards. */
  .ui-page-grid-kpis.ui-page-grid-kpis-six,
  .ui-page-grid-kpis.ui-page-grid-kpis-five {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .ui-page-grid-kpis > :last-child:nth-child(odd) {
    grid-column: auto;
  }
  .ui-page-grid-kpis.ui-page-grid-kpis-four {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@container (min-width: 1500px) {
  .ui-page-grid-tracks {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .ui-page-grid-kpis.ui-page-grid-kpis-six,
  .ui-page-grid-kpis.ui-page-grid-kpis-five {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
  }
  .ui-span-wide-1 {
    grid-column: span 1;
  }
  .ui-span-wide-2 {
    grid-column: span 2;
  }
  .ui-span-wide-3 {
    grid-column: span 3;
  }
  .ui-span-wide-4 {
    grid-column: span 4;
  }
  .ui-span-wide-5 {
    grid-column: span 5;
  }
  .ui-span-wide-6,
  .ui-span-wide-all {
    grid-column: 1 / -1;
  }
}
/* The list and a part beside it (ui-page-grid-tracks-beside, P.0.17c, K13: "Stor skärm (från 1700): projektlistan och
   ÄTA-uppföljningen sida vid sida"): from --page-grid-beside of content, a window of 1700 px with the side menu open,
   the main part (ui-page-grid-main) has two thirds of the row and the part beside it (ui-page-grid-aside) one third,
   the list at the left. Two of three tracks end where the fourth of six key figures ends, so the edges line up with
   the key figures' at four tracks (three to a row) and at six. Under it both have the whole row, one under the other,
   as every ui-span-all. A query cannot read a token, so tests/test_design.py keeps the width equal to it. */
@container (min-width: 1436px) {
  .ui-page-grid-tracks.ui-page-grid-tracks-beside {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .ui-page-grid-tracks-beside > .ui-page-grid-main {
    grid-column: span 2;
  }
  .ui-page-grid-tracks-beside > .ui-page-grid-aside {
    grid-column: span 1;
  }
}
/* The part beside the list has the compact card of a phone (compact, T2.42), since it is a third of the row (P.0.17c,
   the pilot session 12/11, K13 hel-1920: "ÄTA på två rader per post"): the variant of compact that the part's width
   decides, without a header row, each row a post of the lines its columns have, as the phone's card, and card_end at
   the right of its line. The same rules as the phone's under 600 px, which a container query cannot share with it. */
@container (min-width: 1436px) {
  .ui-page-grid-tracks-beside > .ui-page-grid-aside .ui-table-compact,
  .ui-page-grid-tracks-beside > .ui-page-grid-aside .ui-table-compact tbody,
  .ui-page-grid-tracks-beside > .ui-page-grid-aside .ui-table-compact td {
    display: block;
  }
  .ui-page-grid-tracks-beside > .ui-page-grid-aside .ui-table-compact thead,
  .ui-page-grid-tracks-beside > .ui-page-grid-aside .ui-table-compact td:not([data-line]),
  .ui-page-grid-tracks-beside > .ui-page-grid-aside .ui-table-compact td:empty {
    display: none;
  }
  .ui-page-grid-tracks-beside > .ui-page-grid-aside .ui-table-compact tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: var(--space-3);
    padding: var(--space-4);
    border-bottom: var(--line-thin) solid var(--color-border);
  }
  .ui-page-grid-tracks-beside > .ui-page-grid-aside .ui-table-compact tr::before,
  .ui-page-grid-tracks-beside > .ui-page-grid-aside .ui-table-compact tr::after {
    content: "";
    flex: 0 0 100%;
    height: 0;
  }
  .ui-page-grid-tracks-beside > .ui-page-grid-aside .ui-table-compact tr::before {
    order: 15;
  }
  .ui-page-grid-tracks-beside > .ui-page-grid-aside .ui-table-compact tr::after {
    order: 25;
  }
  .ui-page-grid-tracks-beside > .ui-page-grid-aside .ui-table-compact td {
    padding: 0;
    border: 0;
    text-align: left;
    overflow-wrap: break-word;
  }
  .ui-page-grid-tracks-beside > .ui-page-grid-aside .ui-table-compact td[data-line="1"] {
    order: 10;
  }
  .ui-page-grid-tracks-beside > .ui-page-grid-aside .ui-table-compact td[data-line="2"] {
    order: 20;
    color: var(--color-text-3);
  }
  .ui-page-grid-tracks-beside > .ui-page-grid-aside .ui-table-compact td[data-line="3"] {
    order: 30;
  }
  .ui-page-grid-tracks-beside > .ui-page-grid-aside .ui-table-compact td.ui-cc-sep::before {
    content: "\00b7";
    margin-right: var(--space-3);
    color: var(--color-text-3);
  }
  .ui-page-grid-tracks-beside > .ui-page-grid-aside .ui-table-compact td[data-suffix]::after {
    content: attr(data-suffix);
  }
  .ui-page-grid-tracks-beside > .ui-page-grid-aside .ui-table-compact td.ui-cc-end {
    margin-left: auto;
  }
  .ui-page-grid-tracks-beside > .ui-page-grid-aside .ui-table-compact tr:has(> td.ui-cc-end) > td.ui-text-wrap[data-line] {
    flex: 1 1 0;
    min-width: 0;
  }
}
@media (min-width: 1180px) {
  .ui-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-9);
  }
  /* The compact density has the prototype's 20 px between the boxes (.grid2, P.0), as between the rows of the page. */
  .ui-page-compact .ui-columns {
    gap: var(--space-8);
  }
}
.ui-panel-title {
  font-size: var(--text-title);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}
/* The heading row (P.0.3, components/heading_row.html): the panel's heading with the controls of what is under it at
   the right, on the heading's middle line, as the prototype's panel heading with its buttons. When the row is too
   narrow the controls go under the heading and stay at the right. */
.ui-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-7);
}
.ui-heading-row > .ui-panel-title {
  margin: 0;
  padding: 0;
}
.ui-heading-row > .ui-actions {
  margin-left: auto;
}
/* A list's filters in its card's heading row (P.0.14, the pilot session 2/11): value pickers ("Status Alla") right after
   the heading, and the table's actions at the right as before. */
.ui-heading-row > .ui-heading-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
}
.ui-heading-row > .ui-heading-filters + .ui-actions {
  margin-left: auto;
}
/* A heading row whose filters split where the card is narrow (split in components/heading_row.html, K64, the pilot
   session's side by side 13/11): the heading and the filter that opens towards the left (align end) stay on the heading's
   line, the one at the right edge, and the other filters go under them, as the card's phone ("Att fördela 3" and Visa on
   one line, Vecka and Typ under it). By the card's width and never the kind of device: the card is the container, and
   where there is room every filter stands on the heading's line as before. 600 px is --bp-mobile, which a container query
   cannot read. The line break is a box of no height, so that the rows are the same distance apart as the row's gap. */
.ui-panel:has(> .ui-heading-row-split) {
  container-type: inline-size;
}
@container (max-width: 599px) {
  .ui-heading-row-split {
    row-gap: 0;
  }
  .ui-heading-row-split::after {
    content: "";
    order: 1;
    flex: 1 1 100%;
    height: 0;
  }
  .ui-heading-row-split > .ui-heading-filters {
    display: contents;
  }
  .ui-heading-row-split > .ui-heading-filters > .ui-valuepicker-end {
    order: 1;
    margin-left: auto;
  }
  .ui-heading-row-split > .ui-heading-filters > .ui-valuepicker:not(.ui-valuepicker-end) {
    order: 2;
    margin-top: var(--space-4);
  }
}
/* Status badges right after the heading that count what the part shows (badges, P.0.17a, K13: the ÄTA's follow-up). */
.ui-heading-row > .ui-heading-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}
/* A ledger's sub heading over its table, as Kostnader and Prognos per rad: the prototype's h3 in bold. */
.ui-heading-row-ledger > .ui-panel-title {
  font-size: var(--text-grid-heading);
  font-weight: var(--weight-bold);
}
/* A disclosure (utfällning, P.0, the pilot session 1/11): a button that shows more in the same place, with a muted
   chevron that points right and turns down when it is open, as a row that folds out (1c.P). Never a link's look: a
   link goes to another view (docs/design.md). The button's text says what it shows; at a tap target's height. Without
   JavaScript (no data-js on html) the part is shown and the button is not, so nothing is out of reach. */
.ui-disclosure {
  margin-top: var(--disclosure-space);
}
.ui-disclosure-toggle {
  display: none;
  align-items: center;
  gap: var(--disclosure-gap);
  min-height: var(--target-min);
  padding: 0 var(--space-2) 0 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--disclosure-text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
}
html[data-js] .ui-disclosure-toggle {
  display: inline-flex;
}
.ui-disclosure-icon {
  flex: none;
  width: var(--disclosure-icon);
  height: var(--disclosure-icon);
  fill: none;
  stroke: var(--disclosure-color);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--motion-fast);
}
.ui-disclosure-toggle[aria-expanded="true"] .ui-disclosure-icon {
  transform: rotate(90deg);
}
.ui-disclosure-toggle[aria-expanded="true"] .ui-disclosure-show,
.ui-disclosure-toggle[aria-expanded="false"] .ui-disclosure-hide {
  display: none;
}
html[data-js] .ui-disclosure-toggle[aria-expanded="false"] + .ui-disclosure-body {
  display: none;
}
.ui-disclosure-toggle[aria-expanded="true"] + .ui-disclosure-body {
  margin-top: var(--disclosure-space);
}
@media (prefers-reduced-motion: reduce) {
  .ui-disclosure-icon {
    transition: none;
  }
}
/* A disclosure whose button makes something new (variant create, 1g.8b2, K30: "+ Lägg till veckor" and "+ Lägg till dag
   eller period"): the button is the create button (ui-button-create) with its plus, and no chevron; while it is open it
   says how to shut it, without the plus. The rest is the disclosure's: without JavaScript the part is shown and the
   button is not. */
.ui-disclosure-add {
  display: none;
}
html[data-js] .ui-disclosure-add {
  display: inline-flex;
}
.ui-disclosure-add[aria-expanded="true"] .ui-button-plus,
.ui-disclosure-add[aria-expanded="true"] .ui-disclosure-show,
.ui-disclosure-add[aria-expanded="false"] .ui-disclosure-hide {
  display: none;
}
html[data-js] .ui-disclosure-add[aria-expanded="false"] + .ui-disclosure-body {
  display: none;
}
.ui-disclosure-add[aria-expanded="true"] + .ui-disclosure-body {
  margin-top: var(--disclosure-space);
}
/* Chips (chips, 1g.8b2, K30): short values chosen in a list, each with a cross that takes it away, side by side and
   wrapping. The chip is as high as a row's controls (--chip-height: 28 px with a mouse, 44 px with touch), and its
   cross a square of the same height drawn, with a tap target of --target-min, a submit button of the form, grey and
   red under the mouse as the quiet button. */
.ui-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--chip-gap);
  margin: 0 0 var(--chip-gap);
  padding: 0;
  list-style: none;
}
.ui-chip {
  display: inline-flex;
  align-items: center;
  min-height: var(--chip-height);
  padding-left: var(--chip-pad);
  border: var(--line-thin) solid var(--chip-edge);
  border-radius: var(--chip-radius);
  background: var(--chip-surface);
  color: var(--chip-text);
  font-size: var(--text-sm);
  white-space: nowrap;
}
/* The button is the cross's tap target, --chip-x-target square (at least --target-min), and its margin takes back the
   reach, so the chip keeps its height; the square drawn under the mouse and the focus ring are its ::before, as high
   as the chip. */
.ui-chip-x {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: var(--chip-x-target);
  height: var(--chip-x-target);
  margin: calc(-1 * var(--chip-x-reach));
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--chip-x-text);
  cursor: pointer;
}
.ui-chip-x::before {
  content: "";
  position: absolute;
  inset: var(--chip-x-reach);
  border-radius: var(--chip-radius);
}
.ui-chip-x svg {
  position: relative;
  width: var(--icon);
  height: var(--icon);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--icon-line);
  stroke-linecap: round;
}
.ui-chip-x:hover,
.ui-chip-x:focus-visible {
  color: var(--chip-x-hover);
}
.ui-chip-x:hover::before,
.ui-chip-x:focus-visible::before {
  background: var(--chip-x-hover-surface);
}
.ui-chip-x:focus-visible {
  outline: none;
}
.ui-chip-x:focus-visible::before {
  outline: var(--line-medium) solid var(--color-focus);
  outline-offset: var(--line-medium);
}

/* The parts of the period that the value picker's Egen period has (T2.44, T2.71a): the dash between the two dates, and
   the discreet word Laddar while the page for a new period loads. The period of two dates and a quick choice is gone
   since P.0.15; every project page has the value picker. */
.ui-period-dash {
  color: var(--color-text-3);
}
.ui-period-loading {
  margin: var(--space-2) 0 0;
  white-space: nowrap;
  color: var(--color-text-3);
  font-size: var(--text-xs);
  font-style: italic;
}
.ui-period-loading[hidden] {
  display: none;
}
/* ---- Value picker (T2.71a, Björn 1/11 via the pilot session) ---- */
/* The value is the button, with a small arrow in the accent's colour, and the list opens under it and applies at once:
   the project in the heading and the period at the right edge of the page's head. As dense as a compact row of
   actions with a mouse, the tap target with touch (ui-actions-compact on the root). */
.ui-valuepicker {
  position: relative;
  min-width: 0;
}
.ui-valuepicker-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.ui-valuepicker-value {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--control-min);
  max-width: 100%;
  padding: var(--valuepicker-pad-y) var(--valuepicker-pad-x);
  border: 0;
  border-radius: var(--valuepicker-radius);
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
}
/* In the heading the button is a block of text, so that a name that wraps has the arrow after its last word; each line
   keeps the button's air and corners (box-decoration-break), so that the open value reads as a button and never as
   marked text, with the arrow inside it. */
.ui-valuepicker-heading .ui-valuepicker-value {
  display: inline-block;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.ui-valuepicker-heading .ui-valuepicker-arrow {
  display: inline-block;
  margin-left: var(--space-3);
  vertical-align: middle;
}
/* The last word and the arrow are one unit that never breaks (T2.81), so that the arrow never stands alone on a line of
   its own; the name breaks between its other words as before. */
.ui-valuepicker-tail {
  white-space: nowrap;
}
/* The heading's text starts at the content's edge, as the tabs and the cards do; the air is at the right only. */
.ui-valuepicker-title > .ui-valuepicker-value:first-child {
  margin-left: calc(-1 * var(--valuepicker-pad-x));
}
/* So does a name after a prefix (Levande budget - , ÄTA - ) when it wraps under the prefix, as on a phone, so that every
   line of the heading starts at the same edge (P.0.7 round 3, 390 px); beside the prefix, the prefix's air on its right
   keeps the gap the button's air gave. */
.ui-valuepicker-title > .ui-valuepicker-prefix {
  margin-right: var(--valuepicker-pad-x);
}
.ui-valuepicker-title > .ui-valuepicker-prefix + .ui-valuepicker-value {
  margin-left: calc(-1 * var(--valuepicker-pad-x));
}
/* Hover, open and the keyboard's focus look the same in every value picker (P.0.14, Björn 2/11): the soft surface, and
   with the keyboard the page's focus ring round it as well. */
.ui-valuepicker-value:hover,
.ui-valuepicker-value:focus-visible,
.ui-valuepicker-value[aria-expanded="true"] {
  background: var(--valuepicker-open-bg);
}
/* The fields in a dense table (1c.14, the ÄTA's form with its 14 columns): the table is the sum of its columns' least
   widths, so a field has the least width of its sort and not --field-min: the short ones (KS, Mängd, Enh, Arvode %)
   --field-min-dense, the prices --field-chars-price, the category --field-chars-category and the account picker
   --field-min-account, and Specifikation, the only free text, takes what is left (ui-col-grow), so that the table fits a
   page of 1366 px with the side menu open and no value is cut. Derived from the prototype's #ata-rader (the tokens). Only a
   table that has fields in its cells. */
@media (min-width: 600px) {
  .ui-table-dense td.ui-cell-field .ui-input {
    min-width: var(--field-min-dense);
  }
  .ui-table-dense td.ui-cell-size-price .ui-input {
    min-width: calc(var(--field-chars-price) + 2 * var(--space-3) + 2 * var(--line-thin));
  }
  .ui-table-dense td.ui-cell-size-category .ui-input {
    min-width: calc(var(--field-chars-category) + 2 * var(--space-3) + 2 * var(--line-thin));
  }
  .ui-table-dense td.ui-cell-field .ui-picker-cell {
    min-width: var(--field-min-account);
  }
  .ui-table-dense th.ui-col-grow,
  .ui-table-dense td.ui-col-grow {
    width: 100%;
  }
}
/* The fields in a row stand on one line (T2.97, Björn 7/11): in a table's row with fields every cell stands at the top, so
   that the fields have the same upper edge whether a text stands under one of them or not, such as the account's name
   under Konto; a centred cell moved its field up when the text came. A text or an amount beside the fields starts on
   the fields' line of text (--cell-field-line-pad). A text under a field, a hint, a note or a warning, is in the field's
   flow: the row grows downwards and the rows under it move down, and the field never moves up. On a phone the row is a
   card and its cells are lines of their own, and so is a table that works out its lines (calc) below 1180 px. */
@media (min-width: 600px) {
  .ui-table:not([data-calc]) tr:has(> td.ui-cell-field) > :is(td, th[scope="row"]) {
    vertical-align: top;
  }
  .ui-table:not([data-calc]) tr:has(> td.ui-cell-field) > :is(td, th[scope="row"]):not(.ui-cell-field) {
    padding-top: var(--cell-field-line-pad);
  }
}
@media (min-width: 1180px) {
  .ui-table[data-calc] tr:has(> td.ui-cell-field) > :is(td, th[scope="row"]) {
    vertical-align: top;
  }
  .ui-table[data-calc] tr:has(> td.ui-cell-field) > :is(td, th[scope="row"]):not(.ui-cell-field) {
    padding-top: var(--cell-field-line-pad);
  }
}
/* A text in a table's cell is never cut (T2.97, docs/granskningslista.md): a field of free text in a column that wraps
   (wrap), such as an ÄTA line's Kategori and Specifikation, is a text area of one line that breaks its text within the
   cell and grows downwards, as high as its text. A word is never broken in the middle: the text breaks between its
   words (break-word, which leaves the column's least width alone, where anywhere lowered it to one letter), and the
   column is at least as wide as its longest word, since the text area's text is mirrored in the cell
   (ui-input-wrap-mirror), where the table's layout sees it. Nor is a word hyphenated (hyphens: manual, round 2 of #816):
   Safari on an iPad hyphenates Swedish, which breaks a word in the middle too. Only a word longer than the whole table
   is broken; a table that is then wider than its room scrolls in its own box, never the page. It is one line of text, so Enter does not make a
   new line and a pasted line break is a space (components.js). */
.ui-table td.ui-cell-field textarea.ui-input-wrap {
  display: block;
  min-height: var(--target-min);
  padding-top: calc(var(--cell-field-line-pad) - var(--line-thin)); /* one line stands where an input's text does */
  padding-bottom: calc(var(--cell-field-line-pad) - var(--line-thin));
  resize: none;
  overflow: hidden;
  overflow-wrap: break-word;
  hyphens: manual; /* a word is never hyphenated, so it is never broken in the middle */
  white-space: pre-wrap;
  width: 100%; /* the cell's width, which the mirror below decides, */
  contain: inline-size; /* and not its own text's: field-sizing: content (textarea.ui-input) gives a text area the width of its text, with hyphens: manual its longest whole word, and the cell would then take that word's width from the text area as well as from the mirror, so the table's least width counted a word the fields do not need (T2.97 round 2 made the words whole, and the form of an ÄTA no longer fitted 1366 px with the menu open, 1c.14); the height still follows the text */
}
/* The mirror of the text area's text: as wide as its longest word with the text area's air and frame, and no height, so
   that it only gives the column its least width. It is not read by a screen reader. In a card, where the cell is a line
   of its own and no column widens, there is none. */
.ui-table td.ui-cell-field .ui-input-wrap-mirror {
  display: none;
}
@media (min-width: 600px) {
  .ui-table:not([data-calc]) td.ui-cell-field .ui-input-wrap-mirror {
    display: block;
  }
}
@media (min-width: 1180px) {
  .ui-table[data-calc] td.ui-cell-field .ui-input-wrap-mirror {
    display: block;
  }
}
.ui-table td.ui-cell-field .ui-input-wrap-mirror {
  height: 0;
  overflow: hidden;
  visibility: hidden;
  padding: 0 var(--space-3); /* the air of a field in a cell (.ui-cell-editable .ui-input) */
  border: var(--line-thin) solid transparent;
  border-block-width: 0;
  font-family: var(--font-body);
  font-size: var(--text-field);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  hyphens: manual; /* never hyphenated, so that its least width is the longest whole word (auto lowers it to a syllable) */
}
/* When a text under a field comes or goes without a reload, or a text in a cell takes a new line, the field's box glides
   to its new height (components.js, glide): the time and the curve are tokens, and with reduced motion there is none. */
.ui-glide {
  overflow: clip; /* while it glides, a text that comes is shown as the box grows, never drawn over the row under it */
  transition: height var(--motion-grow) var(--ease-grow);
}
@media (prefers-reduced-motion: reduce) {
  .ui-glide {
    transition: none;
  }
}
/* The form mode (field, T2.80, K11): the button is a field of the form, as the other fields are drawn (ui-input): the
   frame, the field's height and text size, the placeholder in the field's grey, the arrow inside at the right; open, the
   accent's frame. The list under it is as wide as the field, at least --valuepicker-form-pop-min and never wider than
   the page; components.js moves it left when the field stands too near the right edge for it. */
.ui-valuepicker-field {
  width: 100%;
  min-width: var(--field-min);
  min-height: var(--target-min);
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border: var(--line-thin) solid var(--valuepicker-field-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-field);
}
.ui-valuepicker-field:hover,
.ui-valuepicker-field:focus-visible {
  background: var(--color-surface);
}
.ui-valuepicker-field[aria-expanded="true"] {
  background: var(--color-surface);
  border-color: var(--valuepicker-field-open-border);
  box-shadow: 0 0 0 var(--line-thin) var(--valuepicker-field-open-border);
}
/* A long name wraps and the button grows, so that the badge avslutat is never cut off. */
.ui-valuepicker-field .ui-valuepicker-text {
  min-width: 0;
  overflow-wrap: break-word;
}
.ui-valuepicker-field .ui-valuepicker-text.is-empty {
  color: var(--valuepicker-field-placeholder);
}
.ui-valuepicker-field .ui-valuepicker-arrow {
  width: var(--icon);
  height: var(--icon);
}
/* The row that adds something (plus, 1g.11g.1, K55, the pilot session 11/11): the form mode's button as a row, a plus
   and the name in the action's colour, with no frame, no placeholder and no arrow; the label and the placeholder are
   kept for a screen reader. The row has the value picker's soft surface under the pointer, with the keyboard's focus
   and while its list is open. */
.ui-valuepicker-plus > .ui-field-label {
  position: absolute;
  width: var(--line-thin);
  height: var(--line-thin);
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.ui-valuepicker-plus .ui-valuepicker-field {
  justify-content: flex-start;
  gap: var(--valuepicker-plus-gap);
  min-height: var(--valuepicker-plus-min);
  padding-inline: var(--valuepicker-plus-pad);
  border-color: transparent;
  background: transparent;
  color: var(--valuepicker-plus-text);
  font-size: inherit;
  font-weight: var(--weight-strong);
}
.ui-valuepicker-plus .ui-valuepicker-field:hover,
.ui-valuepicker-plus .ui-valuepicker-field:focus-visible,
.ui-valuepicker-plus .ui-valuepicker-field[aria-expanded="true"] {
  border-color: transparent;
  background: var(--valuepicker-open-bg);
  box-shadow: none;
}
.ui-valuepicker-plus .ui-valuepicker-text,
.ui-valuepicker-plus .ui-valuepicker-arrow {
  display: none;
}
.ui-valuepicker-form .ui-valuepicker-pop {
  width: max(100%, var(--valuepicker-form-pop-min));
  max-width: calc(100vw - 2 * var(--page-side));
}
/* The label beside the field (inline, 1g.11, K48, pilotsessionen 9/11): the label to the left on the button's line and
   the button as wide as its value; on a surface where the row has no room for both, the row breaks and the label stands
   above, as the form's other labels. The list opens under the row as the form mode's. */
.ui-valuepicker-inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-5);
}
.ui-valuepicker-inline .ui-valuepicker-field {
  flex: 0 1 auto;
  width: auto;
  max-width: 100%;
}
/* In a row of actions (a list's filter, Reskontra) the field is not as narrow as its text but as wide as a picker's, so
   that its list is not narrower than a project's name needs. */
.ui-actions .ui-valuepicker-form {
  flex: 1 1 var(--picker-min);
  max-width: var(--valuepicker-pop-width);
}
.ui-valuepicker-lead {
  color: var(--color-text-2);
  font-weight: var(--weight-regular);
}
.ui-valuepicker-arrow {
  flex: none;
  width: var(--valuepicker-arrow-size);
  height: var(--valuepicker-arrow-size);
  color: var(--valuepicker-arrow);
  transition: transform var(--motion-fast);
}
.ui-valuepicker-value[aria-expanded="true"] .ui-valuepicker-arrow {
  transform: rotate(180deg);
}
/* The period: a button in the page's head, at the right edge on the height of the line under the heading. */
.ui-valuepicker-end .ui-valuepicker-value {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}
/* A filter in a heading row that opens towards the left (align end, P.0.17d omgång 3) looks as the heading row's other
   filters: align end says the direction only, and the period's look above is the page head's. */
.ui-heading-filters .ui-valuepicker-end .ui-valuepicker-value {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}
.ui-page-head:has(> .ui-valuepicker-end) > :first-child {
  flex: 1 1 var(--picker-min);
  min-width: 0;
}
/* What opens over the page (T2.94, Björn 7/11): "Popups anpassar sig till utrymmet på sidan, inte tvärtom". The page never
   changes for a popup: it does not slide sideways, get wider or get a scroll. components.js (placePop) measures what opens
   where its own rules put it and, where it has no room there, moves it (is-pop-moved, to --pop-left and --pop-top with its
   width, --pop-width) to the side of its button where there is room and inside the window, --pop-edge from its edges,
   also when its content or the window changes. A list has no height of its own: it rolls in itself (is-pop-rolls, at
   most the room, --pop-max-width and --pop-max-height) only when it is wider than the window or higher than the room the
   screen has on the side it opens towards ("egen rullning bara när innehållet är större än hela skärmen", Björn 7/11).
   The value picker's list, the menus, Mer in the tabs, the picker's list, the user menus, the help of Hämtat, the
   schedule's box and the folded menu's label all have it. The place wins over the component's own (and over the
   picker's, which the script sets on the element), and it is set only while the popup is open and has no room. */
.ui-pop.is-pop-moved {
  top: var(--pop-top) !important;
  right: auto !important;
  bottom: auto !important;
  left: var(--pop-left) !important;
  width: var(--pop-width);
}
.ui-pop.is-pop-rolls {
  max-width: var(--pop-max-width);
  max-height: var(--pop-max-height);
  overflow: auto;
  /* The hint that there is more (T2.94.1): a thin scrollbar that stays, as in the side menu's list. */
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-strong) transparent;
}
/* And, in the lists that stand on the surface colour, a shade at the edge where more lies hidden, so that the cut row at the
   foot is read as "more" also where the scrollbar is the overlay of a touch screen. The surface colour is laid over it
   where the list is rolled to that end (local, it follows the content) and the shade stays (scroll). */
:is(.ui-menu-list, .ui-tab-menu, .ui-sidenav-usermenu, .ui-picker-list, .ui-valuepicker-pop).ui-pop.is-pop-rolls {
  background-image:
    linear-gradient(var(--color-surface), var(--color-surface)),
    linear-gradient(var(--color-surface), var(--color-surface)),
    linear-gradient(to bottom, color-mix(in srgb, var(--color-border-strong) 28%, transparent), transparent),
    linear-gradient(to top, color-mix(in srgb, var(--color-border-strong) 28%, transparent), transparent);
  background-position: 0 0, 0 100%, 0 0, 0 100%;
  background-repeat: no-repeat;
  background-size: 100% var(--space-9), 100% var(--space-9), 100% var(--space-7), 100% var(--space-7);
  background-attachment: local, local, scroll, scroll;
}
/* In the value picker it is the list that rolls, so that the search and the filters stay in sight; it keeps
   --valuepicker-list-min, and in a window lower than that the popup rolls as a whole. */
.ui-valuepicker-pop.is-pop-rolls .ui-valuepicker-list {
  min-height: var(--valuepicker-list-min);
}
/* The list under the value, over the page. It hangs from the button's left edge, and the common placement (T2.94, ui-pop)
   moves it where that would take it past the page's side air: else it went past the edge of the screen, and on a touch
   screen the page slid sideways while it was open (V45-5). */
.ui-valuepicker-pop {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: min(var(--valuepicker-pop-width), calc(100vw - 2 * var(--page-side)));
  margin-top: var(--space-1);
  padding: var(--space-5);
  background: var(--color-surface);
  border: var(--line-thin) solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-overlay);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  letter-spacing: normal;
  line-height: var(--leading-normal);
}
.ui-valuepicker-pop[hidden] {
  display: none;
}
.ui-valuepicker-end .ui-valuepicker-pop {
  left: auto;
  right: 0;
  width: min(var(--valuepicker-pop-narrow), calc(100vw - 2 * var(--page-side)));
}
.ui-valuepicker-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.ui-valuepicker-list {
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ui-valuepicker-list > li[hidden],
.ui-valuepicker-group-list > li[hidden] {
  display: none;
}
/* A group's own options under its heading (1g.11f.1, pilotsessionen 16/11): the list's rows, in a list for the group. */
.ui-valuepicker-group-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ui-valuepicker-option {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--control-min);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--color-text);
  text-decoration: none;
}
/* A choice that is posted is a button and looks as the link does (T2.85): the form's submit button, over the whole width. */
button.ui-valuepicker-option {
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ui-valuepicker-post {
  margin: 0;
}
.ui-valuepicker-option b {
  font-variant-numeric: tabular-nums;
}
.ui-valuepicker-option:hover,
.ui-valuepicker-option.is-active {
  background: var(--valuepicker-hover);
}
/* The value now: the accent's line at the left, inside the option so that it costs no width. */
.ui-valuepicker-option.is-current {
  box-shadow: inset var(--valuepicker-current-width) 0 0 var(--valuepicker-current);
  font-weight: var(--weight-medium);
}
.ui-valuepicker-sub {
  display: block;
  color: var(--color-text-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
}
.ui-valuepicker-signal {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.ui-valuepicker-signal::before {
  content: "";
  flex: none;
  width: var(--valuepicker-dot);
  height: var(--valuepicker-dot);
  border-radius: var(--radius-round);
  background: var(--valuepicker-signal);
}
/* The person's own choice (T2.85, K14): the dot before the value of the button and of the chosen option, and the small
   grey word after an option; the dot has a text for a screen reader on the button (mark) and the word is the option's own. */
.ui-valuepicker-mark {
  display: inline-block;
  flex: none;
  width: var(--valuepicker-own-size);
  height: var(--valuepicker-own-size);
  margin-right: var(--space-2);
  border-radius: var(--radius-round);
  background: var(--valuepicker-own);
  vertical-align: middle;
}
.ui-valuepicker-tag {
  margin-left: var(--space-4);
  color: var(--valuepicker-tag);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
}
/* The last option, Återställ till standard, set apart from the choices by a line above it, in the link's colour. */
.ui-valuepicker-reset {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: var(--line-thin) solid var(--valuepicker-reset-line);
}
.ui-valuepicker-reset .ui-valuepicker-option {
  color: var(--color-action);
}
/* The row that adds, last in a list or a dropdown (list_add, ui-list-add, K96 v7, T2.154): a quiet row set apart by a
   line above it, with the words in the action's colour, never the button create, so that the same action looks the
   same. The dropdown's + Ny beställare "<text>" (1c.15b.2, K63 punkt 2), the last row of a search that found no option
   with the text, is the same row around the dropdown's own option (components.js); in a list the action is a link or a
   button over the row's width with the option's height and padding (components/list_add.html). */
.ui-list-add {
  margin-top: var(--list-add-gap);
  padding-top: var(--list-add-gap);
  border-top: var(--line-thin) solid var(--list-add-line);
  list-style: none;
}
.ui-list-add-action {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--control-min);
  padding: var(--space-2) var(--space-4);
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.ui-list-add .ui-list-add-action,
.ui-list-add .ui-valuepicker-option {
  color: var(--list-add-text);
  font-weight: var(--list-add-weight);
}
.ui-list-add .ui-list-add-action:hover,
.ui-list-add .ui-valuepicker-option:hover,
.ui-list-add .ui-valuepicker-option.is-active {
  background: var(--list-add-hover);
}
.ui-list-add-plus {
  margin-right: var(--space-2);
}
/* The small form it opens under the field: a box on the second surface with its heading, the fields in a row, the
   note and the buttons (Lägg till och välj, Avbryt). */
.ui-valuepicker-add-box {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-3);
  padding: var(--space-5) var(--space-6);
  border: var(--line-thin) solid var(--valuepicker-add-edge);
  border-radius: var(--radius-md);
  background: var(--valuepicker-add-surface);
}
.ui-valuepicker-add-box .ui-actions {
  margin-top: 0;
}
.ui-valuepicker-add-title {
  margin: 0;
  font-weight: var(--weight-heading);
}
.ui-valuepicker-none,
.ui-valuepicker-note,
.ui-valuepicker-keys {
  margin: 0;
  color: var(--color-text-3);
  font-size: var(--text-xs);
}
.ui-valuepicker-none[hidden],
.ui-valuepicker-note[hidden] {
  display: none;
}
/* Senast öppnade (T2.71b, decision 0033): the projects opened last under the list, with a heading as Egen period's, in
   a list of their own that rolls at --valuepicker-recent-max, so that the list over it keeps its height. Hidden while
   the search field has a text (components.js, setupValuePicker). */
.ui-valuepicker-recent {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: var(--line-thin) solid var(--color-border-soft);
}
.ui-valuepicker-recent[hidden] {
  display: none;
}
.ui-valuepicker-recent .ui-valuepicker-group {
  padding: 0 var(--space-4);
}
.ui-valuepicker-recent-list {
  max-height: var(--valuepicker-recent-max);
}
/* Egen period: two dates under the choices, applied when they are changed (the period's, T2.44). */
.ui-valuepicker-custom {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
  padding: var(--space-4) var(--space-4) 0;
  border-top: var(--line-thin) solid var(--color-border-soft);
}
.ui-valuepicker-custom.is-current {
  box-shadow: inset var(--valuepicker-current-width) 0 0 var(--valuepicker-current);
}
.ui-valuepicker-heading-row .ui-valuepicker-group {
  padding: var(--space-3) var(--space-4) var(--space-1);
}
.ui-valuepicker-group {
  margin: 0;
  color: var(--color-text-3);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
.ui-valuepicker-dates {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
}
.ui-valuepicker-dates .ui-input[type="date"] {
  padding-inline: var(--space-3);
}
/* On a phone the two dates stand one over the other, each as wide as the list. */
@media (max-width: 599px) {
  .ui-valuepicker-dates {
    grid-template-columns: minmax(0, 1fr);
  }
  .ui-valuepicker-dates .ui-period-dash {
    display: none;
  }
}
.ui-valuepicker-error {
  margin: 0;
}
.ui-valuepicker-fallback {
  margin-left: var(--space-4);
}
/* The line about the keys is for a keyboard, which a mouse has beside it; with touch it is not shown. */
@media (pointer: coarse), (any-pointer: coarse) {
  .ui-valuepicker-keys {
    display: none;
  }
}

/* The planned list Att göra (T2.14): unticked and disabled, each with when it will tick or remind. */
/* The points one under the other, and side by side in columns of at least --todo-column where the box is wide enough
   for two (P.0.13: Att göra over the whole width at six tracks, as the layout sketch), so that the box is not tall and
   empty at the right. */
/* An ÄTA's attachments (1c.3a.3, K97 a): the heading, the photos as file cards in a grid and the other files as a list,
   each group with its heading and count, and the upload under them (file_card and file_drop). */
.ui-attachments {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-bottom: var(--space-8);
  min-width: 0;
}
.ui-attachments-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.ui-attachments-head .ui-panel-title {
  margin: 0;
}
.ui-attachments-cards {
  display: flex;
  flex-direction: column;
  gap: var(--attachments-group-gap);
  min-width: 0;
}
.ui-attachments-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}
.ui-attachments-group-title {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-heading);
  color: var(--color-text);
}
.ui-attachments-empty {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-2);
}
.ui-todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--todo-column)), 1fr));
  gap: var(--todo-row-gap) var(--space-9);
}
/* A list in columns (1g.11f.1, K96 v7, the pilot session 16/11): its rows side by side in as many columns of at least
   --list-column as the box has room for, and one under the other where it has room for one, as Tillgängliga's types.
   The width is the box's, never the screen's, so a box beside another counts as narrow. */
.ui-list-columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--list-column)), 1fr));
  gap: var(--list-column-gap);
}
/* Under an iPad lying down, where such a list stands the whole width under the box beside it (ui-columns-third), at
   most two columns: each at least --list-column-stacked of the list, more than a third (K96 v7: two at 820 px). */
@media (max-width: 1179px) {
  .ui-list-columns {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, max(var(--list-column), var(--list-column-stacked))), 1fr));
  }
}
/* On a phone one under the other, also where the box would have room for two narrow columns: a row there is the
   whole width of the screen, as every list on the phone (K96 v7: three, two and one). */
@media (max-width: 599px) {
  .ui-list-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}
.ui-list-columns > *,
.ui-list-rows > * {
  min-width: 0;
}
/* The same list in one column (ui-list-rows), as Använda beside Tillgängliga: its rows one under the other with the
   list's air, so that both areas have the same rhythm. */
.ui-list-rows {
  display: grid;
  gap: var(--list-column-gap);
}
/* A row of such a list with its buttons at its end (the pilot session 16/11): one line, the symbol, the name and the
   buttons, where the name's longest word and the buttons fit; the name wraps between its words, never inside one, and
   where even one word and the buttons do not fit the buttons go under it at the right end (ui-actions-end), never over
   the name. The name (the row's first span, after a form's hidden fields) takes the room left (basis 0), so the row
   only breaks before the buttons at its longest word. */
:is(.ui-list-columns, .ui-list-rows) > .ui-actions > span:first-of-type {
  flex: 1 1 0;
  /* the symbol stays first on the name's line, and a name of more than one line wraps beside it, never under it */
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
/* A point and its line of when directly under it, as the layout sketch's; no box to tick while the watch is planned
   (a control is shown only when it does something, P.0.13 round 2). */
.ui-todo-list li {
  display: flex;
  flex-direction: column;
  gap: var(--todo-when-gap);
}
.ui-todo-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--todo-badge-gap);
  color: var(--color-text);
}
/* A point that leads to what it is about (1c.3c, K97): the whole words are a link and a tap target. */
.ui-todo-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--todo-link-min);
  color: var(--color-link);
  text-decoration: none;
}
.ui-todo-link:hover,
.ui-todo-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: var(--space-2);
}
.ui-todo-when {
  font-size: var(--text-xs);
  color: var(--color-text-3);
}
.ui-panel {
  background: var(--color-surface);
  border: var(--line-thin) solid var(--color-border);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap);
}
/* A list in a card of its own (P.0.14, the layout sketch): the heading row with the list's filters and actions, and the
   table under it, with less air inside than a panel of text and fields (--panel-list-pad), so that the table has room. */
.ui-panel.ui-panel-list {
  padding: var(--panel-list-pad);
}
/* The card is the list's frame: the table's box (where it scrolls sideways, or a dense table's) has no edge of its own. */
.ui-panel-list .ui-table-scroll {
  border: 0;
  background: none;
}
/* A panel of running text with lists, such as the instruction (T2.16): the paragraphs and the lists have no margin of
   their own, since the panel's gap is the space between them, and a list in a list sits close under its step. */
.ui-panel-text > p,
.ui-panel-text > ul,
.ui-panel-text > ol {
  margin: 0;
}
.ui-panel-text li + li {
  margin-top: var(--space-3);
}
.ui-panel-text li > ul {
  margin: var(--space-3) 0 0;
}
/* Panels in two columns from an iPad in landscape, one over the other under it (T2.16): the panels run down the first
   column and go on in the second, each whole, so that none of them is stretched to its neighbour's height and leaves a
   hole. Where the two boxes are a pair, as on the project overview, ui-columns is the layout. */
.ui-flow > * {
  break-inside: avoid;
  margin-bottom: var(--space-8);
}
@media (min-width: 1180px) {
  .ui-flow {
    column-count: 2;
    column-gap: var(--space-9);
  }
}

/* ---- Status badges ---- */
.ui-badge {
  /* the short badge's whole name (full, 1c.P round 5) is visually hidden inside it, and must not reach outside a box
     that scrolls, such as the ÄTA list's */
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  /* Never outside its box (V46-6): on one line where it fits, as wide as its words (max-content, so that a table, a
     grid or a row gives it its whole width as before, and it never shrinks in a row), and never wider than its box.
     A badge that does not fit beside what is before it goes down to the next line, as an inline box does and a row
     of badges with flex-wrap; one wider than its box breaks its words onto a next line inside it. */
  width: max-content;
  max-width: 100%;
  flex-shrink: 0;
  padding: var(--space-1) var(--space-5);
  border: var(--line-badge) solid currentColor; /* an edge in the status's own colour, or its tone's (below) */
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  white-space: normal; /* also in a cell or a row that keeps its text on one line: the badge's width says it */
  overflow-wrap: break-word; /* only a word longer than its whole box (T2.97) */
  background: var(--color-surface-2);
  color: var(--color-text-2);
}
.ui-badge::before {
  content: "";
  width: var(--dot);
  height: var(--dot);
  border-radius: var(--radius-round);
  background: currentColor;
}
/* Each tone's surface, text and edge are tokens of their own (T2.73), so that the dark theme can mute them; the dot
   is the text's colour. */
.ui-badge-info {
  border-color: var(--badge-info-edge);
  background: var(--badge-info-bg);
  color: var(--badge-info-text);
}
.ui-badge-positive {
  border-color: var(--badge-positive-edge);
  background: var(--badge-positive-bg);
  color: var(--badge-positive-text);
}
.ui-badge-warning {
  border-color: var(--badge-warning-edge);
  background: var(--badge-warning-bg);
  color: var(--badge-warning-text);
}
.ui-badge-critical {
  border-color: var(--badge-critical-edge);
  background: var(--badge-critical-bg);
  color: var(--badge-critical-text);
}

/* ---- Messages and empty states ---- */
.ui-message {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-5) var(--space-7);
  border-left: var(--line-thick) solid var(--color-action);
  background: var(--color-action-soft);
  color: var(--color-text);
  font-size: var(--text-sm);
}
.ui-message p {
  margin: 0;
}
/* The variant with content (more, table): a table in the box under its text, on the box's own surface, with air above */
.ui-message-table {
  margin-top: var(--space-4);
  min-width: 0;
}
.ui-message-table .ui-table {
  width: auto;
  max-width: 100%;
  background: transparent;
}
/* The ways on from the box (ways, 1g.8d.1, K95 b): what to do, then one row per calendar, its label and the link variant
   of the button in the small size. A row is as high as the link (--control-min: 36 px with a mouse, the tap target with
   touch), with or without a link, and the rows stand one under the other at every width. The link breaks whole to the
   line under its label when they do not fit (the button does not wrap), and its padding is taken back so that its text
   stands in line with the box's text. */
.ui-message .ui-message-ways {
  display: grid;
  margin-top: var(--space-4);
  min-width: 0;
}
.ui-message-way {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-4);
  min-height: var(--control-min);
}
.ui-message-way .ui-button {
  min-height: var(--control-min);
  margin-left: calc(-1 * var(--space-5));
}
.ui-message-positive {
  border-color: var(--color-positive);
  background: var(--color-positive-soft);
}
.ui-message-warning {
  border-color: var(--color-warning);
  background: var(--color-warning-soft);
}
.ui-message-critical {
  border-color: var(--color-error);
  background: var(--color-error-soft);
}
/* The variant beside a field or an upload (inline, T2.98, Björn 7/11 om K23): a symbol for the tone and the text in
   the tone's colour on its soft surface, with a line per file. Never the plain black text for an error. */
.ui-message-inline {
  flex-direction: row;
  align-items: flex-start;
  gap: var(--message-inline-gap);
  padding: var(--message-inline-pad);
  border: var(--message-inline-border-width) solid var(--message-inline-info-border);
  border-radius: var(--message-inline-radius);
  font-weight: var(--weight-medium);
}
.ui-message-inline[hidden] {
  display: none;
}
.ui-message-inline.ui-message-critical {
  color: var(--message-inline-critical-text);
  background: var(--message-inline-critical-surface);
  border-color: var(--message-inline-critical-border);
}
.ui-message-inline.ui-message-warning {
  color: var(--message-inline-warning-text);
  background: var(--message-inline-warning-surface);
  border-color: var(--message-inline-warning-border);
}
.ui-message-inline.ui-message-positive {
  color: var(--message-inline-positive-text);
  background: var(--message-inline-positive-surface);
  border-color: var(--message-inline-positive-border);
}
.ui-message-inline.ui-message-info {
  color: var(--message-inline-info-text);
  background: var(--message-inline-info-surface);
  border-color: var(--message-inline-info-border);
}
.ui-message-icon {
  flex: none;
  width: var(--message-inline-icon);
  height: var(--message-inline-icon);
  margin-top: var(--space-1);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--icon-line);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ui-message-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}
.ui-message-title {
  font-weight: var(--weight-heading);
}
.ui-message-lines {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-wrap: break-word; /* a line starts with a file's name, which breaks at a space and after _ (name_breaks) */
}
.ui-message-lines:empty {
  display: none;
}

/* ---- Files: the file card and the upload (T2.98, Björn 7/11 om K23) ---- */
/* A file is a card of its own, never in a link's style: the type icon or the thumbnail, the name as plain text that
   breaks but is never cut, the size, the day and who, the statuses as badges and the built in ×. The whole card opens
   the file (the name's link covers it), and the × lies above it. */
.ui-file-cards {
  container: file-cards / inline-size; /* the card's layout from the list's own width, never the device (K82 d) */
  display: flex;
  flex-direction: column;
  gap: var(--file-card-list-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.ui-file-cards-grid {
  display: grid;
  /* at least two side by side, also in a phone at 390 (1c.3a.3, K97, the pilot session 15/11) */
  grid-template-columns: repeat(auto-fill, minmax(min(calc((100% - var(--file-card-gap)) / 2), var(--file-card-grid-min)), 1fr));
  gap: var(--file-card-gap);
}
.ui-file-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--file-card-gap);
  min-width: 0;
  min-height: var(--target-min);
  padding: var(--file-card-pad);
  background: var(--file-card-surface);
  border: var(--line-thin) solid var(--file-card-border);
  border-radius: var(--file-card-radius);
  font-size: var(--text-sm);
}
.ui-file-card:has(.ui-file-card-open:hover) {
  border-color: var(--file-card-hover-border);
}
.ui-file-card:has(.ui-file-card-open:focus-visible) {
  outline: var(--line-medium) solid var(--color-focus);
  outline-offset: var(--line-medium);
}
.ui-file-card:not(.ui-file-card-grid) .ui-file-card-face {
  width: auto;
  height: auto;
  background: none;
}
.ui-file-card-face {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--file-card-face);
  height: var(--file-card-face);
  border-radius: var(--file-card-radius);
  background: var(--file-card-face-surface);
  color: var(--file-card-icon-color);
}
.ui-file-icon {
  width: var(--file-card-icon);
  height: var(--file-card-icon);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--icon-line);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ui-file-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}
/* The link holds the name and the facts under it, and Öppna (Visa for a picture) at the right, so that it shows how the
   file opens (G1 Bör 4); at least a tap target high, and its ::after covers the card. */
.ui-file-card-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name go" "meta go";
  align-content: center;
  align-items: center;
  gap: var(--space-1) var(--space-4);
  min-height: var(--target-min);
  color: var(--file-card-name);
  text-decoration: none;
}
/* The name breaks only at a space and after _ (name_breaks puts a <wbr> there, Björn 7/11), never between the last
   word and the ending (T2.106), and is never cut; a part longer than the whole line is the only one broken inside. */
.ui-file-card-name {
  grid-area: name;
  font-weight: var(--weight-medium);
  overflow-wrap: break-word;
}
.ui-file-card-go {
  grid-area: go;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--file-card-go-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}
.ui-file-card-go svg {
  width: var(--file-card-go-icon);
  height: var(--file-card-go-icon);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--icon-line);
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* In a list narrower than 600 px, as on a phone, the card's lines stand under each other, and the mark stands at the
   top of the card with the name, never in the middle of the lines (K82 d); the surface decides, not the device */
@container file-cards (max-width: 599px) {
  .ui-file-card:not(.ui-file-card-dense, .ui-file-card-grid) {
    align-items: start;
  }
}
/* On a phone the name has the whole width, and Öppna stands under the facts */
@media (max-width: 599px) {
  .ui-file-card-open {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "name" "meta" "go";
  }
}
.ui-file-card-open:hover .ui-file-card-go {
  text-decoration: underline;
  text-underline-offset: var(--file-card-go-under);
}
.ui-file-card-open::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--file-card-radius);
}
.ui-file-card-open:focus-visible {
  outline: none;
}
.ui-file-card-meta,
.ui-file-card-status {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  margin: 0;
}
/* The facts as patterns, never running text with dots between them (T2.106, K82 a): the size, the stamp and the
   state side by side; a stamp that does not fit goes whole to the next line at the name's left edge and never breaks
   inside (K82 d, fråga 5). */
.ui-file-card-meta {
  grid-area: meta;
  align-items: center;
  column-gap: var(--file-card-meta-gap);
  color: var(--file-card-meta);
  font-size: var(--text-xs);
}
.ui-file-card-stamp {
  display: inline-flex;
  max-width: 100%;
}
.ui-file-card-stamp .ui-source-stamp-by {
  margin: 0;
  padding: 0;
  border: 0;
}
/* A button in the card's body, as a diary photo's Försök igen (static/diary/photos.js, 1g.12b): above the cover of the
   name, as the × is, so that it takes the tap. */
.ui-file-card-body > .ui-button {
  position: relative;
  z-index: 1;
  align-self: flex-start; /* as wide as its words, never across the card (Knappar efter sammanhang) */
}
.ui-file-card-remove {
  position: relative; /* above the link that covers the card */
  z-index: 1;
  display: flex;
  align-self: flex-start;
}
.ui-file-card-x {
  display: grid;
  place-items: center;
  width: var(--target-min);
  height: var(--target-min);
  padding: 0;
  border: 0;
  border-radius: var(--file-card-radius);
  background: transparent;
  color: var(--file-card-x-text);
  cursor: pointer;
}
.ui-file-card-x svg {
  width: var(--icon);
  height: var(--icon);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--icon-line);
  stroke-linecap: round;
}
.ui-file-card-x:hover,
.ui-file-card-x:focus-visible {
  color: var(--file-card-x-hover);
  background: var(--file-card-face-surface);
}
/* The grid: the thumbnail over the text. */
.ui-file-card-grid {
  flex-direction: column;
  align-items: stretch;
  padding: var(--space-3);
}
.ui-file-card-grid .ui-file-card-face {
  width: 100%;
  height: auto;
  aspect-ratio: var(--file-card-thumb-ratio);
  overflow: hidden;
}
.ui-file-card-grid .ui-file-card-face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ui-file-card-grid .ui-file-type {
  width: auto;
  height: auto;
  background: none;
}
.ui-file-card-grid .ui-file-type-ending {
  display: none;
}
.ui-file-card-grid .ui-file-icon {
  width: var(--file-card-icon-large);
  height: var(--file-card-icon-large);
}
/* The × stands beside the name, under the picture, so that it is the symbol alone and never a box over a photo (K83):
   in the text's cell at its top right, with the name kept clear of it, so that the facts under the name have the card's
   whole width and a time is never cut, and Öppna stands under the facts, as on a phone (1c.3a.3). */
.ui-file-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
}
.ui-file-card-grid .ui-file-card-body,
.ui-file-card-grid .ui-file-card-remove {
  grid-row: 2;
  grid-column: 1;
}
.ui-file-card-grid .ui-file-card-remove {
  justify-self: end;
  align-self: start;
  margin-block-start: var(--file-card-remove-lift);
}
.ui-file-card-grid .ui-file-card-open {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "name" "meta" "go";
}
.ui-file-card-grid:has(.ui-file-card-remove) .ui-file-card-name {
  padding-inline-end: var(--target-min);
}
/* The dense grid (1g.12b, K31, pilotsessionen 11/11): small tiles side by side, the picture over its state; the name,
   the facts and Visa are read by a screen reader but not drawn, and the link's cover still opens the file. */
.ui-file-cards-tiles {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--file-card-tile-min)), 1fr));
  gap: var(--file-card-tile-gap);
}
.ui-file-cards-tiles .ui-file-card-grid {
  gap: var(--file-card-tile-gap);
  padding: var(--file-card-tile-pad);
}
.ui-file-cards-tiles .ui-file-card-open {
  min-height: 0;
}
.ui-file-cards-tiles .ui-file-card-open > * {
  position: absolute;
  width: var(--line-thin);
  height: var(--line-thin);
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.ui-file-cards-tiles .ui-file-card-grid .ui-file-card-remove {
  position: absolute; /* in the picture's corner, out of the grid card's rows (1c.3a.3) */
  grid-area: auto; /* placed in row 2 its box would be that row, not the card's padding box */
  top: 0;
  right: 0;
  margin-block-start: 0;
}
/* The × in a tile (K31): a small round mark in the picture's corner, the 44 px target around it. */
.ui-file-cards-tiles .ui-file-card-grid .ui-file-card-x {
  place-items: start end;
  padding: var(--file-card-tile-pad);
  border: 0;
  background: transparent;
}
.ui-file-cards-tiles .ui-file-card-x svg {
  box-sizing: border-box;
  width: var(--file-card-tile-x);
  height: var(--file-card-tile-x);
  padding: var(--space-2);
  border-radius: var(--radius-round);
  background: var(--file-card-tile-x-bg);
  color: var(--file-card-tile-x-text);
}
.ui-file-cards-tiles .ui-file-card-x:hover svg,
.ui-file-cards-tiles .ui-file-card-x:focus-visible svg {
  background: var(--file-card-x-hover);
  color: var(--file-card-tile-x-hover-text);
}
.ui-file-cards-tiles .ui-file-card-x:hover,
.ui-file-cards-tiles .ui-file-card-x:focus-visible {
  background: transparent;
}
/* The state under a tile is small (K31) and the file's own (K82, never a badge). */
.ui-file-cards-tiles .ui-file-state {
  font-size: var(--file-card-tile-state-size);
}
/* The dashed tile after the photos that adds more (K31): as high as a picture, a + in the action's colour. */
.ui-file-card-add {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: var(--target-min);
  aspect-ratio: var(--file-card-thumb-ratio);
  padding: 0;
  border: var(--line-thin) dashed var(--file-card-add-border);
  border-radius: var(--file-card-radius);
  background: transparent;
  color: var(--file-card-add-text);
  font-size: var(--file-card-add-size);
  cursor: pointer;
}
.ui-file-card-add:hover,
.ui-file-card-add:focus-visible {
  background: var(--file-card-face-surface);
}
/* The upload: the secondary button, and with a mouse the dashed box to drop files on, with its words; the hint under it
   in the help pattern, the upload list and the errors in the inline message. */
.ui-file-drop {
  /* the container of the upload's list: a container query cannot style the container itself, so the list's grid of
     shared columns (subgrid) asks the whole upload for its width */
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}
.ui-file-drop-zone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  padding: var(--file-drop-pad);
  border: var(--line-thin) dashed var(--file-drop-border);
  border-radius: var(--file-drop-radius);
}
.ui-file-drop-zone.is-over {
  border-color: var(--file-drop-over-border);
  background: var(--file-drop-over-surface);
}
.ui-file-drop-or {
  color: var(--color-text-2);
  font-size: var(--text-sm);
}
/* The file input stays in the page, so that every phone opens it from the button. */
.ui-file-drop-input {
  position: absolute;
  width: var(--line-thin);
  height: var(--line-thin);
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.ui-file-drop-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ui-file-drop-list[hidden] {
  display: none;
}
.ui-file-drop-list:not([hidden]) ~ .ui-message-inline {
  margin-top: var(--file-drop-list-after);
}
/* A row of the upload list (T2.106, K82 b): the type's small mark, the name, the size, the state with Försök igen and
   the cross, in the same columns in every row, so that the names, the sizes and the states line up; Försök igen always
   stands in the file's row and never by the error box under the list (G1 Bör 5). On a phone the state goes under the
   name and the progress takes the row's width (K82 d). */
.ui-file-drop-item {
  display: grid;
  grid-template-columns: var(--file-drop-mark-col) minmax(0, 1fr) auto var(--target-min);
  grid-template-areas: "mark name size x" ". state state x";
  align-items: center;
  column-gap: var(--space-5);
  row-gap: var(--space-1);
  min-height: var(--control-min-fine);
  padding-block: var(--file-drop-item-pad);
  font-size: var(--text-sm);
}
.ui-file-drop-item > .ui-file-type {
  grid-area: mark;
}
.ui-file-drop-size {
  grid-area: size;
}
.ui-file-drop-state {
  grid-area: state;
}
.ui-file-drop-x {
  grid-area: x;
}
/* A list wide enough has the columns of K82 b, shared by every row (subgrid) */
@container (min-width: 600px) {
  .ui-file-drop-list:not([hidden]) {
    display: grid;
    grid-template-columns: var(--file-drop-mark-col) minmax(0, 1fr) auto minmax(var(--file-drop-state-min), auto) var(--target-min);
    column-gap: var(--space-6);
  }
  .ui-file-drop-item {
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    grid-template-areas: "mark name size state x";
  }
}
.ui-file-drop-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
  min-width: 0;
}
.ui-file-drop-x {
  display: grid;
  place-items: center;
  align-self: start; /* at the top of the row, also when the state goes under the name (K82 d) */
  width: var(--target-min);
  height: var(--control-min-fine);
  padding: 0;
  border: 0;
  border-radius: var(--file-card-radius);
  background: transparent;
  color: var(--file-card-x-text);
  cursor: pointer;
}
/* Uppladdad and Kontrolleras have no cross (K82 b): the row's state hides it, out of the tab order too, and its column
   stays, so that the states line up */
.ui-file-drop-item:is([data-state="done"], [data-state="checking"]) .ui-file-drop-x {
  visibility: hidden;
}
.ui-file-drop-x svg {
  width: var(--icon);
  height: var(--icon);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--icon-line);
  stroke-linecap: round;
}
.ui-file-drop-x:hover,
.ui-file-drop-x:focus-visible {
  color: var(--file-card-x-hover);
  background: var(--file-card-face-surface);
}

.ui-file-drop-item + .ui-file-drop-item {
  border-top: var(--line-thin) solid var(--file-drop-item-divider);
}
.ui-file-drop-name {
  grid-area: name;
  min-width: 0;
  overflow-wrap: break-word;
}
.ui-file-drop-size {
  text-align: right;
}
/* The file's size: muted metadata without a frame, the figures in even width, and the number and the unit never
   part (T2.106, K82 e). */
.ui-file-size {
  color: var(--file-size-color);
  font-size: var(--file-size-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* The type mark (T2.106, K82 a): the type's shape and the name's ending in the same neutral box for every type, and
   small, the shape alone, in a row or a list. The type is never said by colour. */
.ui-file-type {
  flex: none;
  display: inline-grid;
  justify-items: center;
  align-content: center;
  gap: var(--space-1);
  width: var(--file-type-box);
  height: var(--file-type-box);
  border-radius: var(--file-card-radius);
  background: var(--file-type-surface);
  color: var(--file-type-color);
}
.ui-file-type .ui-file-icon {
  width: var(--file-type-icon);
  height: var(--file-type-icon);
}
.ui-file-type-ending {
  font-size: var(--file-type-ending-size);
  font-weight: var(--file-type-ending-weight);
  line-height: 1;
  letter-spacing: var(--file-type-ending-tracking);
}
.ui-file-type-small {
  width: var(--file-type-small);
  height: var(--file-type-small);
  background: none;
}
.ui-file-type-small .ui-file-icon {
  width: var(--file-type-small);
  height: var(--file-type-small);
}
/* The file's state (T2.106, K82 b and e): never a badge. Väntar and Kontrolleras neutral with the clock and the
   hourglass, Uppladdad the check of yes and no, Misslyckades the cross with the cause in the row. */
.ui-file-state {
  display: inline-flex;
  align-items: center;
  gap: var(--file-state-gap);
  min-width: 0;
  color: var(--file-state-text);
}
.ui-file-state-icon {
  flex: none;
  width: var(--file-state-icon);
  height: var(--file-state-icon);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--icon-line);
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--file-state-icon-quiet);
}
.ui-file-state .ui-yes-no {
  white-space: normal;
}
.ui-file-state .ui-yes-no > span {
  white-space: normal;
}
.ui-file-state-failed-word {
  color: var(--file-state-failed);
  font-weight: var(--weight-strong);
}
.ui-file-state-sending {
  flex: 1;
}
/* The progress bar (T2.106, K82 b): a 6 px track with the fill to the share and the share as text beside it;
   role progressbar. Without a known share the track is empty and the text says only the word (fråga 13). */
.ui-progress {
  display: inline-flex;
  align-items: center;
  gap: var(--progress-gap);
  width: 100%;
  min-width: min(100%, var(--progress-min));
}
.ui-progress-track {
  flex: 1;
  height: var(--progress-track-height);
  overflow: hidden;
  border-radius: var(--progress-radius);
  background: var(--progress-track);
}
.ui-progress-fill {
  display: block;
  width: var(--progress-share, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--progress-fill);
}
.ui-progress-text {
  color: var(--progress-text);
  font-size: var(--progress-text-size);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* The dense file list (T2.106, K82 c, fråga 16): the small mark before the name, the size right aligned in its own
   column and the stamp in its own when the list is 600 px wide or more, as a full width list is from 820 px; in a
   narrower list the stamp is not in the row (as the table's Ändrad). */
.ui-file-cards-dense {
  container-type: inline-size;
  gap: 0;
}
.ui-file-card-dense {
  min-height: var(--file-list-row-min);
  padding-block: var(--file-list-row-pad);
  border-width: 0 0 var(--line-thin);
  border-radius: 0;
}
.ui-file-card-dense .ui-file-card-open {
  min-height: var(--file-list-row-min);
}
.ui-file-card-dense .ui-file-card-x {
  height: var(--file-list-row-min);
}
.ui-file-card-dense .ui-file-card-remove {
  align-self: center;
}
/* The heading row (K82 c): Namn over the mark and the name, Storlek over the size and Uppladdad over the stamp, in the
   cards' own columns, since it is drawn as a card whose Öppna and cross are hidden; plain writing in grey (T2.122). */
.ui-file-card-head {
  min-height: var(--file-list-head-min);
  border-bottom-color: var(--file-list-head-divider);
  color: var(--file-list-head-text);
}
.ui-file-card-head:has(.ui-file-card-open:hover) {
  border-color: var(--file-list-head-divider); /* the head is no target: no hover */
}
.ui-file-card-head .ui-file-card-open {
  min-height: var(--file-list-head-min);
  color: inherit;
}
/* the size on the words only: the columns are in em of the row's own size, as the cards' */
.ui-file-card-head :is(.ui-file-card-name, .ui-file-size, .ui-file-card-stamp) {
  color: inherit;
  font-size: var(--file-list-head-size);
  font-weight: var(--file-list-head-weight);
}
.ui-file-card-head :is(.ui-file-card-go, .ui-file-card-x) {
  visibility: hidden;
}
.ui-file-card-head .ui-file-card-x {
  height: auto;
}
.ui-file-card-dense .ui-file-card-open {
  grid-template-columns: minmax(0, 1fr) var(--file-list-size-col) auto;
  grid-template-areas: "name meta go";
}
.ui-file-card-dense .ui-file-card-meta {
  display: contents;
}
.ui-file-card-dense .ui-file-size {
  grid-column: 2;
  text-align: right;
}
/* The state (Kontrolleras, Misslyckades) has a place of its own: the row under the name, over the whole width. The
   second row exists only for a file that has a state (G1 Kan 2). */
.ui-file-card-dense .ui-file-state {
  grid-column: 1 / -1;
  grid-row: 2;
}
.ui-file-card-dense .ui-file-card-stamp {
  display: none;
}
@container (min-width: 600px) {
  .ui-file-card-dense .ui-file-card-open {
    grid-template-columns: minmax(0, 1fr) var(--file-list-size-col) minmax(0, var(--file-list-stamp-col)) auto;
    grid-template-areas: "name size stamp go";
  }
  .ui-file-card-dense .ui-file-card-stamp {
    display: inline-flex;
    grid-column: 3;
  }
}
/* Ta foto (1c.3a.3, K97 question 2): the camera's button beside Lägg till bilaga, only with touch, where a camera is. */
.ui-file-drop-camera {
  display: none;
}
/* The short hint with the info button (i) after it (components/info_button.html). */
.ui-file-drop-brief {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
/* The info button (i), components/info_button.html: its text opens as the tap tip (T2.100) on a tap, on the keyboard's
focus and on hover, never only on hover; one place for every info button until K113 decides its form. */
.ui-info-button {
  display: inline-grid;
  place-items: center;
  width: var(--info-button);
  height: var(--info-button);
  padding: 0;
  border: 0;
  border-radius: var(--radius-round);
  background: transparent;
  color: var(--info-button-text);
  cursor: pointer;
}
.ui-info-button svg {
  width: var(--icon);
  height: var(--icon);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--icon-line);
  stroke-linecap: round;
}
.ui-info-button:hover,
.ui-info-button:focus-visible {
  color: var(--info-button-hover);
}
@media (pointer: coarse), (any-pointer: coarse) {
  .ui-file-drop-zone {
    padding: 0;
    border: 0;
  }
  .ui-file-drop-camera {
    display: inline-flex;
  }
  .ui-info-button {
    width: var(--target-min);
    height: var(--target-min);
  }
  .ui-file-drop-or {
    display: none;
  }
  .ui-file-drop-item {
    min-height: var(--target-min);
  }
  .ui-file-drop-x {
    height: var(--target-min);
  }
  .ui-file-card-dense:not(.ui-file-card-head),
  .ui-file-card-dense:not(.ui-file-card-head) :is(.ui-file-card-open, .ui-file-card-x) {
    min-height: var(--target-min);
  }
  .ui-file-card-dense:not(.ui-file-card-head) .ui-file-card-x {
    height: var(--target-min);
  }
  .ui-file-drop-retry .ui-button {
    min-height: var(--target-min);
  }
}
@media print {
  .ui-file-card-remove,
  .ui-file-drop {
    display: none;
  }
}
.ui-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-11) var(--space-7);
  text-align: center;
  border: var(--line-thin) dashed var(--color-border);
  color: var(--color-text-2);
}
.ui-empty p {
  margin: 0;
}

/* Where touch does not suit, for example exact measuring in a drawing or a very wide table, the view says so briefly
   (granskningslistan, Björn 10/10). Shown only on a touch screen, whose primary pointer is coarse; preview shows it on
   every screen, for the catalogue and the export only. */
.ui-touch-note {
  display: none;
  margin: 0;
  padding: var(--space-3) var(--space-6);
  border-left: var(--line-thick) solid var(--color-border);
  background: var(--color-surface-2);
  font-size: var(--text-sm);
  color: var(--color-text-2);
}
.ui-touch-note-preview {
  display: block;
}
@media (pointer: coarse) {
  .ui-touch-note {
    display: block;
  }
}

/* A rating (rating, T2.160, K103 v5, D-MARK-17): the figure with one decimal and one step per level of the scale, filled
   up to the rating, the last to a quarter, a half or three quarters; under the limit the figure bold and red and the
   steps red, so the sign is the figure and the form. The same in a cell and in the box beside it. */
.ui-rating {
  display: inline-flex;
  align-items: center;
  gap: var(--rating-gap);
  white-space: nowrap;
  line-height: var(--leading-tight);
}
.ui-rating-number {
  font-variant-numeric: tabular-nums;
  color: var(--rating-number);
}
.ui-rating-none {
  color: var(--rating-none);
}
.ui-rating-steps {
  display: inline-flex;
  gap: var(--rating-step-gap);
}
.ui-rating-step {
  display: block;
  width: var(--rating-step);
  height: var(--rating-step-height);
  border-radius: var(--rating-step-radius);
  background: var(--rating-track);
}
.ui-rating-step-on {
  background: var(--rating-fill);
}
.ui-rating-step-p25 {
  background: linear-gradient(to right, var(--rating-fill) 25%, var(--rating-track) 25%);
}
.ui-rating-step-p50 {
  background: linear-gradient(to right, var(--rating-fill) 50%, var(--rating-track) 50%);
}
.ui-rating-step-p75 {
  background: linear-gradient(to right, var(--rating-fill) 75%, var(--rating-track) 75%);
}
.ui-rating-low {
  --rating-fill: var(--rating-low);
}
.ui-rating-low .ui-rating-number {
  color: var(--rating-low);
  font-weight: var(--rating-low-weight);
}
/* The day value (day_value, T2.160, D-MARK-18; K93 B, 1c.3.0a): the days as a figure, past the day in a red mark and
   within the customer's limit for soon in a yellow one, as a badge looks but its own (--day-value-*), apart from the
   signal chip; later days only the figure. The minus is in the figure, so the colour is never the only sign. */
.ui-day-value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ui-day-value-late,
.ui-day-value-soon {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) var(--space-5);
  border: var(--line-badge) solid;
  border-radius: var(--radius-sm);
  font-size: var(--day-value-mark-size);
  vertical-align: middle;
}
.ui-day-value-late::before,
.ui-day-value-soon::before {
  content: "";
  flex: none;
  width: var(--dot);
  height: var(--dot);
  border-radius: var(--radius-round);
  background: currentColor;
}
.ui-day-value-late {
  border-color: var(--day-value-late-edge);
  background: var(--day-value-late-bg);
  color: var(--day-value-late);
  font-weight: var(--day-value-late-weight);
}
.ui-day-value-soon {
  border-color: var(--day-value-soon-edge);
  background: var(--day-value-soon-bg);
  color: var(--day-value-soon);
  font-weight: var(--day-value-soon-weight);
}

/* Yes and no as a pattern (yes_no, T2.102, Björn's rule 5 of K39): the symbol, in a ring as the sketch's (K45), says the
   state and the text is short; an unknown is an empty ring with the word "okänt" after the name; the state is also said
   to a screen reader. With touch a link is tapped on at least --target-min, a hit area that may be
   larger than the symbol and the text (the ::after), and only with a coarse pointer. */
.ui-yes-no {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--yes-no-gap);
  white-space: nowrap;
  color: var(--yes-no-text);
}
.ui-yes-no-symbol {
  flex: none;
  width: var(--yes-no-icon);
  height: var(--yes-no-icon);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--icon-line);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ui-yes-no-yes .ui-yes-no-symbol {
  color: var(--yes-no-yes);
}
.ui-yes-no-no .ui-yes-no-symbol {
  color: var(--yes-no-no);
}
.ui-yes-no-bad .ui-yes-no-symbol {
  color: var(--yes-no-bad);
}
.ui-yes-no-unknown .ui-yes-no-symbol {
  color: var(--yes-no-unknown);
}
.ui-yes-no-unknown-text {
  color: var(--yes-no-unknown-text);
  font-size: var(--yes-no-unknown-text-size);
}
a.ui-yes-no {
  color: var(--color-link);
}
.ui-yes-no-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--yes-no-row-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
/* With touch, and on a computer that also has a touch screen (any-pointer: coarse, as every tap target since #499). A row
   that wraps gives each of its items the height of a tap target, with the link in its middle, so that the centres of two
   links on rows under each other are --target-min apart and their tap areas (the ::after) meet and never overlap
   (G1 of #862, Bör 3). The area is also at least --target-min wide, centred on the link: a link with no label says only
   "Ja" and is about 36 px wide (rättningsrunda DY, Kan 1). */
@media (pointer: coarse), (any-pointer: coarse) {
  a.ui-yes-no::after {
    content: "";
    position: absolute;
    inset-block: calc((100% - var(--target-min)) / 2);
    left: 50%;
    width: 100%;
    min-width: var(--target-min);
    min-height: var(--target-min);
    transform: translateX(-50%);
  }
  .ui-yes-no-row {
    row-gap: var(--yes-no-row-gap-touch);
  }
  .ui-yes-no-row > * {
    display: flex;
    align-items: center;
    min-height: var(--yes-no-row-item-touch);
  }
}

/* A job's state and a done step (T2.107, K81): the hourglass of a job that waits or runs (yes_no with wait), a step whose
   label is the state itself (step), with the word of a failed one in the error colour, and a removed one as quiet text
   (job_state). The state's line (ui-job-line) holds the state and what goes with it, such as Hämta PDF and the period, and
   wraps between its parts, never inside the state. A job's row (ui-job-row) has a thin line above it, also the first (K81:
   the line under the button that starts the job), and has the state in a column of its own from
   --bp-mobile, so that the facts and the buttons of the rows line up; on a phone they stand under each other. */
.ui-yes-no-wait .ui-yes-no-symbol {
  color: var(--yes-no-wait);
}
.ui-yes-no-wait {
  color: var(--yes-no-wait-text);
}
.ui-yes-no-step.ui-yes-no-bad > .ui-yes-no-state {
  color: var(--yes-no-bad-text);
}
.ui-job-state {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.ui-job-state-reason {
  margin-inline-start: var(--yes-no-gap);
}
.ui-job-state-removed {
  color: var(--job-state-removed);
}
.ui-job-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--job-line-gap);
  margin: 0;
}
.ui-job-line[hidden] {
  display: none;
}
.ui-job-row {
  display: grid;
  gap: var(--job-row-gap);
  align-items: center;
  min-width: 0;
}
.ui-job-row > * {
  margin: 0;
  min-width: 0;
}
.ui-job-row {
  padding-top: var(--job-row-gap-between);
  border-top: var(--line-thin) solid var(--job-row-rule);
}
:not(.ui-job-row) + .ui-job-row {
  margin-top: var(--job-row-gap-between);
}
@media (min-width: 600px) {
  .ui-job-row {
    grid-template-columns: var(--job-row-state) minmax(0, 1fr);
  }
  .ui-job-row > :nth-child(n + 3) {
    grid-column: 2;
  }
}

/* ---- Hover ---- */
/* Hover only adds emphasis where there is a mouse; nothing is reached only by hovering (granskningslistan). On a touch
   screen a hover state stays after the tap, so it is left out there. */
@media (hover: hover) {
  .ui-button:hover {
    filter: brightness(1.06);
  }
  .ui-button-create:hover {
    background: var(--button-create-hover-bg);
    filter: none;
  }
  /* A create button that waits (T2.143) keeps its dimmed surface under the mouse: this rule beats the one above, which
     would give it the hover surface whole. */
  .ui-button-create[aria-disabled="true"]:hover {
    background: color-mix(in srgb, var(--button-create-hover-bg) var(--button-wait-share), transparent);
  }
  .ui-button:disabled:hover,
  .ui-button[aria-disabled="true"]:hover {
    filter: none;
  }
  .ui-button-quiet:not(:disabled, [aria-disabled="true"]):hover {
    color: var(--color-error);
    filter: none;
  }
  .ui-band-menu a:hover {
    color: var(--color-band-text);
  }
  .ui-table tbody tr:hover td {
    background: var(--color-surface-2);
  }
}

/* ---- Dialog ---- */
.ui-dialog {
  width: min(90vw, var(--dialog-max));
  padding: 0;
  border: var(--line-thin) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-overlay);
}
/* On a phone a dialog that is not modal, the catalogue's open one, stands in its post, which is narrower than 90vw (286 px of 324 at 360 px): it never
   reaches past it, and so the page does not slide sideways (T2.114.1). From 600 px it reaches past, inside the window. */
@media (max-width: 599px) {
  .ui-dialog:not(:modal) {
    max-width: 100%;
  }
}
.ui-dialog::backdrop {
  background: var(--color-overlay);
}
.ui-dialog-body {
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap);
}
.ui-dialog-body p {
  margin: 0;
}
.ui-dialog .ui-actions {
  justify-content: flex-end;
}
/* The dialog with a form (1g.11f.1, K96 v7: the box Ny typ för projektet): as high as the visible screen at most, and
   the form rolls inside it, so that its buttons are always reached. A grid of boxes in it has two columns on a phone
   and three from 600 px, whatever the window's width, since the dialog is never wider than --dialog-max. */
.ui-dialog-form .ui-dialog-body {
  max-height: var(--dialog-frame-max);
  box-sizing: border-box;
  overflow: auto;
  overscroll-behavior: contain;
}
.ui-dialog-form .ui-check-grid-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 600px) {
  .ui-dialog-form .ui-check-grid-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
/* The detail dialog (1b.3): what an amount is made of, wide enough for its list, and as high as the screen at most.
   One surface scrolls, the list (.ui-detail-scroll, T2.87): the frame never scrolls itself (overflow hidden), the body
   and the content only hand the height on (min-height 0), and the heading, the lead and Stäng stay where they are. The
   list's header row stays at the top of that surface. On a phone it takes the width less the gutter. */
.ui-dialog-detail {
  width: min(calc(100vw - 2 * var(--space-7)), var(--dialog-wide-max));
  max-width: none;
  max-height: var(--dialog-frame-max);
  overflow: hidden;
}
.ui-dialog-detail[open] {
  display: flex;
  flex-direction: column;
}
.ui-dialog-detail .ui-dialog-body {
  flex: 0 1 auto;
  min-height: 0;
  box-sizing: border-box;
  padding-bottom: 0;
}
.ui-dialog-detail .ui-dialog-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
}
/* On the page of its own (page=True) the surface is no box: the message, the list and the note are the page's own
   children with the page's gap, as before T2.87. */
.ui-detail-scroll {
  display: contents;
}
.ui-dialog-detail .ui-detail-scroll {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  flex: 0 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain; /* a finger at the end of the list does not scroll the view behind */
  -webkit-overflow-scrolling: touch;
}
.ui-dialog-detail .ui-detail-scroll > * {
  flex: none; /* the list is as high as its rows, and the surface scrolls it; it is never squeezed */
}
.ui-dialog-detail .ui-dialog-body > .ui-actions {
  padding: var(--space-6) 0 var(--space-8);
  background: var(--color-surface);
}
/* The list's header row stays at the top of the scrolling surface, not under the tabs (--sticky-top). */
.ui-dialog-detail .ui-table th {
  top: 0;
}
.ui-detail-title {
  margin: 0;
}
.ui-detail-title:focus {
  outline: none;
}
.ui-detail-lead {
  color: var(--color-text-2);
}
@media (max-width: 599px) {
  .ui-dialog-detail .ui-dialog-body {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

/* ---- Tables ---- */
/* The header row follows when scrolling (sticky), so the table is never inside a box that scrolls, except a table with
   many columns between a phone and a computer (fixed, below), whose box scrolls sideways only.
   Headers may wrap, amounts and dates may not. */
.ui-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-md);
  background: var(--color-surface);
  border: var(--line-thin) solid var(--color-border); /* marin: a frame around the table, as the cards have */
}
.ui-table caption {
  text-align: left;
  font-family: var(--font-display);
  font-weight: var(--weight-heading);
  font-size: var(--text-xl);
  padding-bottom: var(--space-5);
}
.ui-table th {
  position: sticky;
  top: var(--sticky-top, 0); /* under the page's own sticky rows when the page measures them (T2.14) */
  z-index: 2;
  background: var(--color-surface);
  text-align: left;
  vertical-align: bottom;
  font-size: var(--text-col-head);
  font-weight: var(--weight-strong);
  letter-spacing: normal; /* plain writing, never capitals (T2.122, Björn 13/11): the heading is at most two lines from 1180 px (docs/design.md) */
  text-transform: none;
  color: var(--color-text-3); /* the grey text of a heading; marin v1 */
  padding: var(--space-4) var(--space-5) var(--space-4) 0;
  border-bottom: var(--line-medium) solid var(--color-border-strong);
}
.ui-table th.ui-num {
  text-align: right;
  white-space: normal;
}
/* A column of kind remove (1g.8b2) has its label only for a screen reader (ui-visually-hidden, out of the flow), and
   the header a line with nothing seen on it, a zero width space, so that the label stands on the bottom line of the
   other headers' text and not under it */
.ui-table th.ui-col-remove::before {
  content: "\200b";
}
/* A row's heading (T2.139, a column with row_head: th scope="row" for a screen reader) is drawn as the row's other cells:
   the header cell's own look (sticky, grey, small, bold, a medium line) is taken off it, and the rules of the cell
   below that are about its place (padding, line, card) have the heading beside them. */
.ui-table td,
.ui-table :where(tbody) th[scope="row"] {
  padding: var(--space-4) var(--space-5) var(--space-4) 0;
  border-bottom: var(--line-thin) solid var(--color-border-soft);
  vertical-align: middle;
}
.ui-table :where(tbody) th[scope="row"] {
  position: static;
  top: auto;
  z-index: auto;
  background: none;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}
.ui-table :where(tbody) th[scope="row"].ui-num {
  white-space: nowrap;
}
.ui-table td:first-child,
.ui-table th:first-child {
  padding-left: var(--space-6);
}
.ui-table td.ui-text-wrap {
  white-space: normal;
  overflow-wrap: break-word;
  hyphens: manual; /* never hyphenated, so a word is never broken in the middle (T2.97) */
}
/* A text column that keeps its words whole (T12.3), such as the reason of a status: a word is broken only at a space, so
   in a table the column is at least as wide as its longest word, and a table that then is wider than the page scrolls
   in its box (scroll="fit") and the page does not. In the cards of a phone there is no column to widen, so a word
   wider than the card breaks there where it must (break-word, in the rule for cards). A date, a time and an amount hold together (the keep_whole filter and ui-date), so that they stand on one line. */
.ui-table td.ui-text-whole {
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}
/* A table with many columns, whose words are kept whole (dense, the ÄTA list, 1c.10): less air between the columns, so that
   the sixteen columns with their least widths fit a page from 1280 px with some room to spare (the fonts of another machine are a few pixels wider), so that the box does not scroll at 1280 px with ordinary data. In the cards
   of a phone the cells are as they are. */
@media (min-width: 600px) {
  .ui-table-dense th,
  .ui-table-dense td {
    padding-right: var(--space-2);
  }
  /* but a figure before a status badge keeps the air of a column, so that it never touches the badge's frame (1c.P
     round 2's rule, kept in the dense ÄTA list of P.0.14) */
  .ui-table-dense td:has(+ td > .ui-badge),
  .ui-table-dense td:has(+ td > * > .ui-badge) {
    padding-right: var(--space-6);
  }
}
/* A left-aligned column straight after a right-aligned one (T2.122 round 2, the pilot session 13/11): a figure or a date
   ends at the cell's right edge and the text after it starts at the next cell's left edge, so that the two are read as one
   row, as "Ersättningskrav Kostnadsbedömning" in the ÄTA list. The left-aligned cell has a least air of --space-3 before it,
   in the header and in the rows, in every table. In the cards of a phone there is no column. A row's heading (th) joins
   through :where, so that the rule weighs what it did with td alone and the sheet's sum rows (tfoot td.ui-num, T2.51c)
   still win over it. */
@media (min-width: 600px) {
  .ui-table th.ui-num + th:not(.ui-num),
  .ui-table :is(td, :where(th[scope="row"])).ui-num + td:not(.ui-num) {
    padding-left: var(--space-3);
  }
}
/* A short text that keeps to one line in a narrow column, such as "Med oss" (1a.4). */
.ui-table td.ui-nowrap {
  white-space: nowrap;
}
/* A link alone in a cell fills the cell's height, so that it is a tap target of --target-min (T2.7): the row then
   opens with a finger also where the text is short. The cell's air moves into the link, so that a name that wraps
   keeps its distance to the lines. A cell with more than one link keeps them as text. */
.ui-table td > a:only-child {
  display: flex;
  align-items: center;
  min-height: var(--target-min);
  min-width: var(--target-min);
  margin: calc(-1 * var(--space-4)) 0;
  padding: var(--space-4) 0;
}
.ui-table td.ui-num > a:only-child {
  justify-content: flex-end;
}
/* The number link (T2.42; the ÄTA list can use the same class, 1c.P): the project number and the ÄTA number are links in
   the link's colour without an underline, which comes at hover and focus. A column that fits its content (fit) is as wide
   as its number, so the number starts at the cell's own air, and the link does not push it right. */
.ui-table a.ui-number-link {
  color: var(--color-link);
  font-weight: var(--number-link-weight);
  text-decoration: none;
}
.ui-table a.ui-number-link:hover,
.ui-table a.ui-number-link:focus-visible {
  text-decoration: underline;
}
/* A code before a cell's text (codes, P.0.17a, K13): the project's or the ÄTA's number in bold, and with a link the code
   and the text are one link, the code in the link's colour and the text in the text's, underlined at hover and focus. */
.ui-table .ui-cell-code {
  font-weight: var(--number-link-weight);
}
.ui-table a.ui-code-link {
  color: var(--color-text);
  text-decoration: none;
}
.ui-table a.ui-code-link .ui-cell-code {
  color: var(--color-link);
}
.ui-table a.ui-code-link:hover,
.ui-table a.ui-code-link:focus-visible {
  text-decoration: underline;
}
/* With touch the code link is a tap target of --target-min, 44 px, the same as a row's identity (.ui-row-id, which is
   --row-control-min since T2.67: 28 px with a mouse and 44 px with touch), so that a tap in the cell's air reaches it,
   the project's and the ÄTA's number alike (G2 of P.0.17a, B1). With a mouse the code link keeps the height of its
   text; only the row's identity and its chevron take the row control's 28 px. */
@media (pointer: coarse), (any-pointer: coarse) {
  .ui-table a.ui-code-link {
    display: inline-flex;
    align-items: center;
    min-height: var(--target-min);
    min-width: var(--target-min);
  }
}
/* Status badges in a text cell, one per status (tags, P.0.17a, K13): side by side, and one under the other in a narrow
   column. */
.ui-table .ui-cell-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.ui-table th.ui-col-fit,
.ui-table td.ui-col-fit {
  width: 1%;
  white-space: nowrap;
}
.ui-table td.ui-col-fit > a:only-child {
  justify-content: flex-start;
}
/* A negative amount in a link is red like the others (1h.6). */
.ui-table td.ui-neg > a,
.ui-table td.ui-better > a {
  color: inherit;
}
/* A text kept on one line and cut with an ellipsis (clip, 1c.P round 3, the prototype's ÄTA list): the notes at
   --col-clip (145 px since round 6) and the title at --col-clip-wide (180 px), with the whole text in the cell's title
   and in the row that folds out (round 7), so that it is never only for the mouse. A fixed column (600-1279 px) is
   narrower, so the text is cut at its width. On a phone's card the text wraps as every text does. */
.ui-table .ui-clip {
  display: block;
  max-width: var(--col-clip);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ui-table .ui-clip-wide {
  max-width: var(--col-clip-wide);
}
/* The table with a shorter title (ui-table-short-title, D-TAB-23, 1c.3.0a): the ÄTA list's title is cut at its own
   --table-short-title-clip, and its fixed Rubrik column (600-1279 px) has its own --table-short-title-fixed, so that the
   list with K93's whole headings fits as before, on two lines; the shared --col-clip-wide and --table-fixed-2 are the other tables'. */
.ui-table-short-title {
  --col-clip-wide: var(--table-short-title-clip);
  --table-fixed-2: var(--table-short-title-fixed);
}
/* and its title breaks over at most --table-short-title-lines lines and is cut with an ellipsis only after the last one
   (never one cut line; a word is never broken, the wrap is the cell's own), the same clamp as the side menu's labels, from 600 px (a phone's card wraps as every text does).
   width: max-content keeps the column's least width at the title's cut width, as when the title stood on one line. */
@media screen and (min-width: 600px) {
  .ui-table-short-title .ui-clip-wide {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--table-short-title-lines);
    white-space: normal;
    width: max-content;
  }
}
/* (a column is fixed only from 600 to 1279 px; from 1280 px the clip's own width holds, round 6) */
@media screen and (min-width: 600px) and (max-width: 1279px) {
  .ui-table td.ui-table-fixed .ui-clip {
    max-width: 100%;
  }
}
/* A text in at most --cell-lines lines (lines, K39 v3: the supplier's note): cut at a word with an ellipsis by
   components.js, never inside a word, with the whole text in the cell's title and in the post that folds out, so that
   it is reached without hovering; without JavaScript the lines are only cut. */
.ui-table .ui-lines {
  display: block;
  max-height: calc(var(--cell-lines) * 1lh);
  overflow: hidden;
}
/* A part of a cell's second line (|cell_parts, K39 v3): an organisation number, a phone number or an e-mail address is
   never broken inside it, the line breaks between the parts, and a part wider than its room is cut with an ellipsis. */
.ui-table .ui-cell-part {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  vertical-align: top;
}
.ui-table .ui-cell-address {
  display: inline;
  white-space: normal;
}
.ui-table .ui-cell-piece {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  vertical-align: top;
}
/* Below iPad landscape the second line under a name, and one with an address, does not widen its column: the column
   is as wide as the rest of its content gives, and a part that does not fit is cut (the page never scrolls sideways). */
@media (max-width: 1179px) {
  .ui-table td.ui-cell-identity > .ui-cell-detail,
  .ui-table .ui-cell-sub:has(> .ui-cell-address) {
    contain: inline-size;
  }
  /* A text in at most --cell-lines lines gives its room to the columns beside it (the pilot session 11/11: the stamp of
     who changed it stays whole and the note is cut): its column is --cell-lines-min wide where the table is short of
     room, and the text is cut at a word with an ellipsis as before. */
  .ui-table .ui-lines {
    contain: inline-size;
    min-width: var(--cell-lines-min);
  }
}
/* The second line of a column kept on one line (nowrap, as the supplier's Kategori) breaks between its parts. */
.ui-table td.ui-nowrap .ui-cell-sub {
  white-space: normal;
}
/* A badge under a name (the identity's tags, such as "Ny · ej i <system>") below iPad landscape: as wide as its words
   where the column has room, and else on two lines between its words, so that it never widens the list beyond the page
   (K39 v3, 820 px: the page never scrolls sideways). A word is never broken. */
@media (max-width: 1179px) {
  .ui-table td.ui-cell-identity .ui-cell-tags .ui-badge {
    width: fit-content;
    overflow-wrap: normal;
  }
}
/* The stamp of who changed it in a cell (an entry's stamp, the source stamp's variant by, Björn 11/11, K39 v3): a box
   that is never broken inside its name or its date (the pilot session 11/11): on one line, symbol, name and date, and
   when the column's width from its content does not hold that, on two lines in the same box, the name on the first and
   the date on the second, never three. The symbol stands on the first line. */
.ui-table .ui-cell-entry > .ui-source-stamp {
  align-items: flex-start;
  white-space: normal;
  text-align: left;
  vertical-align: top;
}
/* An entry's text for a phone's card only (card), such as the stamp's line in place of the date and the name. */
.ui-table .ui-cell-card {
  display: none;
}
/* A value that no longer is watched, in grey, as the prototype's Svar senast of an ÄTA that is not sent (quiet). */
.ui-table td.ui-text-quiet {
  color: var(--color-text-3);
}
/* The items of a row that folds out that only a phone's card needs, since the card leaves their columns out (phone). */
.ui-row-more-phone {
  display: none;
}
/* An amount that is a link (1b.3, ui-amount-link) has the grid's rule (P.0 Prognos, #493): a small arrow before it in
   the link's colour, as the prototype's ▸, the figure in the text's colour (a negative one red) and no underline; the
   link's colour when the pointer is over it or it has the focus. The arrow is seen without hovering, so that it holds
   with a finger on an iPad. The same values as .ui-grid-link, so that the two can become one class (T2.45). A name or
   a number that leads on keeps the link's look. */
.ui-table td > a.ui-amount-link {
  color: inherit;
  text-decoration: none;
}
.ui-table td > a.ui-amount-link::before {
  content: "";
  display: inline-block;
  flex: none;
  margin-right: var(--space-3);
  border-top: var(--space-2) solid transparent;
  border-bottom: var(--space-2) solid transparent;
  border-left: var(--space-3) solid var(--color-link);
}
.ui-table td:not(.ui-neg, .ui-better) > a.ui-amount-link:hover,
.ui-table td:not(.ui-neg, .ui-better) > a.ui-amount-link:focus-visible {
  color: var(--color-link);
}
/* A ledger table (ledger, ui-table-ledger, T2.45 omgång 5), the bookkeeping's tables as the project report and its detail
   list: an amount that opens has no mark at rest, no arrow and no line, as the prototype's rapportTable (its dotted line
   means the source, not a link; the pilot session 1/11), and is underlined when the pointer is over it or it has the
   focus, with the pointer's hand; the focus ring shows with the keyboard. A short figure is still a tap target. The
   arrow stays in cards and lists. With a mouse the rows are as low as the prototype's (--table-row-min-fine); with touch
   they keep the tap target (T2.7, pointer: coarse). */
.ui-table-ledger td > a.ui-amount-link::before {
  content: none;
}
.ui-table-ledger td > a.ui-amount-link {
  min-width: var(--target-min);
  cursor: pointer;
}
.ui-table-ledger td > a.ui-amount-link:hover,
.ui-table-ledger td > a.ui-amount-link:focus-visible {
  text-decoration: underline;
}
@media (pointer: fine) {
  /* A link no longer makes its row higher than the text and the cell's own air: a summary row as the prototype's td
     (8 px over and under), a detail row as its tr.det (4 px). */
  .ui-table-ledger td > a:only-child {
    min-height: var(--table-row-min-fine);
  }
  .ui-table-ledger tr.ui-row-minor td > a:only-child {
    margin: calc(-1 * var(--space-2)) 0;
    padding: var(--space-2) 0;
  }
}
/* With touch, and on a computer that also has a touch screen (any-pointer: coarse, G1 of #499): every link keeps the tap
   target, and a row of detail gets the air of an ordinary row, so that its link of 44 px fills the row and the links
   of two rows in a row never overlap (Bör 1). An amount that opens has the colour of a link (--drill-marker-touch),
   without a line and without the arrow, since there is no hover to show it (the pilot session 1/11, level 2, Bör 2). */
@media (pointer: coarse), (any-pointer: coarse) {
  .ui-table-ledger td > a:only-child {
    min-height: var(--target-min);
  }
  /* tbody: before the rule for a row of detail further down, whatever their order */
  .ui-table tbody tr.ui-row-minor td {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
  }
  .ui-table-ledger tr.ui-row-minor td > a:only-child {
    margin: calc(-1 * var(--space-4)) 0;
    padding: var(--space-4) 0;
  }
  .ui-table-ledger td > a.ui-amount-link {
    color: var(--drill-marker-touch);
  }
  /* A negative amount stays red, and a saving green, as every such amount (P.0.17a omgång 2: the portfolio's list). */
  .ui-table-ledger td.ui-neg > a.ui-amount-link,
  .ui-table-ledger td.ui-better > a.ui-amount-link {
    color: inherit;
  }
}
/* An amount with a second line under it (ui-cell-stack): the arrow stands left of the two, in their middle. */
.ui-table td > a.ui-amount-link.ui-cell-stack {
  position: relative;
}
.ui-table td > a.ui-amount-link.ui-cell-stack::before {
  position: absolute;
  top: 50%;
  right: 100%;
  margin-top: calc(-1 * var(--space-2));
}
/* A row of detail (minor, T2.45), as the project report's voucher rows, the prototype's tr.det: smaller and grey, closer,
   with a dotted line under it and the first column a step in; a negative amount stays red. A subtotal with indent has
   its first column empty, as the detail list's Summa konto. A link in such a row keeps its tap target (T2.7). */
.ui-table tr.ui-row-minor td {
  font-size: var(--text-sm);
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: var(--line-thin) dotted var(--color-border-soft);
}
.ui-table tr.ui-row-minor td:not(.ui-neg) {
  color: var(--color-text-2);
}
.ui-table tr.ui-row-minor td:first-child {
  padding-left: calc(2 * var(--space-6));
}
/* A column whose figures carry the table, in bold, as the living budget's Levande budget (P.0) and the start page's
   Resultat (P.0.17a). Only its cells: the header keeps the head row's weight, as every header cell does
   (docs/granskningslista.md, Dokument och tabeller). */
.ui-table td.ui-col-strong {
  font-weight: var(--weight-bold);
}
/* A second line under an amount, smaller and grey, such as the forecast's version (1h.6); in a link the two lines are
   one tap target. */
.ui-table .ui-cell-detail {
  display: block;
  white-space: normal; /* a reason under an amount wraps in a narrow column, such as "23 258,95 när godkänd" (1c.P) */
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  color: var(--color-text-3);
}
/* The second line as a warning (detail_tones, 1c.12b): the warning's text with the signals' dot before it, as
   "12 089 kr över · 300 %" under Fakturor mot ÄTA; the words say it, so the colour is never the only sign, and the
   amount over it keeps its place at the right. */
.ui-table .ui-cell-detail-warning {
  color: var(--color-warning-text);
}
.ui-table .ui-cell-detail-warning::before {
  content: "";
  display: inline-block;
  width: var(--signal-dot);
  height: var(--signal-dot);
  margin-right: var(--space-2);
  border-radius: var(--radius-round);
  background: var(--signal-warning);
  vertical-align: middle;
}
.ui-table td > a.ui-cell-stack {
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}
/* A text with a second line in its link (stack, P.0.19.1): the lines at the left, the number first and the name, whole
   and wrapping, under it. The link is one tap target of --target-min as the amount's. */
.ui-table td:not(.ui-num) > a.ui-cell-stack {
  align-items: flex-start;
}
/* A cell with a main line and a second line (T2.47), as the prototype's supplier list: the main line in the text's weight (only
   the name that is the row's link is in bold, below), an optional
   status badge after it and the second line under it, smaller and grey. Several entries in a cell, such as the contact
   people, stand one under the other with a little air between. */
.ui-cell-entry + .ui-cell-entry {
  margin-top: var(--space-3);
}
.ui-cell-main {
  font-weight: var(--weight-regular);
  color: var(--color-text);
}
.ui-cell-note {
  font-weight: var(--weight-regular);
  color: var(--color-text-3);
}
.ui-cell-entry .ui-badge {
  margin-left: var(--space-3);
  vertical-align: middle;
}
/* An entry that is only a badge (Kontroll, K39 v3) has no air before it: the column is as wide as the badge. */
.ui-cell-entry > .ui-cell-main:empty + .ui-badge {
  margin-left: 0;
}
.ui-cell-sub {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  color: var(--color-text-3);
}
/* An identity whose name is its main line (main on the column, T2.47) is in bold, as the main line of the other cells. */
.ui-table a.ui-row-id.ui-cell-main {
  font-weight: var(--weight-strong);
}
/* A link in a cell is used only where the cell leads somewhere else than the row's own page, and then it is discreet
   (quiet, T2.47): the text's colour with a thin line in the border's colour, and the action colour when the pointer is
   over it or it has the focus. */
.ui-table-quiet td a:not(.ui-row-id, .ui-number-link) {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: var(--line-thin);
  text-decoration-color: var(--color-border-strong);
}
.ui-table-quiet td a:not(.ui-row-id, .ui-number-link):focus-visible {
  color: var(--color-action);
  text-decoration-color: currentcolor;
}
@media (hover: hover) {
  .ui-table-quiet td a:not(.ui-row-id, .ui-number-link):hover {
    color: var(--color-action);
    text-decoration-color: currentcolor;
  }
}
/* A row that folds out (1c.P, Björn 31/10, the tables' rule that replaces the pencil). The row's identity is its
   number in a column of its own, such as an ÄTA's Ä1, the number link (number_link, T2.42: the link's colour, underlined
   at hover and focus, not bold; 1c.P round 3), which leads to the row's own page; the name beside it is plain text, and only where there is no number,
   as for a supplier, is the name the link. Never the arrow, which is an amount's (1b.3). The chevron before the
   number, in muted grey, folds out the row under it with what has no column, and turns a quarter when it is out; a
   click or tap anywhere else on the row does the same (components.js). Never a ▸, which says "open what the amount is
   made of". The chevron and the link are --row-control-min, as the box that chooses the row (.ui-row-select): the
   prototype's size with a mouse and the tap target, 44 px, with touch (tokens.css, T2.67), so that they hold with a
   finger on an iPad, and nothing hangs on hovering: the background under a pointer is a hint only. In a number column the chevron
   stands at the row's start and the number at the column's right edge. A cancelled row is grey, its identity too. */
.ui-table .ui-row-lead {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin: calc(-1 * var(--space-4)) 0;
}
.ui-table td.ui-num .ui-row-lead {
  justify-content: space-between;
}
.ui-table .ui-row-id {
  display: inline-flex;
  align-items: center;
  min-height: var(--row-control-min);
  min-width: var(--row-control-min);
}
.ui-table td.ui-num .ui-row-id {
  justify-content: flex-end;
}
/* Air between the number and the column after it in a dense table, with its heading in line; in a table with the
   ordinary air (the ÄTA list since 1c.P round 3) the column's own 10 px is enough (round 5: the list fits 1366). */
.ui-table-dense th.ui-col-identity,
.ui-table-dense td.ui-cell-identity {
  padding-right: var(--space-7);
}
/* A row chosen for a form (P.0.4, the table's select_form): the box before the row's identity, as the prototype's in
   Sammanställning ÄTA. The label around it is the tap target, --row-control-min as the chevron's and the number's: the
   prototype's size with a mouse and 44 px with touch (tokens.css, P.0.4). A row that cannot be chosen keeps the room
   empty, so that the numbers stand in line. Never field width (granskningslistan). */
.ui-row-select {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-width: var(--row-control-min);
  min-height: var(--row-control-min);
  cursor: pointer;
}
.ui-row-select input {
  width: var(--check);
  height: var(--check);
  margin: 0;
  accent-color: var(--color-action);
  cursor: pointer;
}
span.ui-row-select {
  cursor: auto;
}
@media print {
  .ui-row-select {
    display: none;
  }
}
.ui-row-toggle {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-width: var(--row-control-min);
  min-height: var(--row-control-min);
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text-3);
  cursor: pointer;
}
.ui-row-toggle-icon {
  width: var(--icon);
  height: var(--icon);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--motion-fast);
}
.ui-row-toggle[aria-expanded="true"] .ui-row-toggle-icon {
  transform: rotate(90deg);
}
/* The chevron, and the box that chooses the row, stand in a column of their own before the row's identity, and the
   badges and the second line under it begin in the name's left edge and never to the left of it (Björn 11/11, K39 v3,
   the rule of 7/11 point 1; docs/granskningslista.md): each control before the name moves them in by its own width and
   the lead's gap. Measured in the catalogue (e2e/catalog.spec.ts, at most 2 px). In a number column the number stands
   at the right and its second line with it. */
.ui-table td.ui-cell-identity:has(> .ui-row-lead > .ui-row-toggle),
.ui-table td.ui-cell-identity:has(> .ui-row-lead > .ui-row-select) {
  --row-lead-controls: 1;
}
.ui-table td.ui-cell-identity:has(> .ui-row-lead > .ui-row-select):has(> .ui-row-lead > .ui-row-toggle) {
  --row-lead-controls: 2;
}
/* The badges after a name (tags, Björn 11/11, K39 v3: Inaktiv): on the name's line, after it, and when they do not fit
   there, under the name in its left edge; the name and its badges are one box beside the chevron. */
.ui-table .ui-row-name {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-3);
  min-width: 0;
}
/* A post's state after its name (a tag with fact, Björn 11/11, K39 v3, punkt 10): a fact about the post, muted text
   without box or dot, so that it never looks like a judgement's badge (Ok, Varning, Risk). */
.ui-table .ui-row-fact {
  color: var(--row-fact-text);
  font-size: var(--row-fact-size);
  font-weight: var(--weight-regular);
}
.ui-table .ui-row-name > .ui-cell-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  max-width: 100%;
}
.ui-table td.ui-cell-identity:not(.ui-num) > :is(.ui-cell-tags, .ui-cell-detail) {
  margin-left: calc(var(--row-lead-controls, 0) * (var(--row-control-min) + var(--space-1)));
}
.ui-table tr[data-expands] {
  cursor: pointer;
}
@media (hover: hover) {
  .ui-table tbody tr[data-expands]:not(.ui-row-expanded):hover > td {
    background: var(--color-surface-2);
  }
}
.ui-table tr.ui-row-expanded > td {
  border-bottom-color: transparent;
}
/* A table without rows, with the text empty_row (P.0.18, the prototype's muted "Inga."): one row over the whole width. */
.ui-table tr.ui-table-empty > td {
  color: var(--color-text-2);
  text-align: left;
}
/* The row under (T2.105, Björn's rules 1, 2 and 4 of K39 7/11): what has no column stands on the row's own surface and
   is never greyed, in a card with a thin line, and begins at the left edge of the row's name, after the chevron and the
   box that chooses the row (--row-more-indent; components.js measures it when the row folds out, so that it holds in
   every table, and the value here is the one without JavaScript). Each label is in grey over its value, in rows of at
   least --field-row-min, a list (the changes of Svar senast) in the whole width. The open post has a line at its left
   in the colour of action, on the row and on the row under. It keeps to the left of the box when the table scrolls
   sideways, as wide as the screen at most. The heading is the panel's (layout="panel") and is not shown in a row.
   On a surface narrower than --more-full-below (components.js sets ui-row-more-full, and a phone always) the card
   begins at the row's left edge and takes its whole width, since after the chevron it would be too narrow
   (pilotsessionen 9/11). */
.ui-table-expands {
  --row-more-indent: calc(var(--space-6) + var(--row-control-min) + var(--space-1));
}
.ui-table-expands.ui-table-chooses {
  --row-more-indent: calc(var(--space-6) + 2 * var(--row-control-min) + 2 * var(--space-1));
}
.ui-table tr.ui-row-more > td {
  padding: 0;
  background: var(--more-surface);
  cursor: auto;
}
.ui-table tr.ui-row-expanded > td:first-child,
.ui-table tr.ui-row-expanded + tr.ui-row-more > td {
  box-shadow: inset var(--more-open-line) 0 0 var(--more-open-edge);
}
.ui-row-more-body {
  position: sticky;
  left: 0;
  box-sizing: border-box;
  max-width: var(--row-more-max, min(100%, calc(100vw - var(--space-11))));
  padding: var(--more-air);
  padding-left: var(--row-more-indent);
  white-space: normal;
}
.ui-table tr.ui-row-more.ui-row-more-full .ui-row-more-body {
  padding-left: var(--more-full-edge);
}
.ui-row-more-title {
  display: none;
}
.ui-row-more-card {
  padding: var(--more-card-pad);
  border: var(--line-thin) solid var(--more-card-border);
  border-radius: var(--more-card-radius);
  background: var(--more-surface);
}
.ui-row-more-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--field-row-min), 1fr));
  gap: var(--space-4) var(--space-9);
  margin: 0;
  padding: 0;
}
.ui-row-more-item {
  min-width: 0;
}
.ui-row-more-wide {
  grid-column: 1 / -1;
}
.ui-row-more-list dt {
  font-size: var(--text-xs);
  color: var(--color-text-3);
}
.ui-row-more-list dd {
  margin: 0;
  overflow-wrap: break-word;
}
.ui-row-more-list ul {
  margin: 0;
  padding-left: var(--space-7);
}
/* The row that folds out in a panel (layout="panel", T2.105, K39 v2 B): where the list's surface is at least
   --more-panel-from wide (components.js sets data-more-mode), the chosen post stands in a panel to the right of the
   list, one at a time, with its name as the panel's heading, and the list keeps only its columns with beside; the
   chosen row is lifted with the soft colour of action and has the line at its left, and the panel has the line too.
   The panel stays in sight while the list scrolls, and scrolls in itself only when it is higher than the screen.
   Under the width, and on a phone, the row folds out under itself as above. */
.ui-more-split.is-open[data-more-mode="panel"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--more-panel-share));
  gap: var(--more-panel-gap);
  align-items: start;
}
.ui-more-split.is-open[data-more-mode="panel"] .ui-col-aside {
  display: none;
}
.ui-more-split[data-more-mode="panel"] .ui-table tr.ui-row-expanded > td {
  background: var(--more-chosen-surface);
  border-bottom-color: var(--color-border-soft);
}
.ui-more-panel {
  position: sticky;
  top: var(--more-panel-top);
  min-width: 0;
  max-height: calc(100vh - 2 * var(--more-panel-top));
  overflow-y: auto;
  padding: var(--more-panel-pad);
  border: var(--line-thin) solid var(--more-card-border);
  border-left: var(--more-open-line) solid var(--more-open-edge);
  background: var(--more-surface);
}
.ui-more-panel[hidden] {
  display: none;
}
.ui-more-panel:focus-visible {
  outline: var(--line-medium) solid var(--color-focus);
  outline-offset: calc(-1 * var(--line-medium));
}
.ui-more-panel .ui-row-more-body {
  position: static;
  max-width: none;
  padding: 0;
}
.ui-more-panel .ui-row-more-title {
  display: block;
  margin: 0 0 var(--space-6);
  padding-right: var(--target-min);
  font-family: var(--font-display);
  font-size: var(--more-panel-title);
  font-weight: var(--weight-heading);
  line-height: var(--leading-tight);
}
.ui-more-panel .ui-row-more-phone {
  display: block;
}
/* In the panel the post's fields stand directly on the panel's surface, with no card of their own inside it: the
   panel is the card (pilotsessionen 9/11, no frame inside the frame). */
.ui-more-panel .ui-row-more-card {
  padding: 0;
  border: 0;
  border-radius: 0;
}
/* The post in sections (more_cards, 1f.L.1, K39 v2 B): the section cards stand on the row's own surface with no frame
   around them (no frame inside a frame), under the post's second line; Ring and Mejla stand first
   where the post folds out under its row and not in the panel, where the contact card has the links. */
.ui-row-more-sections {
  display: grid;
  gap: var(--space-6);
}
.ui-row-more-lead {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-2);
}
.ui-more-panel .ui-row-more-call {
  display: none;
}
/* Under its row the post's Ring and Mejla stand without the contact person's name and role over them: the row shows
   the first contact in Kontaktperson at every width, a phone's card too, so the name stands in one place (Björn 11/11,
   K39 v3 rule (5), the pilot session's finding at 390 px). The buttons still say the name to a screen reader. */
.ui-row-more-call .ui-section-card-call-name {
  display: none;
}
/* Every item stands in one place (Björn 11/11, K39 v3; docs/granskningslista.md): where the post folds out under its
   row, the row has the name, the badge and Ändrad, and from 600 px the second line too, so the post draws them only in
   the panel, beside a list of the name and Kontroll, and the second line on a phone's card. The category after it
   (lead_panel) is the row's on a phone too. */
.ui-row-more-lead-panel {
  display: none;
}
.ui-more-panel .ui-row-more-lead-panel {
  display: inline;
}
@media (min-width: 600px) {
  .ui-table tr.ui-row-more .ui-row-more-lead,
  .ui-table tr.ui-row-more .ui-section-card-phone {
    display: none;
  }
}
/* The panel's head (Björn 11/11, K39 v3): the name, the badge after it on the name's line, where the badge stands in the
   row too, and the stamp of who changed it (more_stamp, the source stamp's variant by: a person's or a system's symbol,
   the name and the date, Björn 11/11) at the right before the close button. Under its row the post has no head: the row
   has all three. */
.ui-row-more-head {
  display: none;
}
.ui-more-panel .ui-row-more-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-3) var(--space-5);
  margin-bottom: var(--space-6);
  padding-right: var(--target-min);
}
.ui-row-more-head > .ui-source-stamp {
  flex: 0 1 auto;
  margin-left: auto;
}
.ui-more-panel .ui-row-more-head > .ui-row-more-title {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  padding-right: 0;
}
/* The post's items as a fact list (layout="panel", |more_facts): an item with phone is drawn only on a phone's card
   and in the panel, where the list has no column for it, and one with cut only in the row under a row from 600 px,
   where the list cuts the cell it repeats (the whole title); the panel's heading and a phone's card have it whole. */
.ui-facts-row.ui-facts-phone,
.ui-facts-row.ui-facts-cut,
.ui-facts-row.ui-facts-panel {
  display: none;
}
.ui-more-panel .ui-facts-row.ui-facts-phone,
.ui-more-panel .ui-facts-row.ui-facts-panel {
  display: contents;
}
@media (min-width: 600px) {
  .ui-table tr.ui-row-more .ui-facts-row.ui-facts-cut {
    display: contents;
  }
}
@media (max-width: 599px) {
  .ui-table tr.ui-row-more .ui-facts-row.ui-facts-phone {
    display: contents;
  }
}
/* An item with portrait (fold on a column with wide_only="portrait", P.0.17c, the pilot session 13/11) is drawn only
   under iPad portrait, --bp-ipad-portrait (820 px), where its column is hidden; tests/test_design.py keeps the width
   equal to the token. */
@media (min-width: 820px) {
  .ui-facts-row.ui-facts-portrait {
    display: none;
  }
}
.ui-facts-lines {
  margin: 0;
  padding-left: var(--space-7);
}
.ui-more-panel-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--target-min);
  min-height: var(--target-min);
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text-2);
  cursor: pointer;
}
.ui-more-panel-close-icon {
  width: var(--icon);
  height: var(--icon);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
/* In print the panel is not used (G1 on T2.105): components.js takes the open post back under its row when the page
   is printed, and here the list is one column again with every column back, so that nothing is left out and no
   right column is empty, also if the script has not run. */
@media print {
  .ui-more-panel {
    display: none;
  }
  .ui-more-split.is-open[data-more-mode="panel"] {
    display: block;
  }
  .ui-more-split.is-open[data-more-mode="panel"] .ui-col-aside {
    display: table-cell;
  }
}
/* Without JavaScript the chevron cannot fold anything: the rows under are shown and the chevrons are not, by
   noscript.css, which base.html loads in noscript (the media feature scripting is not set by every browser that has
   scripts off). */
@media print {
  .ui-row-toggle {
    display: none;
  }
}
.ui-table tr.ui-row-muted > td,
.ui-table tr.ui-row-muted .ui-row-id {
  color: var(--color-text-3);
}
/* A row the links moved after its predecessors in the schedule's edit mode (1g.5b, the prototype's tr.tpflytt), with the
   line under the table that names the rows, so that the tone is never the only sign; and a field with an error there
   (the prototype's input.fel), with aria-invalid and the warning under the table. The row's fields take the tone too,
   as the prototype's fields on a tr.tpflytt, whose own surface is transparent, so the row reads as one. */
.ui-table tr.ui-row-moved > td,
.ui-table tr.ui-row-moved .ui-input {
  background: var(--table-row-moved-surface);
}
.ui-table td.ui-cell-invalid .ui-input {
  border-color: var(--table-cell-invalid-border);
  background: var(--table-cell-invalid-surface);
}
/* and its badge toned down, as the prototype's makulerad .chip (dashboard_mall.html, opacity .7, 1c.P round 7) */
.ui-table tr.ui-row-muted .ui-badge {
  opacity: var(--opacity-muted);
}
/* The heading over a run of columns (group, 1c.P), such as Prognos over Intäkt and Kostnad: a row of its own above the
   header row, with a line under the heading as wide as its columns. It does not stay at the top when the page scrolls;
   the header row under it does. */
.ui-table .ui-table-groups > th,
.ui-table .ui-table-groups > td {
  position: static;
  border-bottom: 0;
  padding-bottom: var(--space-2);
}
.ui-table .ui-table-groups > td.ui-table-fixed {
  position: sticky;
}
.ui-table .ui-table-groups > th.ui-table-group {
  text-align: center;
  border-bottom: var(--line-thin) solid var(--color-border-strong);
}
/* The way into a row (T2.47): a column with only a pen, the row's own link of the tap target's size. */
.ui-table th.ui-col-open,
.ui-table td.ui-cell-open {
  width: var(--target-min);
}
.ui-table td.ui-cell-open {
  padding-right: var(--space-4);
}
.ui-table td.ui-cell-open > a.ui-row-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--target-min);
  min-width: var(--target-min);
  height: var(--target-min);
  margin: calc(-1 * var(--space-4)) 0;
  padding: 0;
  color: var(--color-action);
  border-radius: var(--radius-sm);
}
@media (hover: hover) {
  .ui-table td.ui-cell-open > a.ui-row-open:hover {
    background: var(--color-action-soft);
  }
}
/* A link in a cell is used only where the cell leads somewhere else than the row's own page, and then it is discreet
   (quiet, T2.47): the text's colour with a thin line in the border's colour, and the action colour when the pointer is
   over it or it has the focus. */
.ui-table-quiet td a:not(.ui-row-open) {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: var(--line-thin);
  text-decoration-color: var(--color-border-strong);
}
.ui-table-quiet td a:not(.ui-row-open):focus-visible {
  color: var(--color-action);
  text-decoration-color: currentcolor;
}
@media (hover: hover) {
  .ui-table-quiet td a:not(.ui-row-open):hover {
    color: var(--color-action);
    text-decoration-color: currentcolor;
  }
}
/* The accumulated result month by month in a cell (1h.6), drawn on the server: as high as a line of the table's text
   and the air around it, and as wide as its drawing. */
.ui-table .ui-trend {
  display: block;
  height: var(--space-10);
  width: auto;
}
/* A column header that sorts the table (1h.5): a link in the header, at a tap target's height like a link in a cell,
   with a mark for the order. The marks are two small triangles, grey while the column is not the sorted one, and in
   the action colour on the side the order goes; aria-sort on the header says the same to a screen reader. The mark
   stands where the label ends (T2.88a, the owner 4/11): after the last word, which it keeps on its line
   (ui-sort-end), so that a label on two lines has the mark after its last word, in a column aligned left or right. */
.ui-table th .ui-sort {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  margin: calc(-1 * var(--space-4)) 0;
  padding: var(--space-4) 0;
  color: inherit;
  text-decoration: none;
}
/* With touch, and on a computer that also has a touch screen (any-pointer: coarse), a short header's link, as Marg. for
   Marginal, is a tap target of --target-min in width too, as it is in height; with a mouse it keeps the width of its
   label, so that no header moves on a computer. */
@media (pointer: coarse), (any-pointer: coarse) {
  .ui-table th .ui-sort {
    min-width: var(--target-min);
  }
}
/* In a table with sorting the headers stand in the middle of the row, as the links do, so that a header that is not
   a link is on the same line. */
.ui-table thead:has(.ui-sort) th {
  vertical-align: middle;
}
.ui-table th .ui-sort:hover,
.ui-table th[aria-sort] .ui-sort {
  color: var(--color-text);
}
.ui-sort-end {
  white-space: nowrap;
}
.ui-sort-mark {
  display: inline-flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-inline-start: var(--space-3);
  vertical-align: middle;
}
.ui-sort-mark::before,
.ui-sort-mark::after {
  content: "";
  width: var(--space-4);
  height: var(--space-3);
  background: var(--color-border-strong);
}
.ui-sort-mark::before {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.ui-sort-mark::after {
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.ui-table th[aria-sort="ascending"] .ui-sort-mark::before,
.ui-table th[aria-sort="descending"] .ui-sort-mark::after {
  background: var(--color-action);
}
.ui-table th[aria-sort="ascending"] .ui-sort-mark::after,
.ui-table th[aria-sort="descending"] .ui-sort-mark::before {
  visibility: hidden;
}
/* The bar Sortera efter above a sortable table (1h.7): on mobile the rows are cards without the header row, so the
   order is chosen here, with the picker and a button that turns it. Hidden from 600 px, where the headers sort. */
.ui-table-sortbar {
  display: none;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.ui-table-sortbar .ui-picker {
  flex: 1 1 auto;
}
.ui-table-sortbar-preview {
  display: flex;
}
.ui-table .ui-row-group td {
  font-family: var(--font-display);
  font-weight: var(--weight-heading);
  font-size: var(--text-lg);
  padding-top: var(--space-7);
  border-bottom-color: var(--color-border);
}
.ui-table tfoot td {
  font-weight: var(--weight-heading);
  border-top: var(--line-thin) solid var(--color-border-strong);
  border-bottom: 0;
}
.ui-table tfoot .ui-row-total td {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  border-top-width: var(--line-medium);
}
.ui-table .ui-row-subtotal td {
  font-weight: var(--weight-heading);
  border-bottom: var(--line-thin) solid var(--color-border-strong);
}
.ui-table .ui-col-reference {
  color: var(--color-text-3);
}
.ui-table .ui-cell-editable {
  background: var(--color-cell-editable);
}
/* A field in a cell keeps the tap target's height: the heavy views are edited with a finger on an iPad (T2.7). */
.ui-table .ui-cell-editable .ui-input {
  padding: var(--space-1) var(--space-3);
}
/* The placeholder of a box in a table is written like the headers (T2.9, T2.122): plain writing, never capitals, with
   the same size and weight, grey (Ks, Konto, Specifikation, Enh, Samma). The box fills the cell's content width, so its
   edge is the same as the header's text edge on the side the column is aligned to. */
.ui-table .ui-input::placeholder {
  text-transform: none;
  letter-spacing: normal;
  font-size: var(--text-col-head);
  font-weight: var(--weight-strong);
  color: var(--color-text-3);
  opacity: 1;
}
/* A cell with a field has no air of its own above and below, so that the row is the field's height. */
.ui-table td.ui-cell-field {
  padding-top: 0;
  padding-bottom: 0;
}

/* Mobile: the table becomes cards in the same order as the list, with the bar Sortera efter above them. */
@media (max-width: 599px) {
  .ui-table-sortbar {
    display: flex;
  }
  .ui-table,
  .ui-table tbody,
  .ui-table tfoot,
  .ui-table tr,
  .ui-table td,
  .ui-table :where(tbody) th[scope="row"] {
    display: block;
  }
  .ui-table thead {
    display: none;
  }
  .ui-table tr {
    border-bottom: var(--line-thin) solid var(--color-border);
    padding: var(--space-4) 0;
  }
  .ui-table td,
  .ui-table td:first-child,
  .ui-table :where(tbody) th[scope="row"],
  .ui-table :where(tbody) th[scope="row"]:first-child {
    display: flex;
    justify-content: space-between;
    gap: var(--space-6);
    border: 0;
    padding: var(--space-1) var(--space-4);
    overflow-wrap: break-word;
  }
  .ui-table td.ui-text-whole {
    overflow-wrap: break-word; /* a card has no column to widen: a word wider than it breaks, as before (T12.3) */
  }
  .ui-table td::before,
  .ui-table :where(tbody) th[scope="row"]::before {
    content: attr(data-label);
    color: var(--color-text-3);
    font-size: var(--text-xs);
    text-align: left;
    flex: 0 0 auto; /* the label keeps its width beside a long value, which wraps instead */
    max-width: 45%;
  }
  .ui-table td:first-child::before,
  .ui-table :where(tbody) th[scope="row"]:first-child::before {
    content: none;
  }
  /* A row's cross (a column of kind remove, 1g.8b2) stands at the card's right, without its label, which is only read */
  .ui-table td.ui-cell-remove {
    width: auto;
    justify-content: flex-end;
  }
  .ui-table td.ui-cell-remove::before {
    content: none;
  }
  /* An amount with a second line, such as the margin and its percent (1c.11), stands together at the right. */
  .ui-table td:has(> .ui-cell-detail)::before {
    margin-right: auto;
  }
  .ui-table td > a:only-child {
    margin: calc(-1 * var(--space-1)) 0;
    padding: var(--space-1) 0;
  }
  .ui-table td.ui-cell-field {
    align-items: center;
    padding-top: var(--space-1);
    padding-bottom: var(--space-1);
  }
  /* A cell with lines stands with its label over the lines, and the lines at the left. */
  .ui-table td.ui-cell-lines {
    flex-direction: column;
    gap: 0;
    text-align: left;
  }
  .ui-table caption {
    display: block;
  }
  .ui-table td:empty,
  .ui-table tfoot td:not(:first-child, .ui-num) {
    display: none;
  }
  .ui-table tfoot td,
  .ui-table tfoot .ui-row-total td {
    border: 0;
  }
  .ui-table tfoot tr {
    border-top: var(--line-medium) solid var(--color-border-strong);
    border-bottom: 0;
  }
  /* A row that folds out (1c.P): the identity and its chevron at the left of the card's first line, and the row under
     as the end of its card, with no line between them. */
  .ui-table td.ui-cell-identity {
    justify-content: flex-start;
  }
  .ui-table td.ui-num .ui-row-id {
    justify-content: flex-start;
  }
  .ui-table tr.ui-row-expanded {
    border-bottom: 0;
    padding-bottom: 0;
  }
  .ui-table tr.ui-row-more {
    padding-top: 0;
  }
  .ui-table tr.ui-row-more > td {
    display: block;
    padding: 0;
  }
  .ui-table tr.ui-row-more > td::before {
    content: none;
  }
  .ui-row-more-body,
  .ui-table tr.ui-row-more.ui-row-more-full .ui-row-more-body {
    position: static;
    max-width: none;
    padding: 0 var(--space-4) var(--space-4);
  }
  /* the open post's line along the whole card, the row and the row under (T2.105) */
  .ui-table tr.ui-row-expanded,
  .ui-table tr.ui-row-expanded + tr.ui-row-more {
    box-shadow: inset var(--more-open-line) 0 0 var(--more-open-edge);
  }
  .ui-table tr.ui-row-expanded > td:first-child,
  .ui-table tr.ui-row-expanded + tr.ui-row-more > td {
    box-shadow: none;
  }
  .ui-row-more-phone {
    display: block;
  }
  .ui-table .ui-clip,
  .ui-table .ui-clip-wide {
    max-width: none;
    white-space: normal;
  }
}

/* A compact card on a phone (T2.42, compact): at most three lines, each a row of the cells that have that line, in the
   order of the columns, and a column without a line is left out. The first line leads with a number link and the text
   beside it; sep puts a dot before a cell, card_label the column's label before its value and a suffix stands after it
   ("44 d"). A negative amount is red as in the table, and the label and the dot stay grey. */
@media (max-width: 599px) {
  .ui-table-compact tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: var(--space-3);
    padding: var(--space-4);
  }
  .ui-table-compact tr::before,
  .ui-table-compact tr::after {
    content: "";
    flex: 0 0 100%;
    height: 0;
  }
  .ui-table-compact tr::before {
    order: 15;
  }
  .ui-table-compact tr::after {
    order: 25;
  }
  .ui-table-compact td,
  .ui-table-compact td:first-child {
    display: block;
    padding: 0;
    width: auto;
    justify-content: flex-start;
    text-align: left;
    overflow-wrap: break-word;
  }
  .ui-table-compact td:not([data-line]) {
    display: none;
  }
  .ui-table-compact td[data-line="1"] {
    order: 10;
  }
  .ui-table-compact td[data-line="2"] {
    order: 20;
    color: var(--color-text-3);
  }
  .ui-table-compact td[data-line="3"] {
    order: 30;
  }
  .ui-table-compact td::before {
    content: none;
  }
  .ui-table-compact td:empty {
    display: none;
  }
  /* the row under has the card's own side padding already, so the post's card has the row's content edges (T2.105) */
  .ui-table-compact tr.ui-row-more .ui-row-more-body,
  .ui-table.ui-table-compact tr.ui-row-more.ui-row-more-full .ui-row-more-body {
    padding-right: 0;
    padding-left: 0;
  }
  /* A cell with lines in a compact card (T2.47): the first entry's main line only, on the card's line, with its note after
     it; the second lines and further entries are in the row that folds out. */
  .ui-table-compact td .ui-cell-entry {
    display: inline;
  }
  .ui-table-compact td .ui-cell-entry + .ui-cell-entry,
  .ui-table-compact td .ui-cell-sub,
  .ui-table-compact td.ui-cell-identity > .ui-cell-detail {
    display: none;
  }
  .ui-table-compact td.ui-cell-identity > .ui-cell-tags {
    padding-left: 0;
  }
  .ui-table-compact td.ui-cc-sep::before {
    content: "\00b7";
    margin-right: var(--space-3);
    color: var(--color-text-3);
  }
  .ui-table-compact td.ui-cc-label::before {
    content: attr(data-label);
    margin-right: var(--space-3);
    max-width: none;
    font-size: inherit;
    font-weight: var(--weight-regular);
    color: var(--color-text-3);
  }
  .ui-table-compact td[data-suffix]::after {
    content: attr(data-suffix);
  }
  /* The number link is a tap target of 44 x 44 px: the box is wider than a four-digit number, and the cell gives the width
     back to the text beside it with a negative margin, so that the number stays on the text's line and the name follows
     it closely. */
  .ui-table-compact td > a:only-child {
    min-width: var(--target-min);
    margin: calc(-1 * var(--space-2)) 0;
    padding: var(--space-2) 0;
  }
  /* The cell at the right end of its line (card_end, P.0.17c, K13's phone): it and what follows it on the line stand at
     the right, and a text that wraps on a line with such a cell takes the rest of the line and wraps in it, as the
     project's name beside its result and the ÄTA's title beside its status. */
  .ui-table-compact td.ui-cc-end {
    margin-left: auto;
  }
  .ui-table-compact tr:has(> td.ui-cc-end) > td.ui-text-wrap[data-line] {
    flex: 1 1 0;
    min-width: 0;
  }
  /* The first cell of a line (card_first, 1c.P round 3: the ÄTA's status before its date and amount). */
  .ui-table-compact td[data-line="1"].ui-cc-first {
    order: 9;
  }
  .ui-table-compact td[data-line="2"].ui-cc-first {
    order: 19;
  }
  .ui-table-compact td[data-line="3"].ui-cc-first {
    order: 29;
  }
  /* The chevron stands alone in its column on a phone's card too (Björn 11/11, K39 v3, punkt 4 in every width): the
     card's lines under the name, and the post that folds out under it, begin in the name's left edge, and the
     identity takes the chevron's width back to the card's edge. */
  .ui-table-compact tr[data-expands],
  .ui-table-compact tr[data-expands] + tr.ui-row-more {
    --card-lead: calc(var(--row-control-min) + var(--space-1));
    padding-left: calc(var(--space-4) + var(--card-lead));
  }
  .ui-table-compact tr[data-expands] > td.ui-cell-identity {
    margin-left: calc(-1 * var(--card-lead));
  }
  /* A row that is also chosen for a form (select_form, the ÄTA list) has the box before the chevron: both stand in the
     column, so that the lines under the name begin in the name's left edge there too (1f.L.1, e2e/ata-row-more.spec.ts). */
  .ui-table-compact.ui-table-chooses tr[data-expands],
  .ui-table-compact.ui-table-chooses tr[data-expands] + tr.ui-row-more {
    --card-lead: calc(2 * (var(--row-control-min) + var(--space-1)));
  }
  /* The last cell of a line at its right end (card_end, K39 v3: the supplier's Kontroll on the name's line, where the
     column stands in the list), also when it takes the rest of the line beside the identity. */
  .ui-table-compact td.ui-cc-end,
  .ui-table-compact tr > td.ui-cell-identity[data-line="1"] + td.ui-cc-end {
    flex: 0 1 auto;
    margin-left: auto;
    text-align: right;
  }
  /* Beside such a cell the identity takes the rest of the line and its name breaks between its words, so that a long
     name, or the post's state after it, never pushes the badge off the name's line (1f.L.1, docs/granskningslista.md
     11/11 (4), measured in e2e/catalog.spec.ts at 390 px). */
  .ui-table-compact tr > td.ui-cell-identity[data-line="1"]:has(+ td.ui-cc-end) {
    flex: 1 1 0;
    min-width: 0;
  }
  /* A cell shown on a phone's card only when its row is folded out (card_open, Björn 11/11, K39 v3, punkt 9: the stamp of
     the latest change); the table keeps its column. */
  .ui-table-compact tr[data-expands]:not(.ui-row-expanded) > td.ui-cc-open {
    display: none;
  }
  /* An entry's text for a phone's card (card, K39 v3: the stamp's "Ändrad 8 nov av ..."), in place of its lines. */
  .ui-table-compact td .ui-cell-entry:has(> .ui-cell-card) > :not(.ui-cell-card) {
    display: none;
  }
  .ui-table-compact td .ui-cell-entry > .ui-cell-card {
    display: inline;
    color: var(--source-stamp-text);
    font-size: var(--source-stamp-by-size);
  }
  /* A row that folds out under a compact card (1c.P round 3): the row under is the end of its card, hidden until it
     folds out, and its one cell holds all the rest of the columns. */
  .ui-table-compact tr[hidden] {
    display: none;
  }
  .ui-table-compact tr.ui-row-more > td {
    display: block;
    flex: 1 1 100%;
    padding: 0;
    background: none;
  }
  /* The post under a card begins in the name's left edge, also after the box and the chevron of a chosen row (1f.L.1), so
     it has less width than the card, and a list of label and value beside each other did not fit it with a long word in a
     value (a side scroll at 390 px, e2e/ata-round-3.spec.ts). The card is its own container: its width is its room and not
     its content's, and where the label and the longest word do not fit beside each other the label stands over its value.
     A word is never broken for it (T2.97). */
  .ui-table-compact tr.ui-row-more .ui-row-more-card {
    container-type: inline-size;
  }
  @container (max-width: 230px) {
    .ui-table-compact tr.ui-row-more .ui-facts-list {
      grid-template-columns: minmax(0, 1fr);
      gap: 0;
    }
    .ui-table-compact tr.ui-row-more .ui-facts-value {
      padding-bottom: var(--facts-gap-y);
    }
  }
  .ui-table-compact td:has(> a.ui-number-link:only-child) {
    margin-right: calc(-1 * var(--space-7));
  }
  /* The text beside the identity on the card's first line (the ÄTA's title) takes the rest of the line and wraps at
     its words in it, so that every card has the same head, a short text and a long one, folded out or not
     (pilotsessionen 9/11 on T2.105); it goes under the identity only when its longest word does not fit beside it. */
  .ui-table-compact td.ui-cell-identity[data-line="1"] + td[data-line="1"] {
    flex: 1 1 0;
  }
  /* and stands on the number's line: the lead's baseline is the number's (an item in baseline alignment gives its
     flex container the baseline), not the box's that chooses the row, which sat the text a few pixels low */
  .ui-table-compact .ui-row-lead > .ui-row-id,
  .ui-table-compact .ui-row-lead > .ui-row-name {
    align-self: baseline;
  }
}

/* A table that works out its lines while one types (calc, 1c.0) has a field in most columns: below iPad landscape it
   becomes cards as every table does on mobile, so that its fields keep their width on an iPad held upright. Every
   field has its label, also the first. */
@media (max-width: 1179px) {
  .ui-table[data-calc],
  .ui-table[data-calc] tbody,
  .ui-table[data-calc] tfoot,
  .ui-table[data-calc] tr,
  .ui-table[data-calc] td {
    display: block;
  }
  .ui-table[data-calc] thead {
    display: none;
  }
  .ui-table[data-calc] tr {
    border-bottom: var(--line-thin) solid var(--color-border);
    padding: var(--space-4) 0;
  }
  .ui-table[data-calc] td,
  .ui-table[data-calc] td:first-child {
    display: flex;
    justify-content: space-between;
    gap: var(--space-6);
    border: 0;
    padding: var(--space-1) var(--space-4);
    overflow-wrap: break-word;
  }
  .ui-table[data-calc] td::before {
    content: attr(data-label);
    color: var(--color-text-3);
    font-size: var(--text-xs);
    text-align: left;
    flex: 0 0 auto;
    max-width: 45%;
  }
  .ui-table[data-calc] tfoot td:first-child::before {
    content: none;
  }
  .ui-table[data-calc] td:has(> .ui-cell-detail)::before {
    margin-right: auto;
  }
  .ui-table[data-calc] td.ui-cell-field {
    align-items: center;
    padding-top: var(--space-1);
    padding-bottom: var(--space-1);
  }
  .ui-table[data-calc] caption {
    display: block;
  }
  .ui-table[data-calc] td:empty,
  .ui-table[data-calc] tfoot td:not(:first-child, .ui-num) {
    display: none;
  }
  .ui-table[data-calc] tfoot td {
    border: 0;
  }
  .ui-table[data-calc] tfoot tr {
    border-top: var(--line-medium) solid var(--color-border-strong);
    border-bottom: 0;
  }
  /* Its cards need no box (scroll="wide", 1c.11): the box is for the table from iPad landscape. */
  .ui-table-scroll:has(> .ui-table[data-calc]) {
    overflow-x: visible;
    border: 0;
    background: none;
  }
  .ui-table-scroll:has(> .ui-table[data-calc]) .ui-table caption {
    padding: 0 0 var(--space-5);
  }
}


/* A table with many columns (fixed, the ÄTA list with its 14, 1c.7) does not fit between a phone and a computer, 600 to
   1279 px: there it scrolls sideways in a box of its own, that a finger scrolls too, with the first one to three
   columns kept at the left and an edge against what scrolls under them. The box is a region a key reaches (tabindex,
   role and name in the template). It scrolls sideways only, with no height of its own, so that the list scrolls with the
   page; but a box that scrolls sideways is a scroll port up and down too, so the header row sticks to the box and does
   not stay when the page scrolls (top 0 in the box, not the page's --sticky-top). From 1280 px there is no box with
   overflow (but a dense table, below), the table fits and its header row stays under the page's, as every table's does. On a phone, under 600 px,
   it is cards. Only on a screen: on paper no column is cut. */
@media screen and (min-width: 600px) and (max-width: 1279px) {
  .ui-table-scroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    border: var(--line-thin) solid var(--color-border);
    background: var(--color-surface);
  }
  .ui-table-scroll:focus-visible {
    outline: var(--line-medium) solid var(--color-focus);
    outline-offset: calc(-1 * var(--line-medium));
  }
  .ui-table-scroll .ui-table {
    min-width: var(--table-wide-min);
  }
  /* A table made to fit an iPad in landscape (fits, the ÄTA list, P.0.14): its content's least width, so that it
     scrolls only where the content does not fit. */
  .ui-table-scroll .ui-table.ui-table-fits {
    min-width: 0;
  }
  .ui-table-scroll .ui-table th {
    top: 0;
  }
  /* The table's name stands inside the box, so it has air to the box's edge and to the header row's edge (1c.10). */
  .ui-table-scroll .ui-table caption {
    padding: var(--space-5) var(--space-4) var(--space-7);
  }
  /* scroll="fit" (the statuses, T12.3): the table keeps its own width, so the box scrolls only when a word that is kept
     whole is wider than the page leaves, and the page never does. */
  .ui-table-scroll-fit .ui-table {
    min-width: 0;
  }
  .ui-table .ui-table-fixed {
    position: sticky;
    z-index: 1;
    box-sizing: border-box;
    background: var(--color-surface);
  }
  .ui-table thead .ui-table-fixed {
    z-index: 3;
  }
  /* A table whose rows fold out (1c.P): the first fixed column holds the chevron and the identity, each
     --row-control-min (T2.67), with the cell's air. */
  .ui-table-expands {
    --table-fixed-1: calc(var(--space-6) + 2 * var(--row-control-min) + var(--space-1) + var(--space-7));
  }
  /* and with a box that chooses the row for a form (P.0.4, select_form), one tap target more */
  .ui-table-expands.ui-table-chooses {
    --table-fixed-1: calc(var(--space-6) + 3 * var(--row-control-min) + 2 * var(--space-1) + var(--space-7));
  }
  .ui-table .ui-table-fixed-1 {
    left: 0;
  }
  .ui-table .ui-table-fixed-1:not([colspan]) {
    width: var(--table-fixed-1);
    min-width: var(--table-fixed-1);
    max-width: var(--table-fixed-1);
  }
  .ui-table .ui-table-fixed-2 {
    left: var(--table-fixed-1);
    width: var(--table-fixed-2);
    min-width: var(--table-fixed-2);
    max-width: var(--table-fixed-2);
  }
  .ui-table .ui-table-fixed-3 {
    left: calc(var(--table-fixed-1) + var(--table-fixed-2));
    width: var(--table-fixed-3);
    min-width: var(--table-fixed-3);
    max-width: var(--table-fixed-3);
  }
  /* A word wider than the fixed Rubrik column (1c.10, G1) breaks inside it, as it did before the words were kept whole:
     the other choices were to draw it over the next column or to cut it. Only a word that does not fit is broken. */
  .ui-table td.ui-table-fixed.ui-text-whole {
    overflow-wrap: break-word;
  }
  /* The edge where the fixed columns end shows only while the box is scrolled sideways (is-scrolled-x, components.js,
     P.0.14): never on a table that fits, and never without JavaScript. */
  .ui-table-scroll.is-scrolled-x .ui-table .ui-table-fixed-end {
    box-shadow: var(--grid-fixed-edge);
  }
  .ui-table .ui-table-fixed-end + th,
  .ui-table .ui-table-fixed-end + td {
    padding-left: var(--space-5); /* air between the edge and what scrolls under it */
  }
}

/* The ledger table (the portfolio's list) in that box under 1180 px (T2.88b, the owner 5/11): the first column keeps to a
   width of its own and breaks its names, and the table has its content's least width, not the 1200 px of the other
   tables with fixed columns (P.0.17c, the pilot session 12/11: the widths from the content and the surface), so that
   the columns up to Marg. are on the screen at 600 and 820 px, with Kostnader and Ack. resultat in the row that folds
   out (wide_only="landscape"), and the ones after Marg. (Prognos, Status) are what the box scrolls to. */
@media screen and (min-width: 600px) and (max-width: 1179px) {
  .ui-table-scroll-portrait .ui-table-ledger {
    min-width: 0;
  }
  .ui-table-scroll-portrait .ui-table-ledger th:first-child {
    width: var(--table-lead-wrap);
  }
  .ui-table-scroll-portrait .ui-table-ledger td:first-child {
    max-width: var(--table-lead-wrap);
  }
}

/* A table that scrolls in the box without fixed columns (scroll, the portfolio, 1h.6) fits from an iPad in landscape:
   from 1180 px it is an ordinary table, without the box, so that its header row stays when the page scrolls. */
@media screen and (min-width: 1180px) and (max-width: 1279px) {
  .ui-table-scroll-portrait {
    overflow-x: visible;
    border: 0;
    background: none;
  }
  .ui-table-scroll-portrait .ui-table {
    min-width: 0;
  }
  .ui-table-scroll-portrait .ui-table th {
    top: var(--sticky-top, 0);
  }
  /* The box has no edge here, so the table's name has the air it has outside a box (1c.10). */
  .ui-table-scroll-portrait .ui-table caption {
    padding: 0 0 var(--space-5);
  }
}

/* A dense table (the ÄTA list, 1c.10) stays in its box from 1280 px too, with the edge, so that the table scrolls sideways
   when a word that is kept whole makes it wider than the page, and the page never does (the customer's rule on no
   sideways scroll goes first, pilotsessionen 28/10; the same principle as scroll="fit", T12.3). The table keeps its own
   width, so the box scrolls only when it must. There are no fixed columns here, and the header row sticks to the box and
   not to the page, as it does below 1280 px. */
@media screen and (min-width: 1280px) {
  .ui-table-scroll-wide {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    border: var(--line-thin) solid var(--color-border);
    background: var(--color-surface);
  }
  .ui-table-scroll-wide:focus-visible {
    outline: var(--line-medium) solid var(--color-focus);
    outline-offset: calc(-1 * var(--line-medium));
  }
  .ui-table-scroll-wide .ui-table th {
    top: 0;
  }
  .ui-table-scroll-wide .ui-table caption {
    padding: var(--space-5) var(--space-4) var(--space-7);
  }
}

/* A table that works out its lines (scroll="wide", the ÄTA's lines) has no box from 1280 px, but scrolls in its box while
   it is wider than its room (is-wider, components.js, T2.97): a column is at least as wide as its longest word, and the
   page never scrolls sideways. */
@media screen and (min-width: 1280px) {
  .ui-table-scroll-calc.is-wider {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
  .ui-table-scroll-calc.is-wider .ui-table th {
    top: 0;
  }
}

@media print {
  .ui-table-scroll {
    overflow: visible;
  }
  .ui-table-scroll .ui-table {
    min-width: 0;
  }
}

/* ---- Charts ---- */
/* Drawn as SVG on the server (apps/printing/charts.py), with the chart colours in a fixed order. */
.ui-chart-figure {
  margin: 0;
  background: var(--color-surface);
  border: var(--line-thin) solid var(--color-border);
  padding: var(--space-7);
}
.ui-chart-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4) var(--space-7);
  margin-bottom: var(--space-4);
}
.ui-chart-caption {
  font-family: var(--font-display);
  font-weight: var(--weight-heading);
  font-size: var(--text-title);
}
.ui-chart-legend {
  display: flex;
  gap: var(--space-7);
  font-size: var(--text-xs);
  color: var(--color-text-2);
}
.ui-chart-key::before {
  content: "";
  display: inline-block;
  width: var(--space-5);
  height: var(--space-5);
  margin-right: var(--space-3);
  border-radius: var(--radius-sm);
}
.ui-chart-key-1::before {
  background: var(--color-chart-1);
}
.ui-chart-key-2::before {
  background: var(--color-chart-2);
}
.ui-chart {
  display: block;
  width: 100%;
  height: auto;
}
/* The drawing scales with its width, text and all, so the screen has it at four sizes and shows the one for the
   width of its own box (T2.14: next to another box it is half the page): the text is then at least --text-2xs at every
   width, a phone gets fewer month labels, and half a laptop's page has a drawing as low as the prototype's (T2.43). */
.ui-chart-figure {
  container-type: inline-size;
}
.ui-chart-medium,
.ui-chart-small,
.ui-chart-narrow {
  display: none;
}
@container (max-width: 759px) {
  .ui-chart-wide {
    display: none;
  }
  .ui-chart-medium {
    display: block;
  }
}
@container (max-width: 519px) {
  .ui-chart-medium {
    display: none;
  }
  .ui-chart-small {
    display: block;
  }
}
@container (max-width: 399px) {
  .ui-chart-small {
    display: none;
  }
  .ui-chart-narrow {
    display: block;
  }
}
/* A chart with its table (P.0.12, Björn 1/11: "utan att kortet växer"): Diagram | Tabell in the heading row, with the
   legend after the caption. A choice of view in a box changes what the box shows in the same place (docs/design.md):
   the table stands over the chart, which keeps its place hidden, so the box keeps the chart's height, and the table
   scrolls inside it with its header row and its sum row kept. Without JavaScript (no data-js on html) the switch is
   not shown and the table stands under the chart, so nothing is out of reach. */
.ui-chart-head > .ui-heading-row {
  flex: 1 1 auto;
}
.ui-chart-views {
  position: relative;
}
.ui-chart-table {
  margin-top: var(--space-7);
}
html[data-js] .ui-chart-switch .ui-chart-table {
  display: none;
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--color-surface);
}
html[data-js] .ui-chart-switch[data-view-shown="table"] .ui-chart-table {
  display: block;
}
html[data-js] .ui-chart-switch[data-view-shown="table"] .ui-chart-pane,
html[data-js] .ui-chart-switch[data-view-shown="table"] .ui-chart-legend {
  visibility: hidden;
}
html:not([data-js]) .ui-chart-switch .ui-heading-row > .ui-actions {
  display: none;
}
/* A chart that fills its box (fill, P.0.13): in a row of the page's grid the boxes are as high as each other, and the
   chart's box is as high as the row. The drawing keeps its proportions, so that its text is never stretched, and stands
   at the foot of the box, its axis level with the foot of the boxes beside it; the table, in its place, fills the whole
   height and scrolls inside it. */
.ui-chart-fill {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.ui-chart-fill > .ui-chart-views {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.ui-chart-fill > .ui-chart {
  margin-top: auto;
}
.ui-chart-table:focus-visible {
  outline: var(--line-medium) solid var(--color-focus);
  outline-offset: calc(-1 * var(--line-medium));
}
/* In the box the header row sticks to the box's top, not under the page's sticky rows, and the sum row to its foot. */
html[data-js] .ui-chart-switch .ui-chart-table .ui-table th {
  top: 0;
}
@media (min-width: 600px) {
  html[data-js] .ui-chart-switch .ui-chart-table .ui-table tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 1;
    background: var(--color-surface);
  }
}

/* ---- The box over a chart (T2.92, chart_tip, the prototype's #tip) ---- */
/* One component for every chart: the chart hands over a model (a title, rows of a series' colour square, a label and a
   value, and an optional sum row; apps/printing/charts.py chart_tip) as data on its hit areas, and components.js builds
   the box from it with textContent only. With a mouse it shows on hover and snaps to the month (T2.113, K24 v2; the
   pilot 13/11): beside the drawing when it and --chart-tip-chart-min fit in the window, else under it (above it when
   the window has no room under), to the right of the month as soon as it fits there and else to the left, never over
   it, and it does not follow the pointer. The mode follows the surface, never the device. With touch it stands
   from a tap on the month until a tap elsewhere, Esc or a scroll, and with the keyboard the drawing is focused and the
   arrow keys go from month to month. The box is aria-hidden, its text said in a live region instead, and it is never
   printed. components.js places it with --tip-x and --tip-y in pixels; the catalog shows it in place. */
.ui-chart-tip {
  position: fixed;
  top: var(--tip-y, 0);
  left: var(--tip-x, 0);
  z-index: 30;
  max-width: min(var(--chart-tip-max), calc(100vw - 2 * var(--chart-tip-margin)));
  padding: var(--chart-tip-pad-y) var(--chart-tip-pad-x);
  border: var(--line-thin) solid var(--chart-tip-border);
  border-radius: var(--chart-tip-radius);
  background: var(--chart-tip-bg);
  color: var(--chart-tip-fg);
  box-shadow: var(--chart-tip-shadow);
  font-family: var(--font-body);
  font-size: var(--chart-tip-size);
  line-height: var(--chart-tip-leading);
  pointer-events: none;
}
.ui-chart-tip[hidden] {
  display: none;
}
.ui-chart-tip-static {
  position: static;
  display: inline-block;
}
.ui-chart-tip-title {
  display: block;
  margin-bottom: var(--space-1);
  font-weight: var(--chart-tip-weight-title);
}
/* A text only (T2.100): a short heading's whole name or a cut cell's whole text, which was a title for the mouse. The box has
   the title alone, so it has no room under it; the target is quiet on a tap (no grey flash), as the schedule's names. */
.ui-chart-tip-text .ui-chart-tip-title:last-child {
  margin-bottom: 0;
  font-weight: var(--weight-regular);
}
[data-tap-tip] {
  -webkit-tap-highlight-color: transparent;
}
/* The tap target of a text with a box is --target-min (44 px) with touch, and the drawn text is not changed (T2.100, the
   pilot session 8/11 and 9/11; pattern 10 of docs/granskning/svep-inventering.md, PR #853: the target is 44 px and the
   visible part may be denser). With touch, and on a computer that also has a touch screen (any-pointer: coarse), a short
   heading's abbr and a mark reach 44 x 44 px round their text with an ::after nobody sees and that takes no room (the
   badge's ::before is its dot); a cut text (ui-clip, which clips what is inside it, so a pseudo element would be cut) has
   the same air on every side as padding that a negative margin takes back, so the line stands where it did. The air is
   outside its width (content-box), so the text is cut where it was, and since it is the same on every side, the
   keyboard's ring stands round the text at the usual distance on every side (G1 of the round, Bör 1). With a mouse the
   text is as dense as it is, and the box opens on hover. */
@media (pointer: coarse), (any-pointer: coarse) {
  abbr[data-tap-tip] {
    position: relative;
  }
  abbr[data-tap-tip]::after,
  .ui-badge[data-tap-tip]::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    min-width: var(--target-min);
    min-height: var(--target-min);
    transform: translate(-50%, -50%);
  }
  .ui-clip[data-tap-tip] {
    --tap-tip-reach: calc((var(--target-min) - 1lh) / 2);
    box-sizing: content-box;
    padding: var(--tap-tip-reach);
    margin: calc(-1 * var(--tap-tip-reach));
  }
  .ui-clip[data-tap-tip]:focus-visible {
    outline-offset: calc(var(--line-medium) - var(--tap-tip-reach));
  }
}
.ui-chart-tip-row {
  display: flex;
  justify-content: space-between;
  gap: var(--chart-tip-gap);
  font-variant-numeric: tabular-nums;
}
.ui-chart-tip-value {
  text-align: right;
  white-space: nowrap;
}
/* A value under 0, as the server says (tone negative): the box's own negative tone, which holds on its surface */
.ui-chart-tip-negative {
  color: var(--chart-tip-negative);
}
.ui-chart-tip-swatch {
  display: inline-block;
  width: var(--chart-tip-swatch);
  height: var(--chart-tip-swatch);
  margin-right: var(--chart-tip-swatch-gap);
  border: var(--line-thin) solid var(--chart-tip-swatch-border);
  border-radius: var(--chart-tip-swatch-radius);
  vertical-align: calc(-1 * var(--line-thin));
}
.ui-chart-tip-swatch-1 {
  background: var(--chart-tip-series-1);
}
.ui-chart-tip-swatch-2 {
  background: var(--chart-tip-series-2);
}
.ui-chart-tip-swatch-3 {
  background: var(--chart-tip-series-3);
}
.ui-chart-tip-swatch-4 {
  background: var(--chart-tip-series-4);
}
.ui-chart-tip-swatch-5 {
  background: var(--chart-tip-series-5);
}
.ui-chart-tip-swatch-6 {
  background: var(--chart-tip-series-6);
}
/* A month's hit area over its bars, the whole height of the plot: no fill, and the pointer all the same */
.ui-chart-hit {
  fill: transparent;
  pointer-events: all;
  -webkit-tap-highlight-color: transparent;
}
.ui-chart-hit.is-current {
  fill: var(--chart-tip-hit-current);
}
@media (hover: hover) {
  .ui-chart-hit:hover {
    fill: var(--chart-tip-hit-current);
  }
}
/* The ring on the drawing only after the keyboard, as on the grid's active cell: a tap shows the box and nothing else */
svg[data-chart-tips]:focus {
  outline: none;
}
:root[data-last-input="keyboard"] svg[data-chart-tips]:focus-visible {
  outline: var(--line-medium) solid var(--color-focus);
  outline-offset: var(--line-medium);
}
@media print {
  .ui-chart-tip {
    display: none !important;
  }
}

/* ---- The view switch (T2.70, Björn 1/11 via the pilot session, the layout sketch) ---- */
/* Views of the same content, as Diagram and Tabell in Per månad, are chosen with buttons of symbols that sit together:
   one frame with a divider between the buttons. Each button has its name as aria-label and title and says with
   aria-pressed whether it is the one shown; the chosen one has the toggles' dark fill and light symbol (--toggle-on-*, T2.93). The
   buttons are as dense as a row of actions with a mouse and the tap target with touch (--control-min), square. The
   symbols are drawn in the component as the side menu's icons (24 x 24, lines only, round ends). More views are more
   buttons. components.js sets aria-pressed and the view on the nearest [data-view-shown] round the switch. */
.ui-viewswitch {
  display: inline-flex;
  flex: none;
  border: var(--line-thin) solid var(--viewswitch-edge);
  border-radius: var(--viewswitch-radius);
  overflow: hidden;
  background: var(--viewswitch-surface);
}
/* Without JavaScript the buttons would do nothing, so the switch is not shown (G1 of #535); the content stands as its
   own rules say, as the chart's table under the chart. */
html:not([data-js]) .ui-viewswitch {
  display: none;
}
.ui-viewswitch-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--control-min);
  min-height: var(--control-min);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--viewswitch-symbol);
  cursor: pointer;
}
.ui-viewswitch-button + .ui-viewswitch-button {
  border-left: var(--line-thin) solid var(--viewswitch-edge);
}
.ui-viewswitch-button:hover {
  color: var(--viewswitch-symbol-hover);
}
.ui-viewswitch-button[aria-pressed="true"] {
  background: var(--viewswitch-on-surface);
  color: var(--viewswitch-on-symbol);
  box-shadow: inset 0 calc(-1 * var(--toggle-on-underline)) 0 var(--viewswitch-on-symbol);
}
.ui-viewswitch-button:focus-visible {
  outline: var(--line-medium) solid var(--color-focus);
  outline-offset: calc(-1 * var(--line-medium));
}
.ui-viewswitch-symbol {
  width: var(--viewswitch-size);
  height: var(--viewswitch-size);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--icon-line);
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Signals (T2.70, Björn 1/11 via the pilot session, the layout sketch's "Egen rad under") ---- */
/* What in a project needs attention, on a row of its own under the page's meta row: a reminder and not an alarm, so a
   coloured dot (yellow a warning, grey information) and calm text in the second colour of text, with no frame and no
   fill, and a date in a small third colour. Each is a link to what it is about, underlined at hover and focus. The text
   says what it is, and the tone is also said to a screen reader, so the colour is never the only sign. The tap target
   is the signals' own, --signal-target: 24 px with a mouse and 44 px with touch, and the rows are --signal-row-gap
   apart when they wrap. With touch, where there is no hover, a signal that is a link is underlined at rest
   (--signal-marker-touch, G1 of #535). */
.ui-signals {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--signal-row-gap) var(--signal-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.ui-signals > li {
  display: flex;
  min-width: 0;
}
.ui-signal {
  display: inline-flex;
  align-items: center;
  gap: var(--signal-dot-gap);
  font-size: var(--signal-size);
  font-weight: var(--weight-regular);
  color: var(--signal-text);
  text-decoration: none;
}
/* Only a signal that is a link is a tap target: a signal that is only text keeps its own line, as a row of text in the fact
   list does (the pilot session 9/11, T2.104). */
a.ui-signal {
  min-height: var(--signal-target);
  min-width: var(--signal-target);
}
.ui-signal::before {
  content: "";
  flex: none;
  width: var(--signal-dot);
  height: var(--signal-dot);
  border-radius: var(--radius-round);
  background: var(--signal-info);
}
.ui-signal-info::before {
  background: var(--signal-info);
}
.ui-signal-warning::before {
  background: var(--signal-warning);
}
.ui-signal .ui-source-stamp-by {
  margin: 0;
  padding: 0;
  border: 0;
  white-space: nowrap; /* "Ändrad 15 nov" stays one line, the label breaks instead */
}
.ui-signal-date {
  font-size: var(--signal-date-size);
  color: var(--signal-date);
  white-space: nowrap;
}
a.ui-signal:hover,
a.ui-signal:focus-visible {
  color: var(--signal-text-hover);
  text-decoration: underline;
  text-underline-offset: var(--space-1);
}
@media (any-pointer: coarse) {
  a.ui-signal {
    text-decoration-line: var(--signal-marker-touch);
    text-underline-offset: var(--space-1);
  }
}
a.ui-signal:focus-visible {
  outline: var(--line-medium) solid var(--color-focus);
  outline-offset: var(--space-1);
  border-radius: var(--radius-md);
}

/* ---- Edit bar (1b.1): what is edited, and Spara and Avbryt, which follow at the top when the view scrolls ---- */
.ui-editbar {
  position: sticky;
  top: var(--sticky-top);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4) var(--space-7);
  padding: var(--space-4) var(--space-6);
  background: var(--color-surface);
  border: var(--line-thin) solid var(--color-border);
}
.ui-editbar-editing {
  border-color: var(--color-action);
  border-top-width: var(--line-thick);
  box-shadow: var(--shadow-overlay);
}
.ui-editbar-status {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text);
}
/* A row of the view's own in the edit bar (P.0, the summary as the prototype's): the period's picker and Visa with the
   groups of columns, each with a word before it, beside the buttons. The picker's label is for a screen reader. */
.ui-editbar-period,
.ui-editbar-group {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
}
.ui-editbar-word {
  font-size: var(--text-sm);
  color: var(--color-text-2);
}
/* The bar's field of text before its buttons (1g.5a, the prototype's tpspar): its label beside it, and the field takes
   the row's room; the row wraps, so that on a narrow screen the buttons go under it, and the label wraps too, so that
   where the label and the field's least width do not fit beside each other (320 px, 1g.5b) the field goes under it
   and the page has no scroll to the side. */
.ui-editbar-comment {
  display: flex;
  flex-wrap: wrap;
  flex: 1 1 var(--editbar-comment-basis);
  align-items: center;
  gap: var(--space-4);
  margin: 0;
}
.ui-editbar-comment > .ui-input {
  flex: 1;
  min-width: var(--editbar-comment-min);
}
/* A status without text (the summary's open period, P.0) takes no place in the row. */
.ui-editbar-status:empty {
  display: none;
}
/* A plain bar (P.0, round 4): the actions as one row under the page's head, as the prototype's .bar, without the
   box, and the status for a screen reader only, since the head's line says it. Editing draws the box again. */
.ui-editbar-plain {
  position: static;
  padding: 0;
  border: 0;
  background: transparent;
  justify-content: flex-start;
}
/* Version beside its picker in the plain bar, as the prototype's "Version [Aktuell (levande)]" (P.0, round 5), and in
   the page's head the forecast's Bokfört t.o.m. beside its field, as the prototype's .head .bar (P.0, the forecast's
   round 5); on a phone the label stays above. The head's Version is a value picker since P.0.15, and the living
   budget's Lås som a menu button. */
@media (min-width: 600px) {
  .ui-editbar-plain [data-version-form] > .ui-picker,
  .ui-page-head [data-version-form] > .ui-field {
    flex-direction: row;
    align-items: center;
    gap: var(--space-4);
  }
  .ui-editbar-plain [data-version-form] .ui-field-label,
  .ui-page-head [data-version-form] .ui-field-label {
    white-space: nowrap;
  }
}
.ui-editbar-plain > .ui-editbar-status {
  position: absolute;
  width: var(--line-thin);
  height: var(--line-thin);
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* The plain bar with its status shown (plain and status_visible, T19.2.2, K84 fråga 4): as the plain bar, no frame and
   no shadow also while editing, and the status after the buttons, visible, as the count of unsaved changes with a dot in
   the unsaved colour. An empty status keeps its place in the tree, so that a screen reader hears the count when it
   comes. The fixed variant, which follows at the top of a long form, waits for K118. */
.ui-editbar.ui-editbar-plain-status {
  border: 0;
  box-shadow: none;
}
.ui-editbar-plain.ui-editbar-plain-status > .ui-editbar-status {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: var(--editbar-status-shown-gap);
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  white-space: normal;
  font-size: var(--editbar-status-shown-size);
  color: var(--editbar-status-shown-text);
}
.ui-editbar-plain-status > .ui-editbar-status:not(:empty)::before {
  content: "";
  flex: none;
  width: var(--editbar-status-shown-dot);
  height: var(--editbar-status-shown-dot);
  border-radius: 50%;
  background: var(--editbar-status-shown-dot-color);
}

/* ---- Grid (1b.1, decision 0005): the heavy views' spreadsheet ---- */
/* The grid scrolls in a box of its own, so that the header row stays at the top and the first column at the left
   when it scrolls in both directions (decision 0005, Krav på vyerna). Not on a phone: the heavy views show the sums
   there (granskningslistan, Mobil, iPad och pekskärm). */
.ui-grid-scroll {
  max-height: var(--grid-frame-max);
  overflow: auto;
  overscroll-behavior: contain;
  border: var(--line-thin) solid var(--color-border);
  background: var(--color-surface);
}
.ui-grid-table td,
.ui-grid-table th {
  white-space: nowrap;
}
/* The grid's header row sticks in the grid's own box, which the tabs are not over. */
.ui-grid-table th {
  top: 0;
}
.ui-grid-table th.ui-num {
  white-space: normal;
}
.ui-grid-table td:first-child,
.ui-grid-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--color-surface);
  white-space: normal;
}
.ui-grid-table thead th:first-child {
  z-index: 3;
}
.ui-grid-table td.ui-grid-cell {
  position: relative;
  box-sizing: border-box;
  height: var(--target-min); /* a tap target of 44 px in every width (T2.7), with a mouse too */
  padding-top: 0;
  padding-bottom: 0;
  cursor: default;
}
/* A cell one may write in, while editing and, in the forecast, while reading too (P.0): the cell's own token, which the
   living budget shares. */
.ui-grid-table td.ui-grid-cell-editable {
  background: var(--color-cell-editable);
}
/* An amount that opens what it is made of (1b.3): a link over the whole cell, so that a tap anywhere in it opens it
   with a finger, underlined so that it is seen without hovering. A negative one stays red. */
.ui-grid-table td > a.ui-grid-link {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  height: 100%;
  min-height: var(--target-min);
  min-width: var(--target-min); /* a short amount in a ledger's narrow column is a tap target too (T2.7) */
  color: inherit;
  text-decoration: none;
  -webkit-user-drag: none;
}
/* That the amount opens is said by a small arrow before it in the link's colour, as the prototype's ▸, and not by an
   underlined figure (the table's rule, P.0 round 2); seen without hovering, so that it holds on an iPad too. The
   figure takes the link's colour when the pointer is over it or the cell has the focus. */
.ui-grid-table td > a.ui-grid-link::before {
  content: "";
  flex: none;
  border-top: var(--space-2) solid transparent;
  border-bottom: var(--space-2) solid transparent;
  border-left: var(--space-3) solid var(--color-link);
}
.ui-grid-table td > a.ui-grid-link:hover,
.ui-grid-table td.ui-grid-cell-active > a.ui-grid-link {
  color: var(--color-link);
}
.ui-grid-table td.ui-neg > a.ui-grid-link {
  color: inherit;
}
/* In the dense variants, the ledger and the summary's sheet, an amount that opens has no mark at rest, neither the arrow
   nor a line, since nearly every cell opens and a mark there would say nothing (the pilot session 1/11, round 5); the
   pointer is a hand, and a line comes under the figure at hover and on the active cell after the keyboard (round 8)
   (--drill-marker). The arrow stays in cards, lists and the grids that are not dense (T2.43). A line at rest in the
   summary says where a figure comes from (--source-marker), as the prototype's. */
.ui-grid-dense .ui-grid-table td > a.ui-grid-link::before,
.ui-grid-ledger .ui-grid-table td > a.ui-grid-link::before {
  content: none;
}
.ui-grid-dense .ui-grid-table td > a.ui-grid-link,
.ui-grid-ledger .ui-grid-table td > a.ui-grid-link {
  min-width: var(--target-min); /* a short figure, as "5 000", is still a tap target without the arrow (T2.7) */
  cursor: pointer;
  text-underline-offset: var(--drill-marker-offset);
}
.ui-grid-dense .ui-grid-table td > a.ui-grid-link:hover,
.ui-grid-dense .ui-grid-table td > a.ui-grid-link:focus-visible,
:root[data-last-input="keyboard"] .ui-grid-dense .ui-grid-table:focus-within td.ui-grid-cell-active > a.ui-grid-link,
.ui-grid-ledger .ui-grid-table td > a.ui-grid-link:hover,
.ui-grid-ledger .ui-grid-table td > a.ui-grid-link:focus-visible,
:root[data-last-input="keyboard"] .ui-grid-ledger .ui-grid-table:focus-within td.ui-grid-cell-active > a.ui-grid-link {
  text-decoration: var(--drill-marker);
}
/* With touch, and on a computer that also has a touch screen (pointer: coarse or any-pointer: coarse, as #499's table):
   an amount that opens has the colour of a link (--drill-marker-touch), without a line and without the arrow, in every
   grid, since there is no hover to show it (the pilot session 1/11, level 2). A negative amount stays red. */
@media (pointer: coarse), (any-pointer: coarse) {
  .ui-grid-table td > a.ui-grid-link,
  .ui-grid-dense .ui-grid-table td > a.ui-grid-link:hover,
  .ui-grid-ledger .ui-grid-table td > a.ui-grid-link:hover {
    color: var(--drill-marker-touch);
    text-decoration: none;
  }
  .ui-grid-table td > a.ui-grid-link::before {
    content: none;
  }
}
/* A sum row's link is in the tab order: its own focus ring, as a cell's. */
.ui-grid-table td > a.ui-grid-link:focus-visible {
  outline: var(--line-medium) solid var(--color-focus);
  outline-offset: calc(-1 * var(--line-medium));
}
/* A comment under the amount (P.0, the living budget's 3 Manuellt while one reads), as the prototype's, which wraps. */
.ui-grid-table td.ui-grid-cell-sub {
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}
.ui-grid-table td.ui-grid-cell-sub .ui-grid-note {
  display: block;
  max-width: var(--grid-sub-max);
  margin-left: auto;
  white-space: normal;
  text-align: right;
}
.ui-grid-table td.ui-grid-cell-selected {
  background: var(--color-action-soft);
}
/* The page's own ring (:focus-visible) is not drawn on a grid's cells or table, which take the focus by script. */
.ui-grid-table:focus-visible,
.ui-grid-table td.ui-grid-cell:focus-visible {
  outline: none;
}
/* The active cell's ring, only after the keyboard and while the grid has the focus (P.0 round 8): data-last-input on <html>
   is the design system's own record of the last input (components.js), since :focus-visible is not reliable on a
   cell the grid focuses by script. After the page has loaded or a cell is clicked there is no ring. */
:root[data-last-input="keyboard"] .ui-grid-table:focus-within td.ui-grid-cell-active {
  outline: var(--line-medium) solid var(--color-focus);
  outline-offset: calc(-1 * var(--line-medium));
}
/* Not saved yet: a corner flag, as an unsaved field has (granskningslistan: hörnflik och prick). */
.ui-grid-table td.ui-grid-cell-unsaved::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-style: solid;
  border-width: 0 var(--corner-flag) var(--corner-flag) 0;
  border-color: transparent var(--color-unsaved) transparent transparent;
}
/* An adjusted amount with a note (1d.1.2, #430): a corner in the cell's lower right, by its own amount and away from
   the neighbouring column's figure (G2 of 1d.1.2, B3), under the unsaved flag's upper right and in another colour, so
   that it is told by its place and shape and never by colour alone. The note itself stands in Kommentar on the same
   row, so nothing needs hovering; a screen reader reads the grid's description of the mark (aria-describedby). */
.ui-grid-table td.ui-grid-cell-noted::before {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  border-style: solid;
  border-width: var(--corner-flag) var(--corner-flag) 0 0;
  border-color: transparent var(--color-text-2) transparent transparent;
}
.ui-grid-table td.ui-grid-cell-editing {
  padding-right: 0;
}
.ui-grid-editor {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: var(--target-min);
}
/* In a ledger the columns are narrow (the prototype's rhythm): the editor never widens its column, which would move the
   rows under the finger between the tap that opens it and the mouse event that follows (P.0, round 3). Its width is
   the cell's, and it adds nothing to the column's width (width 0 and min-width 100 %). */
.ui-grid-ledger .ui-grid-editor {
  width: 0;
  min-width: 100%;
}
.ui-grid-table .ui-grid-forecast {
  font-weight: var(--weight-heading);
}
.ui-grid-table .ui-grid-under {
  color: var(--color-positive-text);
  font-weight: var(--weight-strong); /* marin: a positive deviation as clear as a negative one */
}
.ui-grid-table .ui-grid-reference {
  color: var(--color-text-3);
}
.ui-grid-table .ui-grid-auto td {
  color: var(--color-text-2);
}
/* A group row's heading (P.0) stays at the left when the grid scrolls sideways, as the prototype's: the cell spans every
   column, so its text sticks in it. */
.ui-grid-group-name {
  position: sticky;
  left: var(--space-6);
}
.ui-grid-table .ui-grid-group td {
  font-family: var(--font-display);
  font-weight: var(--weight-heading);
  font-size: var(--text-md); /* marin: a size smaller, the weight carries it */
  padding-top: var(--space-7);
  border-bottom-color: var(--color-border);
}
.ui-grid-table .ui-grid-subtotal td {
  font-weight: var(--weight-heading);
  border-bottom: var(--line-thin) solid var(--color-border-strong);
}
.ui-grid-table .ui-grid-total td {
  font-family: var(--font-display);
  font-weight: var(--weight-heading);
  font-size: var(--text-lg);
  border-top: var(--line-medium) solid var(--color-border-strong);
}
.ui-grid-note {
  margin-left: var(--space-4);
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  font-size: var(--text-xs);
  color: var(--color-text-3);
}
/* The source of a row in the summary's name column (1e.3, marin): a small mark that floats right on the first line,
   so that the name wraps under it and the mark never stands on a line of its own. Only the note in the fixed name
   column; notes in group rows are as before. */
.ui-grid-table td.ui-grid-fixed-3 .ui-grid-note {
  float: right;
  margin-left: var(--space-4);
  margin-top: var(--space-1);
  padding: 0 var(--space-2);
  border: var(--line-badge) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  font-size: var(--text-col-head); /* as the column headings */
  font-weight: var(--weight-strong);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--color-text-2);
  white-space: nowrap;
}
/* The source's colour, from data-source on the note (prognos, lb, inlast, excel, utkast or angivet). Not by colour
   alone: the text says the source, and a draft has a dashed edge. Without the attribute the mark is neutral. The td in
   the selectors gives them the name column rule's weight, which they follow and so win over. */
.ui-grid-table td .ui-grid-note[data-source="prognos"] {
  border-color: var(--color-positive-text);
  color: var(--color-positive-text);
  background: var(--color-positive-soft);
}
.ui-grid-table td .ui-grid-note[data-source="lb"] {
  border-color: var(--color-action);
  color: var(--color-action);
  background: var(--color-action-soft);
}
.ui-grid-table td .ui-grid-note[data-source="utkast"] {
  border-style: dashed;
  border-color: var(--color-warning-text);
  color: var(--color-warning-text);
  background: var(--color-warning-soft);
}
.ui-grid-table td .ui-grid-note[data-source="angivet"] {
  border-color: transparent;
  color: var(--color-action);
  background: var(--color-editable);
}
/* excel and inlast: the neutral mark, with a darker edge and text */
.ui-grid-table td .ui-grid-note[data-source="excel"],
.ui-grid-table td .ui-grid-note[data-source="inlast"] {
  border-color: var(--color-text-2);
  color: var(--color-text);
}
/* A status badge in the grid, small in a dense grid. */
.ui-grid-table .ui-badge {
  margin-left: var(--space-4);
  font-size: var(--text-col-head); /* as the column headings */
  letter-spacing: var(--tracking-caps);
  vertical-align: middle;
}
.ui-grid-row-actions {
  display: inline-flex;
  gap: var(--space-2);
  margin-left: var(--space-3);
  vertical-align: middle;
}
.ui-grid-row-actions .ui-button {
  min-width: var(--target-min);
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}
.ui-grid-table .ui-grid-adding td {
  background: var(--color-surface-2);
  white-space: normal;
}
/* The leading columns that stay at the left beside the first when the grid scrolls sideways (1e.6, the summary's Nr,
   Ansv and Namn): fixed widths, so that each one's offset is the sum of those before it. */
.ui-grid-table td.ui-grid-fixed,
.ui-grid-table th.ui-grid-fixed {
  position: sticky; /* also on a cell of a data row, which is otherwise relative (td.ui-grid-cell) */
  z-index: 1;
  box-sizing: border-box;
  background: var(--color-surface);
}
.ui-grid-table thead .ui-grid-fixed {
  z-index: 3;
}
.ui-grid-table .ui-grid-fixed-1 {
  left: 0;
}
.ui-grid-table .ui-grid-fixed-1:not([colspan]) {
  width: var(--grid-fixed-1);
  min-width: var(--grid-fixed-1);
  max-width: var(--grid-fixed-1);
}
.ui-grid-table .ui-grid-fixed-2 {
  left: var(--grid-fixed-1);
  width: var(--grid-fixed-2);
  min-width: var(--grid-fixed-2);
  max-width: var(--grid-fixed-2);
  white-space: normal;
}
.ui-grid-table .ui-grid-fixed-3 {
  left: calc(var(--grid-fixed-1) + var(--grid-fixed-2));
  width: var(--grid-fixed-3);
  min-width: var(--grid-fixed-3);
  max-width: var(--grid-fixed-3);
}
/* The edge where the grid's fixed part ends (P.0.14, Björn 2/11): after the last fixed column (Namn, the summary's
   ui-grid-fixed-3), or after the first column of a grid without fixed ones (the forecast's and the living budget's),
   only while the box is scrolled sideways (is-scrolled-x, components.js), so that it marks what lies under it and is
   never a line of its own on a grid that has not scrolled. */
.ui-grid-scroll.is-scrolled-x .ui-grid-table .ui-grid-fixed-3,
.ui-grid-scroll.is-scrolled-x .ui-grid-table:not(:has(.ui-grid-fixed)) :is(td, th):first-child {
  box-shadow: var(--grid-fixed-edge);
}
.ui-grid-table td.ui-grid-cell-editable.ui-grid-fixed {
  background: var(--color-cell-editable);
}
.ui-grid-table td.ui-grid-cell-selected.ui-grid-fixed {
  background: var(--color-action-soft);
}
/* A long text in a cell wraps and the row grows (the summary's Namn and Anmärkning). */
.ui-grid-table td.ui-grid-wrap {
  white-space: normal;
  overflow-wrap: break-word;
}
.ui-grid-table .ui-grid-wide {
  min-width: var(--grid-remark-min);
}
/* A dense grid: the smaller text and air of a sheet with many columns (the summary, 1e.6), which fits 1440 px without
   scrolling sideways; the cells keep the tap target's height. */
.ui-grid-dense .ui-grid-table {
  font-size: var(--text-xs);
}
.ui-grid-dense .ui-grid-table td,
.ui-grid-dense .ui-grid-table th {
  padding-right: var(--space-3);
}
.ui-grid-dense .ui-grid-table .ui-grid-group td,
.ui-grid-dense .ui-grid-table .ui-grid-total td {
  font-size: var(--text-sm);
}
/* A ledger (P.0): the prototype's levande budget, row for row. A cost centre is a heading row in bold with its number
   and name and no amounts, with air over it; its accounts stand indented under it, where a name wraps; its sum is bold
   with a line over it. A zero is grey, and a mark after an amount says where it comes from, in capitals as the
   prototype's. The sizes are the grid's rhythm tokens (tokens.css, --grid-*), for the forecast to take as well. */
.ui-grid-ledger .ui-grid-table {
  font-size: var(--text-grid);
}
.ui-grid-ledger .ui-grid-table td,
.ui-grid-ledger .ui-grid-table th {
  padding-right: var(--grid-cell-pad-x);
}
.ui-grid-ledger .ui-grid-table td.ui-grid-cell {
  height: var(--grid-row-min);
}
/* With a mouse the rows of a dense variant are as low as the prototype's (--grid-row-min-fine, Björn 31/10); with touch
   they keep the tap target (T2.7, pointer: coarse). The link fills the cell, as with a finger. */
@media (pointer: fine) {
  .ui-grid-dense .ui-grid-table td.ui-grid-cell,
  .ui-grid-ledger .ui-grid-table td.ui-grid-cell {
    height: var(--grid-row-min-fine);
  }
  .ui-grid-dense .ui-grid-table td > a.ui-grid-link,
  .ui-grid-ledger .ui-grid-table td > a.ui-grid-link {
    min-height: var(--grid-row-min-fine);
  }
  .ui-grid-dense .ui-grid-editor,
  .ui-grid-ledger .ui-grid-editor {
    height: var(--grid-row-min-fine); /* the row keeps its height while a cell is written in */
  }
}
.ui-grid-ledger .ui-grid-table td:first-child {
  min-width: var(--grid-name-min);
}
.ui-grid-ledger .ui-grid-table .ui-grid-group td {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-grid-group);
  padding-top: var(--grid-group-space);
  padding-bottom: var(--grid-cell-pad-y);
  border-bottom: var(--line-thin) solid var(--color-border);
}
/* A heading row that opens a part of the ledger, as the forecast's Kostnader per kostnadsställe: more air over it and a
   heavier line under it, as the prototype's tr.grp with padding-top 26 px and border-bottom 2 px (P.0, round 3). */
.ui-grid-ledger .ui-grid-table .ui-grid-section td {
  padding-top: calc(var(--grid-group-space) + var(--space-4));
  border-bottom: var(--line-medium) solid var(--color-border-strong);
}
.ui-grid-ledger .ui-grid-table td.ui-grid-indent {
  padding-left: calc(var(--space-6) + var(--grid-indent));
  color: var(--color-text-2);
}
/* The air between two sums in the ledger (the living budget and the forecast) is at least --grid-sum-gap (P.0 round 6): the
   cell's own air after the figure and the rest before it, so that the right edge stays under the heading's. The summary's
   sheet has --grid-sheet-sum-gap (T2.51c). */
.ui-grid-ledger .ui-grid-table .ui-grid-subtotal td.ui-num,
.ui-grid-ledger .ui-grid-table .ui-grid-total td.ui-num {
  padding-left: calc(var(--grid-sum-gap) - var(--grid-cell-pad-x));
}
.ui-grid-ledger .ui-grid-table .ui-grid-subtotal td,
.ui-grid-ledger .ui-grid-table .ui-grid-total td {
  font-weight: var(--weight-bold);
  padding-top: var(--grid-cell-pad-y);
  padding-bottom: var(--grid-cell-pad-y);
  border-top: var(--line-thin) solid var(--color-border-strong);
  border-bottom: var(--line-thin) solid var(--color-border);
}
.ui-grid-ledger .ui-grid-table .ui-grid-total td {
  border-top-width: var(--line-medium);
}
/* Senaste on a total is small and regular in its grey, as the prototype's muted 13 px beside the forecast (P.0). */
.ui-grid-ledger .ui-grid-table .ui-grid-total td.ui-grid-reference {
  font-weight: var(--weight-regular);
  font-size: var(--text-sm);
}
/* The line over a sum is the only one: the row over it has none, as in the prototype's collapsed borders. */
.ui-grid-ledger .ui-grid-table tr:has(+ .ui-grid-subtotal) td {
  border-bottom-color: transparent;
}
.ui-grid-ledger .ui-grid-table td.ui-grid-zero {
  color: var(--color-text-3);
}
.ui-grid-ledger .ui-grid-table .ui-grid-note {
  font-size: var(--text-grid-sub);
}
.ui-grid-ledger .ui-grid-table td.ui-grid-cell-sub .ui-grid-note {
  margin-left: auto;
}
/* A mark after an amount or a name (auto, 1 inköp, tillagd), as the prototype's: capitals without the badge's dot and
   edge; the words say it, never the colour alone. A linked amount with a mark keeps the mark on its line. */
.ui-grid-ledger .ui-grid-table .ui-badge,
.ui-ledger-section .ui-table .ui-badge {
  margin-left: var(--space-3);
  padding: 0 var(--space-3);
  border-color: transparent;
  font-size: var(--text-col-head);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
.ui-grid-ledger .ui-grid-table .ui-badge::before,
.ui-ledger-section .ui-table .ui-badge::before {
  content: none;
}
.ui-grid-table td.ui-grid-cell-badged > a.ui-grid-link {
  display: inline-flex;
  vertical-align: middle;
}
/* A mark under the amount, at the cell's right edge. */
.ui-grid-table td.ui-grid-cell-stacked {
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}
/* The link keeps the tap target's height (T2.7), and the cell grows with the text under it. */
.ui-grid-table td.ui-grid-cell-stacked > a.ui-grid-link,
.ui-grid-table td.ui-grid-cell-sub > a.ui-grid-link {
  height: auto;
}
.ui-grid-table td.ui-grid-cell-stacked > .ui-badge {
  display: flex;
  width: max-content;
  margin-left: auto;
}
/* An amount that waits for attestation, as the prototype's td.ejatt: the warning's tone, and its mark says it. */
.ui-grid-table td.ui-grid-cell-warning {
  background: var(--color-warning-soft);
  color: var(--color-warning-text);
}
/* A sub heading of a ledger's page, as Intäkter and Kostnader: air over it and a little under, as the prototype's h3. */
.ui-ledger-section {
  margin-top: calc(var(--grid-heading-before) - var(--space-7)); /* over the island's gap between its parts */
}
.ui-ledger-section > h2,
.ui-ledger-section .ui-table > caption {
  margin: 0;
  padding-bottom: var(--grid-heading-after);
}
/* The prototype's h3 over its tables, in bold: Intäkter, Kostnader and Inköp mot budget. */
.ui-ledger-section > h2,
.ui-ledger-section .ui-table > caption,
.ui-ledger-panel .ui-panel > h2,
h2.ui-ledger-heading {
  font-size: var(--text-grid-heading);
  font-weight: var(--weight-bold);
}
/* The smaller sub headings of a ledger's page, as the forecast's Justeringar intäkter, Justeringar kostnader and
   Försättsblad (P.0, round 3): the prototype's h3 in 16 px, with what it does after it in a smaller, regular grey
   (ui-heading-note), air over and a little under; a short text under it is small and grey, as the prototype's note. */
.ui-ledger-minor h3 {
  font-size: var(--text-lg);
  padding-bottom: var(--grid-heading-after);
}
.ui-ledger-minor > * + * {
  margin-top: var(--grid-heading-before);
}
.ui-ledger-minor p {
  margin: 0;
  font-size: var(--text-sm);
}
.ui-ledger-minor .ui-actions {
  margin-top: var(--grid-heading-after);
}
.ui-heading-note {
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  font-size: var(--text-xs);
  letter-spacing: normal;
  color: var(--color-text-2);
}
/* In a view of the island the heading and its grid are parts with the island's gap: the gap is the air under it. */
.ui-island > .ui-ledger-section[data-view]:not([hidden]) {
  gap: var(--grid-heading-after);
}
.ui-island > .ui-ledger-section[data-view] > h2 {
  padding-bottom: 0;
}
/* Where a figure comes from (the prototype's in, auto, fromprog and draft): written by the management, counted because
   nothing is written, from the project's version, or a draft's that is not locked. Not by colour alone. */
.ui-grid-table td.ui-grid-given {
  background: var(--color-editable);
  font-weight: var(--weight-medium);
}
.ui-grid-table td.ui-grid-derived {
  font-style: italic;
  color: var(--color-text-2);
}
/* A negative figure that is counted stays red on the screen, as every negative amount (G2 on #319); the printout's
   figures are black (the pilot session 24/10). */
.ui-grid-table td.ui-grid-derived.ui-neg {
  color: var(--color-negative-amount);
}
/* Where a figure comes from, as the prototype's td.fromprog and td.draft (P.0 round 5, --source-marker): a figure from
   the project's forecast dotted, a draft's dashed and in the warning's text colour (a negative one stays red). */
.ui-grid-table td.ui-grid-from-version {
  text-decoration: var(--source-marker);
  text-underline-offset: var(--source-marker-offset);
}
.ui-grid-table td.ui-grid-draft {
  color: var(--color-warning-text);
  text-decoration: var(--source-marker-draft);
  text-underline-offset: var(--source-marker-offset);
}
.ui-grid-table td.ui-grid-draft.ui-neg {
  color: var(--color-negative-amount);
}
.ui-grid-table .ui-grid-changed td:first-child {
  box-shadow: inset var(--line-thick) 0 0 0 var(--color-warning);
}
/* A heading over a run of columns (groups, P.0): the summary's Hela projektet, Omsättning per år, Successiv
   vinstavräkning and Jämförelse, as the customer's sheet and the prototype have them, in a row of its own above the
   column headings. The row scrolls away with the grid, and the column headings stay at the top. Each heading is a band
   over its columns, with air between the bands, so that the groups are seen apart. */
.ui-grid-table .ui-grid-groups > th,
.ui-grid-table .ui-grid-groups > td {
  position: static;
  padding: var(--space-3) 0 0 0;
  border-bottom: 0;
}
.ui-grid-table .ui-grid-groups > td.ui-grid-fixed {
  position: sticky;
}
.ui-grid-table .ui-grid-groups > th.ui-grid-group-head {
  text-align: center;
  vertical-align: bottom;
}
.ui-grid-group-label {
  display: block;
  margin-right: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-bottom: var(--line-medium) solid var(--color-border-strong);
  background: var(--color-surface-2);
  color: var(--color-text-2);
  white-space: normal; /* a long heading wraps rather than widen its columns */
}
/* In the summary's sheet a negative figure in the column that is only there to compare with (ui-grid-reference) stays
   red, as every negative amount there. */
.ui-grid-dense .ui-grid-table td.ui-grid-reference.ui-neg {
  color: var(--color-negative-amount);
}
/* The summary's closing row, Slutlig omsättning och resultat (P.0): the year's figures, set apart from the sums above
   them by a band and a thick line in the colour of action, as the prototype's last row. */
.ui-grid-table .ui-grid-closing td,
.ui-grid-table .ui-grid-closing td.ui-grid-fixed {
  background: var(--color-surface-2);
  border-top: var(--line-thick) solid var(--color-action);
  padding-top: var(--space-5);
  padding-bottom: var(--space-5);
}
/* The summary's sheet (ui-grid-sheet, P.0): the prototype's table.sva, ported (dashboard_mall.html ba101fe, Björn 31/10
   "portera, tolka inte"). The bands over the groups of columns in the colour of action's soft surface, the column
   headings over a thick line, the headings Kommande projekt and Interna projekt in bold with the tag "anges här", the
   remark small and grey, Diff as a green or red cell with its sign, the sum row on the second surface under a thick
   line, and the closing row on action's soft surface under a thick line in action's colour, with the sheet's reminder
   after the figures. */
/* Less air after a cell than the dense grid's, so that the sheet with Källa still fits 1440 px without scrolling sideways
   (1e.6, P.0 round 4), --grid-sheet-cell-gap (tokens.css). */
.ui-grid-sheet .ui-grid-table td,
.ui-grid-sheet .ui-grid-table th {
  padding-right: var(--grid-sheet-cell-gap);
}
.ui-grid-sheet .ui-grid-table .ui-grid-groups > th,
.ui-grid-sheet .ui-grid-table .ui-grid-groups > td {
  padding: 0 0 var(--space-3) 0;
}
.ui-grid-sheet .ui-grid-group-label {
  margin-right: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 0;
  border-radius: var(--radius-sm);
  background: var(--color-action-soft);
  color: var(--color-text);
}
.ui-grid-sheet .ui-grid-group-label {
  white-space: nowrap; /* on one line over its columns, as the prototype's */
}
/* A heading breaks only where the view says (a line break in its label, as the prototype's <br>), so that it is at
   most two lines in every width (Björn 31/10 kväll). */
.ui-grid-sheet .ui-grid-table thead tr:last-child th {
  letter-spacing: var(--tracking-sheet-head); /* round 10: room for 1440 px */
  white-space: pre;
  border-bottom: var(--line-medium) solid var(--color-border-strong);
}
/* A thin line between the column headings (--grid-head-divider), inside the cell's own air and so without width; not after
   the last heading, nor after Namn, which has its own line (--grid-fixed-3), and not on the bands or the data cells. */
.ui-grid-sheet .ui-grid-table thead tr:last-child th:not(:last-child, .ui-grid-fixed-3) {
  box-shadow: inset calc(-1 * var(--line-thin)) 0 0 0 var(--grid-head-divider);
}
/* Air before a left-aligned column heading (--grid-head-indent), in the heading row only; those columns' widths are fixed or set by their content. The first column keeps a table's own air. */
.ui-grid-sheet .ui-grid-table thead tr:last-child th:not(.ui-num, :first-child) {
  padding-left: var(--grid-head-indent);
}
.ui-grid-sheet .ui-grid-table .ui-grid-group td {
  padding-top: var(--space-7);
  font-size: var(--text-sheet-group);
  font-weight: var(--weight-bold);
  border-bottom: var(--line-thin) solid var(--color-border);
}
.ui-grid-sheet .ui-grid-table .ui-grid-group .ui-grid-note {
  display: inline-block;
  margin-left: var(--space-4);
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--color-action-soft);
  color: var(--color-action);
  font-family: var(--font-body);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  vertical-align: var(--space-1);
}
/* A group's note that is a source's mark (data-source="excel"): the upcoming rows of a version read in from the
   customer's sheet, which are not written here, in the neutral tone of Källa's Excel and not the action's (1e.1a). */
.ui-grid-sheet .ui-grid-table .ui-grid-group .ui-grid-note[data-source="excel"] {
  background: var(--color-surface-2);
  color: var(--color-text);
  box-shadow: inset 0 0 0 var(--line-badge) var(--color-text-2);
}
/* A name on one line, clipped with an ellipsis at its column's fixed width, the whole name in the cell's title (round 8). */
.ui-grid-sheet .ui-grid-table td.ui-grid-clip {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
/* A wide sheet yields in its text columns (T2.69): Namn and Anmärkning, which are clipped with an ellipsis, shrink from
   their widths (--grid-fixed-3, --grid-remark-max) to their floors (--grid-name-floor, --grid-remark-floor) before
   anything scrolls sideways. An amount or a percentage is never clipped: its column keeps its content's width. A clipped
   cell has max-width 0, so that its text does not count for the width the table needs; its width and floor decide. */
.ui-grid-sheet .ui-grid-table td.ui-grid-clip.ui-grid-fixed-3,
.ui-grid-sheet .ui-grid-table th.ui-grid-fixed-3 {
  min-width: var(--grid-name-floor);
}
.ui-grid-sheet .ui-grid-table td.ui-grid-clip.ui-grid-fixed-3 {
  max-width: 0;
}
.ui-grid-sheet .ui-grid-table th.ui-grid-fixed-3 {
  max-width: none;
}
/* Anmärkning's wanted width sits on its heading (ui-grid-remark-head, which the sheet's model gives the column of COL.remark),
   because a cell with max-width 0 has no width of its own. */
.ui-grid-sheet .ui-grid-table thead th.ui-grid-remark-head {
  width: var(--grid-remark-max);
  min-width: var(--grid-remark-floor);
}
.ui-grid-sheet .ui-grid-table td.ui-grid-remark {
  min-width: var(--grid-remark-floor);
  max-width: 0;
  overflow: hidden;
  font-size: var(--text-2xs);
  color: var(--color-text-2);
  white-space: nowrap;
  text-overflow: ellipsis; /* the whole text in the cell's title, as the prototype's td.anm (round 7) */
}
.ui-grid-sheet .ui-grid-table td.ui-grid-diff.ui-grid-under {
  background: var(--color-positive-soft);
  color: var(--color-positive-text);
  font-weight: var(--weight-bold);
}
.ui-grid-sheet .ui-grid-table td.ui-grid-diff.ui-neg {
  background: var(--color-error-soft);
  color: var(--color-negative-amount);
  font-weight: var(--weight-bold);
}
.ui-grid-sheet .ui-grid-table tfoot td {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}
/* The sums in bold are wide: air before each figure, so that with its neighbour's air after (--grid-sheet-cell-gap) two figures
   stand at least --grid-sheet-sum-gap apart (round 6, T2.51c), while its right edge stays under its heading's (round 7). */
.ui-grid-sheet .ui-grid-table tfoot td.ui-num,
.ui-grid-sheet .ui-grid-table tfoot td.ui-grid-mute {
  padding-left: calc(var(--grid-sheet-sum-gap) - var(--grid-sheet-cell-gap));
}
.ui-grid-sheet .ui-grid-table tfoot tr[data-total="sums"] td {
  border-top: var(--line-medium) solid var(--color-border-strong);
  background: var(--color-surface-2);
}
.ui-grid-sheet .ui-grid-table .ui-grid-closing td,
.ui-grid-sheet .ui-grid-table .ui-grid-closing td.ui-grid-fixed {
  background: var(--color-action-soft);
  font-size: var(--text-md); /* the prototype's 15 px; --text-lg does not fit 1440 px with the rest (round 7) */
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}
.ui-grid-sheet .ui-grid-table td.ui-grid-mute {
  color: var(--color-text-3);
  white-space: normal;
}
/* A number in a column of its own that opens its page (P.0), as the table's number link (T2.42): the link's colour, and
   the underline at hover and focus. */
.ui-grid-table a.ui-number-link {
  color: var(--color-link);
  font-weight: var(--number-link-weight);
  text-decoration: none;
}
.ui-grid-table a.ui-number-link:hover,
.ui-grid-table a.ui-number-link:focus-visible {
  text-decoration: underline;
}
/* What the rows of a sheet are based on, under its row of buttons (the summary's, the prototype's svaund, P.0): a
   line of small text, with the part that warns in bold in the warning's text colour. */
.ui-grid-basis {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-2);
}
.ui-grid-basis-warning {
  color: var(--color-warning-text);
}
/* The marks of a sheet's sources under it, each with its name (the prototype's legend2, P.0): the mark as the rows
   show it, and the version's figure with its dotted line. What they mean is said in a note, never only at hover. */
.ui-grid-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-7);
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-text-2);
}
.ui-grid-legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}
/* A legend's sample, as the prototype's .lgs: the word of the column Källa in a small frame, a draft's in the warning's
   colour with a dashed line under it, and the version's figure with its dotted line. */
.ui-grid-legend-mark {
  padding: 0 var(--space-2);
  border: var(--line-badge) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-2xs);
  font-variant-numeric: tabular-nums;
}
.ui-grid-legend-mark[data-source="utkast"] {
  color: var(--color-warning-text);
  text-decoration: var(--source-marker-draft);
  text-underline-offset: var(--source-marker-offset);
}
.ui-grid-legend-mark[data-source="version"] {
  text-decoration: var(--source-marker);
  text-underline-offset: var(--source-marker-offset);
}
/* Källa, a column of its own after Namn (P.0 round 4), as the prototype's td.src: small grey text on one line, and a
   draft's in the warning's text colour and bold. */
.ui-grid-table td.ui-grid-source {
  font-size: var(--text-2xs);
  color: var(--color-text-2);
  white-space: nowrap;
}
.ui-grid-table td.ui-grid-source.ui-grid-source-draft {
  color: var(--color-warning-text);
  font-weight: var(--weight-bold);
}
/* Every other row of a dense sheet tinted, so that a row is followed across eighteen columns (the prototype's, Jesper
   22/10). The cells a figure is written in, the selected and the given keep their own surface. */
.ui-grid-dense :where(tbody > tr:nth-child(even)) > td {
  background: var(--color-surface-2);
}
.ui-grid-dense :where(tbody > tr:nth-child(even)) > td.ui-grid-fixed:where(:not(.ui-grid-given, .ui-grid-cell-editable, .ui-grid-cell-selected)) {
  background: var(--color-surface-2);
}
/* The keyboard on an iPad opens only for a field focused in the tap itself (frontend/forecast/dom.ts). */
.ui-grid-keyboard-catcher {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--space-1);
  height: var(--space-1);
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: var(--text-field);
  pointer-events: none;
}
/* The interactive chart of a heavy view (ECharts, loaded when shown, decision 0005). Every touch lands on the
   chart's own element, never on a bar, so that two fingers on two bars zoom (found in trial PV2). */
.ui-chart-box {
  width: 100%;
  height: calc(var(--space-11) * 9);
  background: var(--color-surface);
}
.ui-chart-box svg {
  pointer-events: none;
}
.ui-grid-phone {
  display: none;
}
/* An island of a heavy view: its parts one under the other. */
.ui-island {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
}
/* The island's controls in the page's head (P.0.3): a place in the head's row of actions that the island fills, Lås
   and Lås upp beside Version, as parts of that row; on a phone, where the island is not shown, neither are they. */
.ui-island-tools {
  display: contents;
}
/* The table's heading row and its views, the grid and the chart, under it with the air of a sub heading (P.0.3). */
.ui-ledger-views {
  display: flex;
  flex-direction: column;
  gap: var(--grid-heading-after);
}
.ui-ledger-views > div[data-view]:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
}
/* A view of the island, the grid or the chart, with its parts one under the other as the island's: the grid, and the
   note and the keys under it, as the prototype's (P.0). */
.ui-island > [data-view]:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
}
/* An iPad standing up: the columns the grid's model marks are left out, as Senaste, as the island does (the core's
   hidden columns; frontend/forecast/model.ts, narrowColumns). Kommentar is shown, also while one edits, so that a note
   can be written beside its amount (1d.1.2). */
@media (max-width: 1179px) {
  .ui-grid-table .ui-grid-col-narrow {
    display: none;
  }
}
@media (max-width: 599px) {
  .ui-grid,
  .ui-island,
  .ui-island-tools {
    display: none;
  }
  .ui-grid-phone {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
  }
}

/* ---- Print ---- */
.ui-print {
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--print-text);
  padding: var(--print-margin);
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
}
.ui-print-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-7);
  border-bottom: var(--line-medium) solid var(--color-border-strong);
  padding-bottom: var(--space-4);
}
.ui-print-head h1,
.ui-print-title {
  font-size: var(--print-heading);
}
/* The paper heading is a paragraph without a heading role (P.0.15b) and looks as the h1 of the printout does. */
.ui-print-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-heading);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-heading);
}
/* The heading of a page printed from the browser (paper, P.0.15): only on paper, where it stands in place of the
   page's head with its pickers. */
@media screen {
  .ui-print-head-paper {
    display: none;
  }
}
@media print {
  .ui-page:has(.ui-print-head-paper) .ui-page-head {
    display: none;
  }
}
/* The mark beside the heading (the variant mark, P.0.5), as doc-mark in print.css: what the document is for, "Intern". */
.ui-print-mark {
  display: inline-block;
  margin-left: var(--space-5);
  padding: var(--print-mark-pad-block) var(--print-mark-pad-inline);
  border: var(--line-thin) solid var(--print-mark-border);
  border-radius: var(--radius-sm);
  color: var(--print-mark-text);
  font-family: var(--font-body);
  font-size: var(--print-mark-size);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  vertical-align: middle;
}
.ui-print-meta {
  margin: 0;
  font-size: var(--print-text-small);
  color: var(--color-text-2);
  text-align: right;
}
.ui-print .ui-table th {
  position: static;
}
.ui-print-landscape {
  page: landscape;
}
.ui-signatures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--picker-min)), 1fr));
  gap: var(--space-10);
  margin-top: var(--space-9);
}
.ui-signature {
  border-top: var(--line-thin) solid var(--color-border-strong);
  padding-top: var(--space-2);
  margin-top: var(--print-signature-height);
  font-size: var(--print-text-small);
  color: var(--color-text-2);
}
@media print {
  .ui-band,
  .ui-sidenav,
  .ui-sidenav-bar,
  .ui-sidenav-scrim,
  .ui-shell > .ui-sidenav,
  .ui-shell > .ui-sidenav-bar,
  .ui-shell[data-sidenav-open] > .ui-sidenav-scrim,
  .ui-tabs,
  .ui-projectbar,
  .ui-actions,
  .ui-valuepicker .ui-valuepicker-arrow,
  .ui-table-sortbar,
  .ui-theme {
    display: none;
  }
  /* A heading row's choice of list (Visa Sammanställning) is a control, and paper has no controls (P.0.15c), on a
     page whose paper heading already says which list it is (the report); elsewhere the choice stays, as text without
     its arrow, since it says which part of the list the paper shows (a portfolio's Flaggade, a list's status). */
  .ui-page:has(.ui-print-head-paper) .ui-heading-filters {
    display: none;
  }
  /* the side menu's room (T2.27) is not kept on paper either */
  .ui-shell > .ui-shell-main {
    margin-left: 0;
  }
  body {
    background: var(--color-surface);
  }
  .ui-print {
    padding: 0;
  }
  .ui-table thead {
    display: table-header-group;
  }
  .ui-table tr {
    break-inside: avoid;
  }
}

/* ---- A column shown only on a wide screen (P.0.14, the pilot session 2/11) ---- */
/* wide_only on a table's column (components/table.html): under 1366 px of screen the column is not shown, and what it
   says stands in the row that folds out under its row, as the ÄTA list's Anteckningar, so that the list fits an iPad in
   landscape without scrolling sideways. On a phone the card decides, as before. */
@media (min-width: 600px) and (max-width: 1365px) {
  .ui-table .ui-col-wide-only {
    display: none;
  }
}
/* wide_only="landscape" (P.0.17c, K13: "sekundära kolumner till utfällningen"): the same from iPad landscape,
   --bp-ipad-landscape (1180 px), as the portfolio's Kostnader and Ack. resultat, so that the list's first columns fit
   at 600 and 820 px and all of them from 1180 px. A media query cannot read the token; tests/test_design.py keeps the
   width equal to it. The rows fold out only there (more_below="landscape"): on a phone the compact card decides, and
   from 1180 px every column stands, so the chevron and the row under are not shown and a click on the row folds
   nothing (components.js reads whether the chevron is shown). */
@media (min-width: 600px) and (max-width: 1179px) {
  .ui-table .ui-col-wide-only-landscape {
    display: none;
  }
}
/* wide_only="portrait" (the pilot session 13/11 on P.0.17c): the same only up to iPad portrait, --bp-ipad-portrait
   (820 px), as the portfolio's Projektledare and Prognos slutresultat, so that Projekt, Intäkter, Resultat, Marg. and
   Status fit from 600 px without scrolling sideways; from 820 px they stand. */
/* A sum row's label over such a column (|sum_narrow) is drawn twice, and the width shows one: over the whole span
   (ui-sum-wide), and from 600 to 819 px over the columns shown there (ui-sum-narrow), so that the sums stay under their
   columns. */
.ui-table tfoot td.ui-sum-narrow {
  display: none;
}
@media (min-width: 600px) and (max-width: 819px) {
  .ui-table .ui-col-wide-only-portrait,
  .ui-table tfoot td.ui-sum-wide {
    display: none;
  }
  .ui-table tfoot td.ui-sum-narrow {
    display: table-cell;
    padding-left: var(--space-6);
  }
}
@media (max-width: 599px), (min-width: 1180px) {
  .ui-table-more-below-landscape .ui-row-toggle,
  .ui-table-more-below-landscape tr.ui-row-more {
    display: none;
  }
  .ui-table.ui-table-more-below-landscape tr[data-expands] {
    cursor: auto;
  }
  .ui-table.ui-table-more-below-landscape tbody tr[data-expands]:not(.ui-row-expanded):hover > td {
    background: none;
  }
}

/* ---- The floating header row (ui-float, 1g.4c; the pilot session 12/11, for T2.60 as well) ----
   A wide thing that scrolls sideways in its own frame while the page scrolls up and down, as the prototype's pages do: never a
   box that scrolls in both directions. ui-float holds the head (ui-float-head) and the frame (ui-float-body, overflow-x only).
   With the script (components.js, setupFloatHead) the head floats at the top of the window under the page's sticky tabs
   (--float-head-top) while the frame passes under it, and the part of it that is as wide as the frame (ui-float-track) follows
   the frame's scroll sideways. It floats only while it is at most --float-head-share of the window's height (a phone in
   landscape keeps room for the rows), measured; else, and without the script, it is the page's own row. Its height is given as
   --float-head-height, so that what the keyboard reaches in the frame, with its focus ring, is never under it (scroll-margin-top). */
.ui-float {
  container-type: inline-size; /* what the head holds is as wide as the frame, not the drawing: a menu fits a phone */
}
.ui-float-head {
  background: var(--float-head-surface);
  box-shadow: var(--float-head-shadow);
}
html[data-js] .ui-float-floats > .ui-float-head {
  position: sticky;
  top: var(--float-head-top);
  z-index: 4;
}
.ui-float-track {
  overflow-x: auto; /* without the script it scrolls by itself */
}
html[data-js] .ui-float-ready .ui-float-track {
  overflow-x: hidden; /* the frame moves it (scrollLeft), so it has no scroll bar of its own */
  overflow-y: hidden; /* and never one up and down: a hidden x alone makes y auto, a region axe wants the keyboard to reach (T2.138) */
}
.ui-float-body {
  overflow-x: auto;
  overflow-y: hidden;
}
.ui-float-body [tabindex],
.ui-float-body a {
  scroll-margin-top: calc(var(--float-head-height) + var(--float-head-ring-room)); /* the page's scroll-padding-top is what is above it (T2.140) */
}

/* ---- The schedule with its Gantt chart (1g.4, components/schedule_gantt.html): the SVG from the server, read only ---- */
.ui-gantt-svg {
  display: block;
  font-variant-numeric: tabular-nums;
}
/* The drawing in pieces (1g.4c, K29 B): the inner box is the width the drawing has, the top row sticks to the top of the frame, and
   the pictures of the columns Rad, Kod and Namn stick to its left, each a zero-high box with the picture overflowing, in the share of
   the width that those columns have of the whole drawing (--gantt-share). The table's own cells are drawn under them. */
.ui-gantt-inner {
  width: max-content;
  min-width: 100%;
}
.ui-gantt-inner-fit {
  width: 100%;
  min-width: var(--gantt-min);
  max-width: var(--gantt-max);
}
.ui-gantt-columns {
  position: relative; /* the menu's list hangs from the buttons' row */
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4) var(--space-5) var(--space-3);
}
.ui-gantt-menu {
  position: static; /* the list hangs from the buttons' row, not from the button, so that it fits a phone */
}
.ui-gantt-menu-list {
  left: var(--space-5);
  right: auto;
  width: max-content;
  min-width: var(--gantt-menu-width-min);
  max-width: calc(100cqw - 2 * var(--space-5));
  max-height: calc(100dvh - var(--space-11));
  overflow-y: auto;
  display: none;
}
.ui-gantt-menu[open] > .ui-gantt-menu-list {
  display: block;
}
html[data-js] .ui-gantt-menu-apply {
  display: none;
}
.ui-gantt-menu-text,
.ui-gantt-menu-fixed,
.ui-gantt-menu-note {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-2);
}
/* The note wraps within the menu, between words, and adds nothing to the menu's width: the rows set it (K29 B, the
   pilot session's comparison 12/11). */
.ui-gantt-menu-text {
  width: 0;
  min-width: 100%;
  padding: 0 var(--space-3) var(--space-3);
  white-space: normal;
  overflow-wrap: normal;
}
.ui-gantt-menu-fixed {
  display: flex;
  align-items: center;
  min-height: var(--gantt-menu-row-min);
  padding: 0 var(--space-3);
  font-size: var(--text-md);
  color: var(--color-text);
}
.ui-gantt-menu-always {
  margin-left: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-2);
}
.ui-gantt-menu-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-5);
}
.ui-gantt-menu-item .ui-check {
  display: flex;
  align-items: center;
  min-height: var(--gantt-menu-row-min);
  padding: 0 var(--space-3);
}
.ui-gantt-head,
.ui-gantt-plate {
  position: relative;
}
.ui-gantt-sticky {
  position: sticky;
  left: 0;
  z-index: 2;
  width: calc(var(--gantt-share) * 100%);
  height: 0;
}
.ui-gantt-inner:not(.ui-gantt-inner-fit) .ui-gantt-sticky {
  width: max-content;
}
.ui-gantt-sticky .ui-gantt-svg {
  width: 100%;
  height: auto;
}
.ui-gantt-inner:not(.ui-gantt-inner-fit) .ui-gantt-sticky .ui-gantt-svg {
  width: auto;
}
.ui-gantt-head > .ui-gantt-sticky {
  z-index: 5;
}
/* The edge where the fixed columns end shows only while the frame is scrolled sideways (is-scrolled-x on ui-float-body,
   components.js), as every fixed column's edge (--grid-fixed-edge, granskningslistan 7): soft, and never without the script. */
.ui-float:has(.ui-float-body.is-scrolled-x) .ui-gantt-sticky .ui-gantt-svg {
  box-shadow: var(--grid-fixed-edge);
}
/* In a frame narrower than --bp-mobile (600 px) the fixed columns would be most of it (Rad and Namn are about 257 px of the 358
   px of a phone, G1 of 1g.4c), leaving the axis a sliver: there they scroll with the rest, as the drawing under them does. */
@container (max-width: 599px) {
  .ui-gantt-sticky {
    position: static;
  }
  .ui-float:has(.ui-float-body.is-scrolled-x) .ui-gantt-sticky .ui-gantt-svg {
    box-shadow: none;
  }
}
.ui-gantt-plate-touch {
  display: none;
}
/* The edit mode's drawing (chart.edit, 1g.5b) is whole, in a region of its own without the floating header row's frame: the
   region scrolls sideways by itself, and of the drawings of a mouse and of touch it shows the one that fits the pointer, as the
   plates do in the read view. Under --bp-mobile the narrow drawing is shown instead (below). */
.ui-gantt-scroll:not(.ui-float-body) {
  overflow-x: auto;
}
.ui-gantt-scroll:not(.ui-float-body) .ui-gantt-svg-touch {
  display: none;
}
@media (min-width: 600px) and (pointer: coarse), (min-width: 600px) and (any-pointer: coarse) {
  .ui-gantt-scroll:not(.ui-float-body) .ui-gantt-svg:not(.ui-gantt-svg-touch, .ui-gantt-svg-narrow) {
    display: none;
  }
  .ui-gantt-scroll:not(.ui-float-body) .ui-gantt-svg-touch {
    display: block;
  }
}
/* The drawing with the rows of touch (--gantt-row-touch) is the one that pointer: coarse shows, and with a mouse the one with the
   rows of --gantt-row; what is not shown is display: none, so a screen reader reads one table. As the other rules in this file,
   a computer that also has a touch screen (any-pointer: coarse) is given touch's. */

/* The year as a strip, one box per day (components/year_strip.html, 1g.8b1, K30): a week per column and a weekday per row,
   read only. A building day is an empty box with an edge, a weekend or holiday the Gantt chart's shade without an edge and
   a day off or vacation week hatched with an edge, so a state is never only a colour. The strip scrolls in its own region
   when it is wider than its box, with the weekdays' column standing still, and the page never does. */
.ui-year-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* the frame is as wide as the box, never the table */
  gap: var(--space-5);
  min-width: 0;
}
.ui-year-strip-legend,
.ui-year-strip-totals {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--year-strip-legend-gap);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
  color: var(--color-text-2);
}
.ui-year-strip-legend li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}
.ui-year-strip-legend .ui-year-strip-day {
  display: inline-block;
  flex: none;
}
.ui-year-strip-legend-week {
  font-size: var(--year-strip-week);
  font-weight: var(--year-strip-vacation-weight);
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}
.ui-year-strip-totals strong {
  font-weight: var(--weight-strong);
  color: var(--color-text);
}
.ui-year-strip-frame {
  position: relative; /* the boxes' words for a screen reader stay inside the frame, never beyond the page */
  max-width: 100%;
  overflow-x: auto;
}
.ui-year-strip-table {
  border-collapse: separate;
  border-spacing: var(--year-strip-gap);
  font-size: var(--year-strip-week);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--year-strip-week-text);
}
.ui-year-strip-table th {
  padding: 0;
  font-weight: var(--weight-regular);
  text-align: center;
  white-space: nowrap;
}
.ui-year-strip-months th {
  padding-bottom: var(--space-2);
  font-weight: var(--weight-strong);
  text-align: left;
  color: var(--color-text);
}
.ui-year-strip-weeks th {
  padding-bottom: var(--space-2);
}
.ui-year-strip-weeks th.is-vacation {
  font-weight: var(--year-strip-vacation-weight);
  color: var(--color-text);
}
.ui-year-strip-table tbody th,
.ui-year-strip-corner {
  position: sticky;
  left: 0;
  z-index: 1;
  padding: 0 var(--year-strip-label-gap) 0 0;
  text-align: left;
  background: var(--color-surface);
}
.ui-year-strip-day,
.ui-year-strip-outside {
  box-sizing: border-box;
  width: var(--year-strip-cell);
  min-width: var(--year-strip-cell);
  height: var(--year-strip-cell);
  padding: 0;
}
.ui-year-strip-day.is-work {
  border: var(--line-thin) solid var(--year-strip-day-edge);
  background: var(--year-strip-day-surface);
}
.ui-year-strip-day.is-weekend,
.ui-year-strip-day.is-holiday {
  background: var(--year-strip-off);
}
.ui-year-strip-day.is-vacation,
.ui-year-strip-day.is-day_off {
  border: var(--line-thin) solid var(--year-strip-free-line);
  background: repeating-linear-gradient(
    135deg,
    var(--year-strip-free-line) 0 var(--line-thin),
    var(--year-strip-day-surface) var(--line-thin) var(--year-strip-hatch)
  );
}
@media (pointer: coarse), (any-pointer: coarse) {
  .ui-gantt-plate:not(.ui-gantt-plate-touch) {
    display: none;
  }
  .ui-gantt-plate-touch {
    display: block;
  }
}
/* Under --bp-mobile (600 px) the narrow drawing (K107 A, Björn 12/11) is the one shown, after the surface's width and
   whatever the pointer: drawn a unit to a pixel and never scaled (no --gantt-min), with tighter cells, without Kod and
   with Namn as wide as its names and narrowed by the script to what the region leaves (fitGanttNarrow), so that Start and Slut are in view at every width down to 320 px; its rows are --target-min (44 px). The
   bars and Föreg. are reached with a scroll to the side in the region, as before. */
.ui-gantt-svg.ui-gantt-svg-narrow {
  display: none;
}
@media (max-width: 599px) {
  .ui-gantt-svg.ui-gantt-svg-narrow {
    display: block;
  }
  .ui-gantt-svg:not(.ui-gantt-svg-narrow) {
    display: none;
  }
}
/* The schedule's edit mode (1g.5b, Björn 12/11): the plan as the read view draws it, and an open row's fields laid over its
   cells by components.js, which gives each field its cell's place, size, text size, weight and indent from the drawing
   (--cell-*), so the row never changes its height. Under the drawing, which is transparent, the marks of the cells whose
   value changed (Björn 12/11): a cell written in, clearly (ui-cell-written), a cell moved after its predecessor, a soft
   tone (ui-cell-followed), the Rad cell of a changed row, an edge at its start (ui-row-changed), and a Föreg. with an
   error (ui-cell-invalid); over it the open row's fields and the
   line of a row with an error, over the plan, or directly under the row over the table's width in view where the
   plan's part in view is too narrow for it (data-under, #2391). The fields are transparent, so the row reads as one in its tone, plain, changed or with an
   error (the pilot session 12/11); only the field with focus has an edge. Without the script the fields stand as rows
   under the drawing. */
.ui-gantt-edit {
  position: relative;
}
.ui-gantt-edit-live .ui-gantt-edit-drawing {
  position: relative;
  z-index: 1;
}
.ui-gantt-edit-under,
.ui-gantt-edit-live .ui-gantt-edit-fields {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.ui-gantt-edit-live .ui-gantt-edit-fields {
  z-index: 2;
}
.ui-gantt-edit-live .ui-gantt-edit-row {
  display: none;
}
/* Without the script a row's fields stand in a line under the drawing, each with its column's name over it (G1 of
   #1450, Bör 5); with it the name is the drawing's heading and the label lets its field lie over the cell. */
.ui-gantt-edit-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-block-start: var(--space-3);
}
.ui-gantt-field-label {
  display: grid;
  gap: var(--space-1);
  color: var(--color-text-2);
  font-size: var(--text-sm);
}
.ui-gantt-edit-live .ui-gantt-field-label {
  display: contents;
}
.ui-gantt-edit-live .ui-gantt-field-name {
  display: none;
}
.ui-gantt-edit-live .ui-gantt-edit-row-open {
  display: contents;
}
.ui-gantt-edit-live .ui-gantt-cell-covered {
  visibility: hidden;
}
.ui-gantt-edit-live .ui-gantt-svg-edit {
  cursor: text;
}
.ui-gantt-edit-live .ui-gantt-field,
.ui-gantt-edit-mark,
.ui-gantt-row-error {
  position: absolute;
  left: var(--cell-left);
  top: var(--cell-top);
  width: var(--cell-width);
  height: var(--cell-height);
  margin: 0;
  box-sizing: border-box;
}
.ui-gantt-edit-live .ui-gantt-field {
  padding: 0 var(--cell-pad-end) 0 var(--cell-pad-start);
  border: 0;
  border-radius: 0;
  background: var(--gantt-field-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--cell-font);
  font-weight: var(--cell-weight);
  line-height: var(--cell-height);
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis; /* a value its cell cuts ends in "…", as the read view's names; the name's whole is in the box */
  pointer-events: auto;
}
/* A field over a cell narrower than a tap target (Insats, #2391) reaches back over the cell before it by what it lacks,
   with a transparent border at its start, so that its target is --gantt-field-target wide with touch while its text,
   padding and inset focus edge (drawn inside the border) stay in its cell, which is drawn as dense as before. It reaches
   back, never forward: the field before it comes earlier in the row, so the reach lies over it and takes the tap, and
   the field after it keeps its own cell whole. */
.ui-gantt-edit-live .ui-gantt-field {
  --field-reach: calc(max(var(--cell-width), var(--gantt-field-target)) - var(--cell-width));
  left: calc(var(--cell-left) - var(--field-reach));
  width: calc(var(--cell-width) + var(--field-reach));
  border-left: var(--field-reach) solid transparent;
  background-clip: padding-box;
}
/* The one of Insats and Slut that is counted from the other (1g.5c, the prototype's tpber): grey, with and without the
   script, while the one written is plain. */
.ui-gantt-field.ui-gantt-field-counted {
  color: var(--gantt-field-counted-text);
}
.ui-gantt-edit-live .ui-gantt-field[data-align="end"] {
  text-align: end;
}
.ui-gantt-edit-live .ui-gantt-field:focus {
  outline: none;
  box-shadow: inset 0 0 0 var(--gantt-field-focus-line) var(--gantt-field-focus);
}
.ui-gantt-edit-mark.ui-cell-written {
  background: var(--gantt-cell-written-surface);
  box-shadow: inset 0 0 0 var(--line-thin) var(--gantt-cell-written-edge);
}
.ui-gantt-edit-mark.ui-cell-followed {
  background: var(--gantt-cell-followed-surface);
}
.ui-gantt-edit-mark.ui-row-changed {
  background: var(--gantt-cell-followed-surface);
  box-shadow: inset var(--gantt-row-changed-line) 0 0 0 var(--gantt-row-changed-edge);
}
.ui-gantt-edit-mark.ui-cell-invalid {
  background: var(--table-cell-invalid-surface);
  box-shadow: inset 0 0 0 var(--line-thin) var(--table-cell-invalid-border);
}
/* The frozen heading (decision 0005, 1g.5b round 15 A5 and A6): a copy of the drawing's head that components.js
   (ganttHead) lays at the line that sticks at the top (--head-top), the edit bar's lower edge in the edit mode and the
   page's sticky line in the read view, over the region's width while the drawing's own head is under it, and moves
   with the region's scroll to the side (--head-shift), so that the columns' names and the axis are never hidden. It
   lies over the open row's fields and takes their taps, as a table's header row that sticks. The read view lays it in
   the region's parent, which the script marks ui-gantt-head-home. */
.ui-gantt-head-home {
  position: relative;
}
.ui-gantt-edit-head {
  position: absolute;
  z-index: 3;
  left: var(--head-left);
  top: var(--head-top);
  width: var(--head-width);
  height: var(--head-height);
  overflow: hidden;
  background: var(--color-surface);
  font-variant-numeric: tabular-nums;
}
.ui-gantt-edit-head-drawing {
  position: absolute;
  top: 0;
  left: var(--head-shift);
  display: block;
}
.ui-gantt-row-error {
  padding: 0 var(--cell-pad-start);
  overflow: hidden;
  background: var(--table-cell-invalid-surface);
  color: var(--gantt-row-error-text);
  font-size: var(--cell-font);
  line-height: var(--cell-height);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ui-gantt-svg-fit {
  width: 100%;
  height: auto;
}
.ui-gantt-svg [data-full-name],
.ui-gantt-name-hit {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* The ring on a name only after the keyboard, as on the grid's active cell: a tap shows the box and nothing else */
:root:not([data-last-input="keyboard"]) .ui-gantt-svg [data-full-name]:focus {
  outline: none;
}
/* The focused name's ring, drawn on its twin in the picture of the fixed columns that lies over it (components.js,
   setupGanttNames; G1 of 1g.4c): the same ring as every focus, so that it shows whole */
.ui-gantt-sticky [data-full-name].is-focus-ring {
  outline: var(--line-medium) solid var(--color-focus);
  outline-offset: var(--line-medium);
}
/* A cut name's whole text on a tap: the look the forecast's chart had before T2.92 (the shared surface, edge, text, font and
   overlay shadow, kept here as they were, while the forecast's chart now has ui-chart-tip; 1g.4d moves this box onto
   ui-chart-tip), which components.js places with --tip-x and --tip-y in pixels under the name, the margin keeping it clear of
   the name, and the common placement (T2.94) over the name where there is no room under it, and inside the window. */
.ui-gantt-tip {
  --pop-edge: var(--space-3);
  position: fixed;
  top: var(--tip-y);
  left: var(--tip-x);
  z-index: 20;
  margin: var(--space-3);
  max-width: min(var(--note-measure), calc(100vw - 2 * var(--space-3)));
  padding: var(--space-3) var(--space-5);
  border: var(--line-thin) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-overlay);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  pointer-events: none;
}
.ui-gantt-status {
  font-size: var(--text-xs);
  color: var(--color-text-2);
}
/* No generous air on a phone (Björn, 1g.5b round 15 A5): the calendar's line over the drawing has no margins of its own,
   only the panel's gap, and its link Projektets kalender keeps its tap target of --target-min but takes only its text's
   height in the line, the rest standing over the air beside it. */
@media (max-width: 599px) {
  .ui-gantt-status {
    margin-block: 0;
  }
  .ui-gantt-status > .ui-button-link {
    margin-block: calc((var(--text-lg) * var(--leading-tight) - var(--target-min)) / 2);
  }
}
/* The key under the drawing with the band (1g.8c, K30), as the sketch's: small italic text in a row that wraps, a swatch beside
   the shade's and the band's text (the drawing's shade and stripes), and every item says its meaning in words. */
.ui-gantt-key {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-7);
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-xs);
  font-style: italic;
  color: var(--color-text-2);
}
.ui-gantt-key-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}
.ui-gantt-swatch {
  flex: none;
  width: var(--gantt-key-swatch);
  height: var(--gantt-key-swatch);
  border: var(--line-thin) solid var(--gantt-line);
  background: var(--color-surface);
}
.ui-gantt-swatch-shade {
  background: var(--gantt-shade);
}
.ui-gantt-swatch-band {
  background: repeating-linear-gradient(
    135deg,
    var(--gantt-band-line) 0 var(--gantt-key-stripe),
    transparent var(--gantt-key-stripe) var(--gantt-key-step)
  );
}
/* The edit mode's old place (K107 B): the drawing's light surface, stripes at 45 degrees and thin edge in the old
   place's tokens, as the striped place behind a moved bar. */
.ui-gantt-swatch-before {
  border-color: var(--gantt-bar-before-line);
  background:
    repeating-linear-gradient(
      135deg,
      var(--gantt-bar-before-line) 0 var(--gantt-key-stripe),
      transparent var(--gantt-key-stripe) var(--gantt-key-step)
    ),
    var(--gantt-bar-before-surface);
}

/* Event list (1g.11, K48): the site diary's events in the order written, time, type and author on one line and the text
   under it. The author goes to the right, and under the type when the line is too narrow. */
.ui-events {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ui-event {
  padding: var(--event-gap) 0;
  border-bottom: var(--event-divider);
}
.ui-event:first-child {
  padding-top: 0;
}
.ui-event-pending {
  padding-left: var(--space-4);
  border-left: var(--event-pending-edge);
}
.ui-event-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  font-size: var(--text-sm);
}
.ui-event-time {
  color: var(--color-text-2);
  font-variant-numeric: tabular-nums;
}
.ui-event-type {
  font-weight: var(--weight-strong);
}
.ui-event-author {
  margin-left: auto;
  color: var(--color-text-2);
}
.ui-event-note {
  margin: var(--space-1) 0 0;
  color: var(--color-text-2);
  font-size: var(--text-xs);
}
.ui-event-text {
  margin: var(--space-2) 0 0;
  overflow-wrap: break-word;
}
.ui-event-marks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
}
/* A mark that is words and not a status badge (1g.11i, K48): the count of an event's photos, in the muted text. */
.ui-event-mark-text {
  color: var(--color-text-2);
  font-size: var(--text-xs);
}
/* The signal of an event (Foto saknas., K31): the signals' dot and calm text, with Ta foto on the same line. */
.ui-event-signal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--signal-dot-gap);
  margin: var(--space-2) 0 0;
  color: var(--event-signal);
  font-size: var(--signal-size);
}
.ui-event-signal::before {
  content: "";
  flex: none;
  width: var(--signal-dot);
  height: var(--signal-dot);
  border-radius: var(--radius-round);
  background: var(--event-signal-dot);
}
.ui-event-head .ui-option-symbol {
  align-self: center;
}
/* The field notes' row (K64, the pilot session's side by side 13/11; type_first in components/event_list.html): the type
   in bold first, then "when · who" together in the muted text, one unit that goes under the type when the row is too
   narrow. The author does not go to the right as in the diary's row. */
.ui-events-typed .ui-event-meta {
  color: var(--color-text-2);
  font-size: var(--text-xs);
}
.ui-events-typed .ui-event-author {
  margin-left: 0;
}

/* The symbol of an option and of an event (1g.11, K48; components/parts/option_symbol.html): lines only with round ends
   in a little box with the tone's surface and edge, beside the name and never alone (aria-hidden). The tone is the
   badge's (warning, critical) or the salvia's (accent), and neutral without one, so that a form says the kind and the
   colour only adds to it. */
.ui-option-symbol {
  flex: none;
  box-sizing: content-box;
  width: var(--option-symbol-size);
  height: var(--option-symbol-size);
  padding: var(--option-symbol-pad);
  border: var(--line-thin) solid var(--option-symbol-edge);
  border-radius: var(--option-symbol-radius);
  background: var(--option-symbol-bg);
  color: var(--option-symbol-text);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--option-symbol-stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
.ui-option-symbol-dot {
  fill: currentColor;
  stroke: none;
}
.ui-option-symbol-warning {
  border-color: var(--option-symbol-warning-edge);
  background: var(--option-symbol-warning-bg);
  color: var(--option-symbol-warning-text);
}
.ui-option-symbol-critical {
  border-color: var(--option-symbol-critical-edge);
  background: var(--option-symbol-critical-bg);
  color: var(--option-symbol-critical-text);
}
.ui-option-symbol-accent {
  border-color: var(--option-symbol-accent-edge);
  background: var(--option-symbol-accent-bg);
  color: var(--option-symbol-accent-text);
}
/* In an option the symbol stands at the left of both lines, the name and the small line under it, as in the sketch. */
.ui-valuepicker-option:has(.ui-option-symbol) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: var(--space-4);
}
.ui-valuepicker-option:has(.ui-option-symbol) .ui-valuepicker-name {
  display: contents;
}
.ui-valuepicker-option .ui-option-symbol {
  grid-row: span 2;
}
.ui-valuepicker-option:has(.ui-option-symbol) .ui-valuepicker-sub {
  grid-column: 2;
}
.ui-valuepicker-text .ui-option-symbol {
  margin-right: var(--space-3);
}

/* The value picker's sheet (1g.11, K48, pilotsessionen 9/11): on a phone's surface, under --bp-mobile, the list glides up
   from the foot of the screen over the page, as wide as the screen, with its label as a heading, Stäng and the little
   bar at the top, over a scrim that closes it with a tap. It is placed by its own rules and not by the common placement
   (--pop-place: none, components.js, placePop), and the page never changes for it: it does not move, widen or roll. The
   list rolls inside the sheet when it is higher than --sheet-max-height. On a wider surface it is the form mode's list
   under the field, as before, without the heading: the surface decides, never the kind of device. */
.ui-valuepicker-sheet-head {
  display: none;
}
@media (max-width: 599px) {
  .ui-valuepicker-sheet .ui-valuepicker-pop {
    --pop-place: none;
    position: fixed;
    inset: auto 0 0;
    width: auto;
    max-width: none;
    max-height: var(--sheet-max-height);
    margin: 0;
    padding: var(--space-3) 0 var(--space-5);
    gap: var(--space-2);
    border-width: var(--line-thin) 0 0;
    border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
    animation: ui-sheet-in var(--sheet-glide) var(--ease-grow);
  }
  .ui-valuepicker-sheet .ui-valuepicker-pop::before {
    content: "";
    align-self: center;
    flex: none;
    width: var(--sheet-grip-width);
    height: var(--sheet-grip-height);
    border-radius: var(--sheet-grip-height);
    background: var(--sheet-grip);
  }
  .ui-valuepicker-sheet:has(> .ui-valuepicker-pop:not([hidden]))::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 58;
    background: var(--sheet-scrim);
  }
  /* The top bar is never dimmed (the sketch K48, pilotsessionen 9/11): while a sheet is open it stands over the scrim
     and under the sheet, and a tap on it closes the sheet as a tap outside does. */
  body:has(.ui-valuepicker-sheet > .ui-valuepicker-pop:not([hidden])) :is(.ui-sidenav-bar, .ui-band) {
    position: relative;
    z-index: 59;
  }
  .ui-valuepicker-sheet .ui-valuepicker-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: 0 var(--space-3) 0 var(--space-6);
  }
  .ui-valuepicker-sheet .ui-valuepicker-list {
    min-height: 0;
    padding: 0 var(--space-3);
  }
  .ui-valuepicker-sheet .ui-valuepicker-list > li + li,
  .ui-valuepicker-sheet .ui-valuepicker-group-list > li {
    border-top: var(--line-thin) solid var(--color-border-soft);
  }
  .ui-valuepicker-sheet .ui-valuepicker-option {
    padding-block: var(--space-3);
  }
  .ui-valuepicker-sheet .ui-valuepicker-keys {
    display: none;
  }
}
.ui-valuepicker-sheet-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-strong);
  color: var(--color-text);
}
.ui-valuepicker-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--target-min);
  min-height: var(--target-min);
  padding: 0;
  border: 0;
  border-radius: var(--valuepicker-radius);
  background: none;
  color: var(--color-text-2);
  cursor: pointer;
}
.ui-valuepicker-close svg {
  width: var(--icon-nav);
  height: var(--icon-nav);
}
.ui-valuepicker-close:hover,
.ui-valuepicker-close:focus-visible {
  background: var(--valuepicker-open-bg);
  color: var(--color-text);
}
@keyframes ui-sheet-in {
  from {
    transform: translateY(100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ui-valuepicker-sheet .ui-valuepicker-pop {
    animation: none;
  }
}

/* The row of days (1g.11, K48; components/day_nav.html): the day before at the left, the day and its week with the day's
   state in the middle and the day after at the right, each arrow a tap target; a side without a day has its room kept,
   so that the day stays in the middle. */
.ui-day-nav {
  display: grid;
  grid-template-columns: var(--target-min) minmax(0, 1fr) var(--target-min);
  align-items: center;
  gap: var(--space-4);
}
.ui-day-nav-step {
  min-width: var(--target-min);
  padding-inline: 0;
}
.ui-day-nav-step svg {
  width: var(--icon-nav);
  height: var(--icon-nav);
}
.ui-day-nav-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
  text-align: center;
}
.ui-day-nav-date {
  font-family: var(--font-display);
  font-size: var(--day-nav-date);
  font-weight: var(--weight-strong);
}
.ui-day-nav-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-2);
  font-size: var(--text-xs);
}

/* The life mark (1g.11i, K48, K43; K120 B, 1c.3.0a, D-MARK-10; components/life_state.html): a thing's state in its
   life as a small symbol and the word in the grey text, with no surface and no edge, the same for every state and in
   both themes (--life-*), and never a tone of the status badge: a reply that is late is a mark of its own beside it.
   It is not tapped. The words stay whole on one line: it is as wide as its words. */
.ui-life {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  width: max-content;
  max-width: 100%;
  flex-shrink: 0;
  vertical-align: middle;
  color: var(--life-text);
  font-size: var(--life-size);
  font-weight: var(--life-weight);
  line-height: var(--leading-tight);
  white-space: nowrap;
}
/* The small life mark (K93 F3 B): in a line of facts in the small text, as the diary's row of days, the words keep the
   size and weight they had before K120; only the edge and the surface are gone. */
.ui-life-small {
  font-size: var(--life-small-size);
  font-weight: var(--life-small-weight);
}
/* The life mark in a note under a heading (K120, 1c.3.0a.1): the note's small size, and the regular weight of the mark in
   a list (the ÄTA list's Skickad), in the grey of every life mark. */
.ui-life-note {
  font-size: var(--life-note-size);
  font-weight: var(--life-note-weight);
}
.ui-life svg {
  flex: none;
  width: var(--life-symbol);
  height: var(--life-symbol);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--life-line);
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* A row of actions whose one button fills it where the surface is narrow (ui-actions-fill), as Signera dagen in its own
   box at the foot of the diary's day (pilotsessionen 9/11): over the whole width under --bp-mobile (600 px, which a
   media query cannot read), so that it is easy to reach, and as wide as its text on a larger surface, as the other
   secondary buttons. By the surface's width, never by the kind of device (Björn 7/11). Never the page's main action. */
@media (max-width: 599px) {
  .ui-actions-fill > .ui-button,
  .ui-actions-fill > form {
    flex: 1 1 100%;
  }
  .ui-actions-fill > form > .ui-button {
    width: 100%;
  }
  /* A button to another system (T2.117, K109): the mark first at the left, the text after it and the arrow out at the far right */
  .ui-actions-fill > .ui-button-system,
  .ui-actions-fill > form > .ui-button-system {
    justify-content: flex-start;
  }
  .ui-actions-fill > .ui-button-system .ui-system-arrow,
  .ui-actions-fill > form > .ui-button-system .ui-system-arrow {
    margin-inline-start: auto;
  }
}

/* The diary's day (1g.11, K48): the phone's column, one part under the other, and never wider than --diary-max on a
   larger surface, so that the lines of the events stay short enough to read. */
.ui-diary {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap);
  max-width: var(--diary-max);
}
.ui-diary-form {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap);
  margin: 0;
}
.ui-diary-form[hidden] {
  display: none;
}
.ui-diary-empty {
  margin: 0;
  color: var(--color-text-2);
}
/* The box of the signing (pilotsessionen 9/11, a): its heading the panel's title, and its parts the panel's usual
   air apart and no paragraph's own margin, with the signals' row right under the day's count. */
.ui-diary-sign p {
  margin: 0;
}
.ui-diary-sign-count {
  display: flex;
  flex-direction: column;
  gap: var(--diary-count-gap);
}
/* The line that the day is locked and the button under it: a paragraph's usual air apart, as the panel's parts. */
.ui-diary-sign-ready {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap);
}
.ui-diary-sign-ready[hidden] {
  display: none;
}
.ui-day-today {
  justify-content: center;
}

/* Signerad av beställaren (client, K53, D-MARK-19; pilotens precisering 15/11 mot K120): one step stronger than Signerad
   within the same mark, still with no surface and no edge: the word in the ordinary text colour instead of the grey,
   and a filled check in the dark salvia. */
.ui-life-client {
  color: var(--life-client-text);
}
.ui-life-client .ui-life-fill {
  fill: var(--life-client-symbol);
  stroke: none;
}
.ui-life-client .ui-life-tick {
  stroke: var(--life-client-tick);
}

/* A chip that is a choice (chips choices, ui-chip-choice; 1g.11d, K53, D-VAL-20): the period's quick choices, each a
   link that applies at once, without a button Visa. As high as a tap target with a mouse too (--chip-choice-height),
   round, and the chosen one (aria-current) in the action's soft surface with its edge and text, so that it is told by
   more than the colour: the edge and the weight too. */
.ui-chip.ui-chip-choice {
  justify-content: center;
  min-height: var(--chip-choice-height);
  padding: 0 var(--chip-choice-pad);
  border-radius: var(--chip-choice-radius);
  font-weight: var(--weight-strong);
  text-decoration: none;
}
.ui-chip.ui-chip-choice:hover {
  background: var(--chip-choice-hover);
}
.ui-chip.ui-chip-choice[aria-current="true"] {
  border-color: var(--chip-choice-on-edge);
  background: var(--chip-choice-on-surface);
  color: var(--chip-choice-on-text);
}

/* The side panel (components/side_panel.html, ui-side-layout and ui-side-panel; 1g.11d, K53, D-KORT-7): a panel beside
   the content, such as Skriv ut och signering beside the diary's day. From --bp-ipad-landscape (1180 px, which a media
   query cannot read) the content and the panel stand side by side, the content as wide as its own and the panel between
   --side-panel-min and --side-panel-max, staying in view when the page rolls, with a cross that closes it. Under it the
   panel is the page: the content is not drawn, and the way back is the back button over the panel's heading. Its parts
   are the panel's parts: separated by a line in the panel, and each a box of its own where the panel is the page. */
.ui-side-layout {
  display: grid;
  gap: var(--side-panel-gap);
}
.ui-side-panel {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap);
  min-width: 0;
}
.ui-side-panel-head,
.ui-side-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.ui-side-panel-title,
.ui-side-sheet-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-strong);
}
.ui-side-panel-meta {
  margin: 0;
  color: var(--color-text-2);
  font-size: var(--text-sm);
}
.ui-side-panel-close-form {
  display: contents;
}
.ui-side-panel-close {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--side-panel-close);
  height: var(--side-panel-close);
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
}
.ui-side-panel-close:hover {
  background: var(--color-surface-2);
}
.ui-side-panel-close svg {
  width: var(--icon-nav);
  height: var(--icon-nav);
}
.ui-side-panel-sum {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  color: var(--color-text-2);
  font-size: var(--text-sm);
}
.ui-side-panel-sum strong {
  color: var(--color-text);
}
.ui-side-panel-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ui-side-panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--side-panel-row-min);
  padding: var(--side-panel-row-pad) 0;
  border-top: var(--line-thin) solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
}
.ui-side-panel-row:hover .ui-side-panel-row-day {
  text-decoration: underline;
}
.ui-side-panel-row-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ui-side-panel-row-day {
  font-weight: var(--weight-strong);
}
.ui-side-panel-row-line {
  color: var(--color-text-2);
  font-size: var(--text-sm);
}
.ui-side-panel-row-marks {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}
.ui-side-panel-hint {
  margin: 0;
  color: var(--color-text-2);
  font-size: var(--text-sm);
  text-align: center;
}
/* The form of the panel (ui-side-sheet): in the panel it folds out as a part under the actions; under 1180 px it glides
   up from the foot as the value picker's and the date's sheets do (--sheet-*, ui-sheet-in), over a scrim that is a link
   back, and Avbryt and the cross close it. */
.ui-side-sheet {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap);
}
.ui-side-sheet-scrim {
  display: none;
}
@media (min-width: 1180px) {
  .ui-side-layout:has(> .ui-side-panel) {
    grid-template-columns: minmax(0, auto) minmax(var(--side-panel-min), var(--side-panel-max));
    justify-content: start;
    align-items: start;
  }
  .ui-side-panel {
    position: sticky;
    top: var(--side-panel-top);
    max-height: calc(100dvh - var(--side-panel-top) - var(--side-panel-foot));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--side-panel-pad);
    border: var(--line-thin) solid var(--side-panel-edge);
    border-radius: var(--radius-md);
    background: var(--side-panel-surface);
    box-shadow: var(--side-panel-shadow);
  }
  /* The heading and the cross stay in view when the panel itself rolls (a long list or the registration), so the way
     out is always there: the head is stuck to the panel's top edge, over the panel's own padding. */
  .ui-side-panel-head {
    position: sticky;
    top: calc(-1 * var(--side-panel-pad));
    z-index: 1;
    margin: calc(-1 * var(--side-panel-pad)) calc(-1 * var(--side-panel-pad)) 0;
    padding: var(--side-panel-pad) var(--side-panel-pad) var(--space-2);
    background: var(--side-panel-surface);
  }
  .ui-side-panel-back {
    display: none;
  }
  .ui-side-panel > .ui-panel {
    padding: var(--stack-gap) 0 0;
    border-width: var(--line-thin) 0 0;
  }
  .ui-side-sheet .ui-side-panel-close-form {
    display: none;
  }
}
@media (max-width: 1179px) {
  .ui-side-layout:has(> .ui-side-panel) > .ui-side-layout-main {
    display: none;
  }
  .ui-side-panel-head .ui-side-panel-close-form {
    display: none;
  }
  .ui-side-sheet {
    position: fixed;
    inset: auto 0 0;
    z-index: 60;
    max-height: var(--sheet-max-height);
    overflow: auto;
    padding: var(--space-3) var(--space-8) var(--space-8);
    border: var(--line-thin) solid var(--color-border);
    border-width: var(--line-thin) 0 0;
    border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
    background: var(--color-surface);
    animation: ui-sheet-in var(--sheet-glide) var(--ease-grow);
  }
  .ui-side-sheet::before {
    content: "";
    align-self: center;
    width: var(--sheet-grip-width);
    height: var(--sheet-grip-height);
    border-radius: var(--sheet-grip-height);
    background: var(--sheet-grip);
  }
  .ui-side-sheet-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 58;
    background: var(--sheet-scrim);
  }
}

/* The number field with steps (field_text steps, 1g.11g, K55, G2 of #911 B4; the diary's staffing first): a row per
   count, its label with the line under it at the left and the steps - and + around the number field at the right, each a
   tap target (--field-steps-button), and the total last in bold (steps_total) with its sum under
   the numbers (ui-field-steps-sum). The number field
   is as wide as a short dense field (--field-steps-input) and its digits stand in the middle, in bold
   (--field-steps-number-weight). The steps are shown by components.js; without the script the number field alone.
   The rows, the row that adds one (steps_add) and the total stand in the inner box with rounded corners (K55, the
   pilot session 11/11): a thin line between the rows, a stronger one over the total, and no line free on the page.
   The box clips nothing, so that the list of the row that adds one opens over what stands under it. */
.ui-field-steps {
  display: flex;
  flex-direction: column;
  border: var(--line-thin) solid var(--field-steps-box-border);
  border-radius: var(--field-steps-box-radius);
}
.ui-field-steps > * + * {
  border-top: var(--line-thin) solid var(--field-steps-divider);
}
.ui-field-steps > .ui-field-steps-row {
  padding-inline: var(--field-steps-box-pad);
}
.ui-field-steps > .ui-field-steps-total {
  border-top-color: var(--field-steps-total-divider);
}
.ui-field-steps-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--field-steps-gap);
  min-height: var(--field-steps-row-min);
  margin: 0;
  padding-block: var(--field-steps-row-pad);
}
.ui-field-steps-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-weight: var(--weight-strong);
}
.ui-field-steps-label .ui-field-hint {
  font-weight: normal;
}
.ui-field-steps-control {
  display: flex;
  align-items: center;
  gap: var(--field-steps-control-gap);
  flex: none;
}
.ui-field-steps-control [hidden] {
  display: none;
}
.ui-field-steps-control .ui-button {
  min-width: var(--field-steps-button);
  min-height: var(--field-steps-button);
  padding-inline: 0;
}
/* The signs of the steps are the button's symbols minus and plus (parts/button_icon.html), never a character. */
.ui-field-steps-control .ui-button-icon {
  width: var(--field-steps-icon-size);
  height: var(--field-steps-icon-size);
}
.ui-field-steps-control .ui-input {
  /* .ui-input's least width (--field-min) would hold it wider than the total's sum under it (round 3 of #911) */
  min-width: var(--field-steps-input);
  width: var(--field-steps-input);
  min-height: var(--field-steps-button);
  text-align: center;
  font-weight: var(--field-steps-number-weight);
  font-variant-numeric: tabular-nums;
}
/* The quiet row (K55, 1g.11g.1): a count of 0 stays in the list, with the name, the line and the number in the quiet
   text colour. The whole row is quiet (the pilot session 11/11): the field's frame is the soft line and its number
   is not bold, and the step - is out of use (the inactive button's look, components.js). The step + stays as it is. */
.ui-field-steps-row-quiet .ui-field-steps-label,
.ui-field-steps-row-quiet .ui-input {
  color: var(--field-steps-quiet-text);
}
.ui-field-steps-row-quiet .ui-input {
  border-color: var(--field-steps-quiet-border);
  font-weight: var(--field-steps-quiet-weight);
}
/* The row that adds one (steps_add, the value picker's plus): as wide as the box, so that the whole row is the button. */
.ui-field-steps-add {
  display: flex;
  flex-direction: column;
}
.ui-field-steps-total {
  font-weight: var(--weight-strong);
}
/* The total's sum in the number column: as wide as the number field and centred as its digits, with a pad as wide as a
   step on each side once the steps are shown, so that 13 stands under 7, 2, 1 and 3. */
.ui-field-steps-sum {
  display: flex;
  align-items: center;
  gap: var(--field-steps-control-gap);
  flex: none;
}
.ui-field-steps-sum [hidden] {
  display: none;
}
.ui-field-steps-pad {
  width: var(--field-steps-button);
}
.ui-field-steps-sum output {
  box-sizing: border-box;
  width: var(--field-steps-input);
  text-align: center;
  font-size: var(--text-field);
  font-weight: var(--field-steps-number-weight);
  font-variant-numeric: tabular-nums;
}

/* ---- Fact list (T2.103, Björn 7/11 K39): label and value in the same track, two columns also on a phone ---- */
.ui-facts-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  min-height: var(--control-min); /* as high with the button as without it, so that the rows start at one height */
  margin-bottom: var(--facts-head-gap);
}
.ui-facts-title {
  margin: 0;
  font-size: var(--facts-title-size);
}
.ui-facts-head > :last-child:not(.ui-facts-title) {
  margin-left: auto;
}
/* The label column is as wide as its longest label and gives way before the value does: a phone, an address and a date
   keep their line (ui-facts-whole), an e-mail address breaks only after its own marks (address_breaks), and a label of
   more than one word breaks at its words, never inside one (E-post is one word, keep_hyphenated). */
.ui-facts-list {
  display: grid;
  grid-template-columns: minmax(min-content, max-content) minmax(min-content, 1fr);
  align-items: start;
  gap: var(--facts-gap-y) var(--facts-gap-x);
  margin: 0;
}
.ui-facts-row {
  display: contents;
}
.ui-facts-label {
  padding-top: var(--facts-label-pad);
  color: var(--facts-label-text);
  font-size: var(--facts-label-size);
}
.ui-facts-label .ui-keep {
  white-space: nowrap;
}
.ui-facts-value {
  min-width: 0;
  margin: 0;
  color: var(--facts-value-text);
}
.ui-facts-whole {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* A value's strong part first (strong, T19.2.2, K84 fråga 3): the account's number in bold with table digits, and the
   name after it in the body's weight. */
.ui-facts-strong {
  margin-inline-end: var(--facts-strong-gap);
  font-weight: var(--facts-strong-weight);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ui-facts-link {
  position: relative;
  color: var(--color-link);
}
/* A folded column's negative amount is red, also as a link, as the column's own cell (ui-neg, 1h.6; P.0.17c). */
.ui-facts-value.ui-neg > .ui-facts-link,
.ui-facts-value.ui-better > .ui-facts-link {
  color: inherit;
}
.ui-facts-value.ui-neg {
  color: var(--color-negative-amount);
  font-weight: var(--weight-strong);
}
.ui-facts-value.ui-better {
  color: var(--color-positive-text);
  font-weight: var(--weight-medium);
}
.ui-facts-empty {
  margin: 0;
  color: var(--facts-empty-text);
}
/* The list in a narrow column, as in a side card (measure narrow): where an address breaks at its @ or / or is cut. */
.ui-facts-narrow {
  max-width: var(--facts-measure-narrow);
}
/* A count per row (tally, 1g.11g, K55): the label in the body's text with its note after it in the weaker text, the
   value at the right in bold with table digits, and the total last in bold under a line that runs unbroken under both
   columns (no column gap: the value keeps its distance with its own padding). */
.ui-facts-tally .ui-facts-list {
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 0;
}
.ui-facts-tally .ui-facts-label {
  padding-top: 0;
  color: var(--facts-value-text);
  font-size: inherit;
}
.ui-facts-tally .ui-facts-value {
  padding-left: var(--facts-gap-x);
  text-align: right;
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
}
/* A column of figures (figures, pilotsessionen 11/11, K39), as a section's key figures: the label as in the list, and the
   value at the right in a column of its own, as wide as its widest value, right-aligned with table digits, so that the
   figures stand under each other and their ones line up. The label column takes the rest of the room. */
.ui-facts-figures .ui-facts-list {
  grid-template-columns: minmax(min-content, 1fr) max-content;
}
.ui-facts-figures .ui-facts-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ui-facts-note {
  margin-left: var(--facts-note-gap);
  color: var(--facts-label-text);
  font-size: var(--facts-label-size);
}
.ui-facts-total > .ui-facts-label,
.ui-facts-total > .ui-facts-value {
  padding-top: var(--facts-total-pad);
  border-top: var(--line-thin) solid var(--facts-total-border);
  font-weight: var(--weight-strong);
}
/* An e-mail or web address (K47, Björn 9/11): it breaks only after its @ or / (address_breaks makes a piece of each, and
   a piece is never broken), and what does not fit even so is cut with an ellipsis, the only thing the fact list cuts. The
   cell does not widen the column for it (contain: inline-size), so the column is as wide as the room and a long address is
   cut and not pushed out of the card. components.js marks a cut address (data-cut) and a tap, or Enter, shows it whole in
   a box (ui-facts-pop). */
.ui-facts-value-address {
  contain: inline-size;
}
.ui-facts-piece {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
  /* an inline-block does not take its link's underline from it, so it takes the link's own, in rest and on hover */
  text-decoration: inherit;
  text-underline-offset: inherit;
}
/* The box of a cut address: the whole address and the one action (Skriv e-post or Öppna), over the page and placed by the
   common placement (placePop), so that the page never changes for it. Here the pieces are whole, and a piece that is wider
   than the box (the window) breaks inside itself as a last resort (break-word), so that the whole address can always be read. */
/* A cut address is one line, cut once at its end, and never pieces with an ellipsis each (pilotsessionen 11/11, K39 v3
   at 390 px): components.js marks it (data-cut) where a piece does not fit, and a tap shows it whole. Clipped only in
   the inline direction, so that the link's tap target with touch (::after) is not. */
.ui-facts-address[data-cut] {
  display: block;
  overflow-x: clip;
  overflow-y: visible;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ui-facts-address[data-cut] .ui-facts-piece {
  display: inline;
  max-width: none;
  overflow: visible;
}
/* a <wbr> breaks a line in Chrome also where nothing else may (nowrap) */
.ui-facts-address[data-cut] wbr {
  display: none;
}
.ui-facts-pop {
  position: fixed;
  top: var(--facts-pop-y, 0);
  left: var(--facts-pop-x, 0);
  z-index: var(--facts-address-pop-layer);
  display: flex;
  flex-direction: column;
  gap: var(--facts-address-pop-gap);
  width: max-content;
  max-width: min(var(--facts-address-pop-max), calc(100vw - 2 * var(--facts-address-pop-margin)));
  padding: var(--facts-address-pop-pad-y) var(--facts-address-pop-pad-x);
  border: var(--line-thin) solid var(--facts-address-pop-border);
  border-radius: var(--facts-address-pop-radius);
  background: var(--facts-address-pop-bg);
  color: var(--facts-address-pop-text);
  box-shadow: var(--facts-address-pop-shadow);
  font-size: var(--facts-address-pop-size);
  line-height: var(--facts-address-pop-leading);
}
.ui-facts-pop[hidden] {
  display: none;
}
.ui-facts-pop-address {
  margin: 0;
}
.ui-facts-pop-address .ui-facts-piece {
  max-width: none;
  overflow: visible;
  white-space: normal;
  overflow-wrap: break-word;
}
.ui-facts-pop-action {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: var(--control-min-fine);
  color: var(--facts-address-pop-action);
  font-weight: var(--weight-medium);
}
@media (pointer: coarse), (any-pointer: coarse) {
  .ui-facts-pop-action {
    min-height: var(--target-min);
  }
}
@media print {
  .ui-facts-pop {
    display: none;
  }
  .ui-facts-piece {
    overflow: visible;
    white-space: normal;
    overflow-wrap: break-word;
  }
}
/* With touch the drawn text stays as small as it is, and the tap target is the row: as high as --target-min, the link's
   ::after the whole row's height, so that two rows never share a target. Only a row that can be tapped (ui-facts-tall: a
   link, a phone, an e-mail address, a web address) is that high: a row of text keeps the list's own dense rhythm
   (--facts-gap-y) in every width and is never given the air of a tap target, as the key figures and the company data
   (the pilot session 9/11, T2.104, and 15/11 after the side by side of #819: 44 px is the tap target, not what is drawn).
   The label stands at the top of its row, also
   when the value runs over several lines (K46, Björn 9/11): both cells start at the top and are pushed down so that
   the FIRST line of each is centred in the target (its own line height, 1lh), and the label's text is then on the same
   line as the value's first line. A label is never centred against the whole value. The cells stay blocks (rättningsrunda
   DX2): as flex containers they made the words of a label with a hyphen (keep_hyphenated, E-post) separate flex items
   that lost the space between them ("FakturaE-post") and could not break between the words. The target is at least as
   wide as it is high: the containing block of a link that breaks over lines ends at its LAST line, so an address whose
   last piece is short (".test") got a target of 22 px. */
@media (pointer: coarse), (any-pointer: coarse) {
  .ui-facts-label.ui-facts-tall,
  .ui-facts-value.ui-facts-tall {
    min-height: var(--facts-row-step-touch);
    padding-top: calc((var(--facts-row-step-touch) - 1lh) / 2);
  }
  .ui-facts-link::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    min-width: var(--target-min);
    height: var(--target-min);
    transform: translateY(-50%);
  }
}
@media (max-width: 599px) {
  .ui-facts-list {
    column-gap: var(--facts-gap-x-narrow);
  }
  .ui-facts-title {
    font-size: var(--facts-title-size-narrow);
  }
}

/* The source stamp (source_stamp, T2.101, Björn 7/11 kväll, rule 7, built as K44 Rekommenderat, Björn 9/11): where a fact
   was fetched from is a small label in the upper right corner of the card, and who changed it and when is a grey line at
   the foot of the card, never running text under a badge. The stamp holds its words for a screen reader (position,
   ui-visually-hidden "Ändrad av"), so that they stay in a table's box that scrolls sideways and never widen the page
   (1f.L.1: the supplier list at 600-639 px). */
.ui-source-stamp {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--source-stamp-gap);
  min-width: 0;
  max-width: 100%;
  padding: var(--source-stamp-pad);
  border: var(--line-thin) solid var(--source-stamp-border);
  border-radius: var(--source-stamp-radius);
  background: var(--source-stamp-surface);
  color: var(--source-stamp-text);
  font-size: var(--source-stamp-size);
  font-weight: var(--weight-regular);
  line-height: var(--leading-tight);
  /* the text takes a second line between words when the room is short and never leaves its card; the date is one word
     (ui-date) and no word is broken in the middle (T2.101, round DR) */
  hyphens: manual;
  overflow-wrap: normal;
}
.ui-source-stamp-icon {
  flex: none;
  width: var(--source-stamp-icon);
  height: var(--source-stamp-icon);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--icon-line);
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* The name in the stamp of who changed it (by) is one word, as the date: the label breaks only between them. */
.ui-source-stamp-name {
  white-space: nowrap;
}
/* The person (K44): a grey line of text last in the card, after its content, with a thin line above it, in the weakest
   text colour. It is no label and has no symbol: the words say what it is. */
.ui-source-stamp-by {
  margin-top: auto;
  padding-top: var(--source-stamp-by-pad);
  border-top: var(--line-thin) solid var(--source-stamp-by-line);
  color: var(--source-stamp-text);
  font-size: var(--source-stamp-by-size);
  line-height: var(--leading-tight);
  hyphens: manual;
  overflow-wrap: normal;
}
/* The label in a heading row: at the right edge, on the heading's line, and when it does not fit there, on a line of its
   own under the heading at the content's left edge (K44, Björn 9/11 about T2.101 at 390: never indented, never right
   aligned, never somewhere in between). The item that stands right before the label (the heading, or the badges, the
   filters or the aside that stand between them) has the auto margin on its right, so the label is pushed to the right
   while it fits on that line, and, alone on a line of its own, has no margin to be pushed by and starts at the left edge.
   One rule, whatever stands between the heading and the label. Stamped rows keep the stamp's gaps, a post's name is
   larger, and with touch the row is a tap target high so that a fold that is added later has room. */
.ui-heading-row-stamped {
  gap: var(--source-stamp-head-gap);
}
.ui-heading-row > .ui-source-stamp {
  flex: 0 1 auto;
  margin-left: 0;
}
.ui-heading-row > :has(+ .ui-source-stamp) {
  margin-right: auto;
}
.ui-heading-row > .ui-source-stamp + .ui-actions {
  margin-left: 0;
}
.ui-heading-row-post > .ui-panel-title {
  font-size: var(--text-xl);
}
/* The small heading (size small, 1g.11b, K48): the card's own heading with its status beside it, a step under the panel's. */
.ui-heading-row-small > .ui-panel-title {
  font-size: var(--text-lg);
}
.ui-source-stamp-body {
  margin: 0;
}
.ui-source-stamp-card-narrow {
  max-width: var(--source-stamp-narrow);
}
.ui-source-stamp-card-tight {
  max-width: var(--source-stamp-tight);
}
@media (pointer: coarse) {
  .ui-heading-row-stamped {
    min-height: var(--source-stamp-head-min);
  }
}

/* The section card (section_card, T2.104, Björn 7/11 K39 rules 2, 3, 6 and 7): each section of a post is a card of its own
   with a frame (the card's own: --card-edge and the surface), the source's stamp in its corner and, where its group is
   narrow, a fold that shows the section's main value on the heading row. The surface decides, never the device: the
   group (ui-section-cards, the container named section-cards) is narrow under 560 px, which is a phone's width and a
   narrow column's, and the container query cannot read a token. Without the group, or without JavaScript, nothing
   folds and everything is shown. */
.ui-section-cards {
  container: section-cards / inline-size;
}
.ui-section-cards-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--section-cards-gap);
  align-items: start;
}
.ui-section-cards-narrow {
  max-width: var(--section-cards-narrow);
}
.ui-section-card {
  min-width: 0;
}
.ui-section-card-frame {
  display: flex;
  flex-direction: column;
  gap: var(--section-card-gap);
  min-width: 0;
  background: var(--color-surface);
  border: var(--line-thin) solid var(--card-edge);
  padding: var(--section-card-pad-top) var(--section-card-pad-side) var(--section-card-pad-bottom);
}
/* The state is the top edge and nothing else, in the card's own width of it and with the room over the heading less by
   as much, so that a card with a state is as high as the others (as ui-card-warning). */
.ui-section-card-warning > .ui-section-card-frame {
  border-top: var(--line-card) solid var(--card-tone-warning);
  padding-top: calc(var(--section-card-pad-top) - var(--line-card) + var(--line-thin));
}
.ui-section-card-critical > .ui-section-card-frame {
  border-top: var(--line-card) solid var(--card-tone-critical);
  padding-top: calc(var(--section-card-pad-top) - var(--line-card) + var(--line-thin));
}
.ui-section-card-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--section-card-head-gap);
  min-width: 0;
}
.ui-section-card-head > .ui-heading-row {
  flex: 1 1 auto;
  min-width: 0;
}
.ui-section-card-head .ui-panel-title {
  font-size: var(--section-card-title-size);
}
.ui-section-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--section-card-body-gap);
  min-width: 0;
}
/* the person's line is the last in the card and has no gap of its own to keep (source_stamp) */
.ui-section-card-body > .ui-source-stamp-by {
  margin-top: 0;
}
.ui-section-card-peek,
.ui-section-card-toggle {
  display: none;
}
/* A yes or no as the main value of a folded card ("Finns i ekonomisystemet") breaks between its words where the head is
   narrow, and never runs in under the chevron (1f.L.1, K39 v3 at 390 px). */
.ui-section-card-peek .ui-yes-no {
  min-width: 0;
  white-space: normal;
}
.ui-section-card-chevron {
  flex: none;
  width: var(--section-card-chevron-size);
  height: var(--section-card-chevron-size);
  fill: none;
  stroke: var(--section-card-chevron);
  stroke-width: var(--icon-line);
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--motion-fast);
}
.ui-section-card-toggle[aria-expanded="true"] .ui-section-card-chevron {
  transform: rotate(90deg);
}
/* Ring and Mejla (Björn's rule 6): two large buttons side by side, the width shared, a tap target high with a mouse too
   (--section-card-call-min); the name over them with the role after it. */
.ui-section-card-call {
  display: grid;
  gap: var(--section-card-call-name-gap);
}
.ui-section-card-call-name {
  margin: 0;
  font-weight: var(--weight-heading);
}
.ui-section-card-call-role {
  margin-left: var(--space-3);
  color: var(--color-text-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
}
.ui-section-card-call-buttons {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--section-card-call-gap);
}
.ui-section-card-call-button.ui-button {
  justify-content: center;
  gap: var(--space-3);
  min-height: var(--section-card-call-min);
  font-weight: var(--weight-heading);
}
.ui-section-card-call-icon {
  flex: none;
  width: var(--section-card-call-icon);
  height: var(--section-card-call-icon);
  fill: none;
  stroke: var(--color-action);
  stroke-width: var(--icon-line);
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Wide: the cards side by side, and one that spans the whole row where it says so (the control). */
@container section-cards (width >= 560px) {
  .ui-section-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ui-section-card-wide {
    grid-column: 1 / -1;
  }
}
/* Narrow with JavaScript: the head is the button, a tap target high and the whole row (the button covers it, and the
   chevron stands at its right edge, so the target can be larger than what is drawn), and a shut card shows its main value
   where the source's label stood. A shut card's frame is the head and nothing more.
   Only on a screen (the pilot session 9/11, G1 of #896): a printout has no fold, so every card is open and shown whole, the
   button and the main value on the head are not drawn (the base rules above hide them) and the Lägg till button is not
   drawn either (.ui-actions in the print rules). */
@media screen {
  @container section-cards (width < 560px) {
    html[data-js] .ui-section-card-frame {
      padding: 0 var(--section-card-pad-side-narrow);
    }
    html[data-js] .ui-section-card-warning > .ui-section-card-frame,
    html[data-js] .ui-section-card-critical > .ui-section-card-frame {
      padding-top: 0;
    }
    /* The main value of a shut card stands beside the heading where both fit on one line, and under it where they do
       not, never broken beside it (pilotsessionen 11/11, K39 v3: "Finns i ekonomisystemet" at 390 px), as the source's
       label does (T2.101). */
    html[data-js] .ui-section-card-head {
      flex-wrap: wrap;
      min-height: var(--section-card-head-min);
      padding-right: var(--section-card-chevron-room);
    }
    html[data-js] .ui-section-card-head .ui-panel-title {
      font-size: var(--section-card-title-size-narrow);
    }
    html[data-js] .ui-section-card-toggle {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      padding: 0;
      border: 0;
      border-radius: var(--radius-sm);
      background: none;
      cursor: pointer;
    }
    html[data-js] .ui-section-card-frame:has(> .ui-section-card-head .ui-section-card-toggle[aria-expanded="true"]) {
      padding-bottom: var(--section-card-pad-bottom);
    }
    html[data-js] .ui-section-card-frame:has(> .ui-section-card-head .ui-section-card-toggle[aria-expanded="false"]) > .ui-section-card-body {
      display: none;
    }
    html[data-js] .ui-section-card-frame:has(> .ui-section-card-head .ui-section-card-toggle[aria-expanded="false"]) .ui-source-stamp {
      display: none;
    }
    html[data-js] .ui-section-card-frame:has(> .ui-section-card-head .ui-section-card-toggle[aria-expanded="false"]) .ui-section-card-peek {
      display: inline-flex;
      align-items: center;
      flex: 1 1 auto;
      gap: var(--space-2);
      min-width: 0;
      color: var(--section-card-peek-text);
      font-size: var(--section-card-peek-size);
    }
    html[data-js] .ui-section-card-frame:has(> .ui-section-card-head .ui-section-card-toggle[aria-expanded="false"]) .ui-heading-row {
      flex: 0 1 auto;
    }
    /* Lägg till stands on the head, at the right beside the source's label (the pilot session 9/11, K46): above the button
       that covers the head, so that it can be tapped, and hidden while the card is folded, as its body is. */
    html[data-js] .ui-section-card-head .ui-heading-add {
      position: relative;
      z-index: 1;
    }
    html[data-js] .ui-section-card-frame:has(> .ui-section-card-head .ui-section-card-toggle[aria-expanded="false"]) .ui-heading-add {
      display: none;
    }
  }
}
/* The navigation variant (T2.108, K85 A, Björn 12/11; components/nav_link.html): everything that only takes the user to
   another page. Text in the link's colour, underlined at rest so that nothing hangs on hover, with no fill, no edge and
   no box; the line is thicker under the mouse and with the keyboard's focus, and focus has the page's ring
   (:focus-visible). In a row of actions it has the height and the font of the row's buttons, in a compact row theirs too
   (--control-min). Back has the arrow before the words; small is the text's size of a card, with a tap target of 44 px
   with touch that does not make the row higher; in running text it takes the text's own size and weight. The values
   are the tokens --nav-link-*. Placed before the block for reduced motion, which stays last. */
.ui-nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--nav-link-arrow-gap);
  min-height: var(--nav-link-height);
  box-sizing: border-box;
  padding: 0 var(--nav-link-pad);
  color: var(--nav-link-text);
  font-family: var(--nav-link-font);
  font-weight: var(--nav-link-weight);
  font-size: var(--nav-link-size);
  line-height: var(--leading-tight);
  text-decoration-line: underline;
  text-decoration-thickness: var(--nav-link-line);
  text-underline-offset: var(--nav-link-underline-offset);
  white-space: nowrap;
}
.ui-nav-link:hover,
.ui-nav-link:focus-visible {
  text-decoration-thickness: var(--nav-link-line-hover);
}
.ui-nav-link:focus-visible {
  border-radius: var(--radius-md);
}
.ui-nav-link-arrow {
  flex: none;
  width: var(--nav-link-arrow);
  height: var(--nav-link-arrow);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--nav-link-arrow-line);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ui-actions-compact .ui-nav-link {
  min-height: var(--control-min);
}
.ui-nav-link-small {
  position: relative;
  min-height: 0;
  padding: 0;
  font-size: var(--nav-link-size-small);
}
.ui-nav-link-in-text {
  position: relative;
  display: inline;
  min-height: 0;
  padding: 0;
  font: inherit;
  white-space: normal;
}
/* With touch, and on a computer that also has a touch screen: the small one and the one in running text keep a tap target
   of 44 px, drawn round them and outside the flow, so that the row of a card stays a line of text and a sentence keeps
   its lines (pattern 1 of the review list: the tap height only for what can be tapped). With a mouse they are their
   text. */
@media (pointer: coarse), (any-pointer: coarse) {
  .ui-nav-link-small::before,
  .ui-nav-link-in-text::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: var(--target-min);
    transform: translateY(-50%);
  }
}
/* A chevron or arrow that turns when its control opens turns at once under prefers-reduced-motion (T2.112): the state
   changes and nothing moves. One block for all of them, last in the file, so that no later rule gives a transition back
   (the value picker's arrow and the row's expander are defined after the disclosure's icon). A new turning chevron with
   a transition on transform belongs in this list; e2e/reduced-motion.spec.ts sweeps the catalogue for every element with
   such a transition and fails if one still moves under reduced motion. */
@media (prefers-reduced-motion: reduce) {
  .ui-disclosure-icon,
  .ui-valuepicker-arrow,
  .ui-picker-toggle svg,
  .ui-row-toggle-icon,
  .ui-section-card-chevron {
    transition: none;
  }
}

/* The progress bar (1g.9b, K35): the fill is what is reported, the mark where the plan is today; both are set by the
   custom properties --progress and --progress-plan (whole percent, no unit) on the element. */
.ui-progress-bar {
  position: relative;
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  height: var(--progress-bar-height);
  background: var(--progress-bar-track);
  border-radius: var(--progress-bar-radius);
}
.ui-progress-bar-fill {
  display: block;
  height: 100%;
  width: calc(var(--progress, 0) * 1%);
  background: var(--progress-bar-fill);
  border-radius: var(--progress-bar-radius);
}
.ui-progress-bar-plan {
  position: absolute;
  top: 50%;
  left: calc(var(--progress-plan, 0) * 1%);
  width: var(--progress-bar-mark-width);
  height: var(--progress-bar-mark-height);
  background: var(--progress-bar-mark);
  transform: translate(-50%, -50%);
}

/* The five steps (1g.9b, K35): a group of buttons, a tap on one chooses it. Each step is --steps-height high (--control-min:
   36 px with a mouse, the tap target of 44 px with touch) and shares the width; the chosen one is on the dark surface and is also marked for a screen reader (aria-pressed). */
.ui-steps {
  display: flex;
  border: var(--line-thin) solid var(--steps-edge);
  border-radius: var(--steps-radius);
  overflow: hidden;
  background: var(--steps-bg);
}
.ui-step {
  flex: 1 1 0;
  min-width: 0;
  min-height: var(--steps-height);
  padding: 0 var(--space-2);
  border: 0;
  border-left: var(--line-thin) solid var(--steps-edge);
  background: var(--steps-bg);
  color: var(--steps-text);
  font: inherit;
  cursor: pointer;
}
.ui-step:first-child {
  border-left: 0;
}
.ui-step[aria-pressed="true"] {
  background: var(--steps-on-bg);
  color: var(--steps-on-text);
  font-weight: var(--weight-bold);
}
.ui-step:focus-visible {
  outline: var(--line-medium) solid var(--color-focus);
  outline-offset: calc(-1 * var(--line-medium));
}

/* The phone's progress page (1g.9b, K35): a list of rows, each a stack with the bar, the steps and the foot. */
.ui-progress-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ui-progress-row {
  display: flex;
  flex-direction: column;
  gap: var(--progress-row-gap);
  padding: var(--progress-row-pad) 0;
  border-top: var(--line-thin) solid var(--color-border);
}
.ui-progress-row:first-child {
  border-top: 0;
}
.ui-progress-row p {
  margin: 0;
}
.ui-progress-name {
  font-weight: var(--weight-bold);
}
.ui-progress-line {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.ui-progress-value {
  flex: 0 0 var(--progress-value-width);
  text-align: right;
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
}
.ui-progress-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}
.ui-progress-fact {
  color: var(--color-text-2);
}
.ui-more-button,
.ui-progress-undo {
  margin-left: auto;
  min-height: var(--control-min); /* T2.120: 36 px with a mouse, the tap target (44 px) with touch */
  min-width: var(--control-min);
  padding: 0 var(--space-4);
  border: 0;
  background: none;
  color: var(--color-action);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.ui-progress-saved {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.ui-progress-saved[hidden],
.ui-progress-form[hidden] {
  display: none;
}
.ui-progress-mark {
  display: flex;
  align-items: center;
  min-height: var(--target-min);
}
.ui-progress-mark:empty {
  display: none;
}
.ui-progress-form {
  display: flex;
  flex-direction: column;
  gap: var(--progress-row-gap);
}

/* The diary's row Färdiggrad v. N (1g.9b, K35): a whole tap target that leads to the phone's progress page, the title and the
   line about what is not reported under it. */
.ui-diary-progress {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--target-min);
  padding: var(--space-4) var(--space-7);
  border: var(--line-thin) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
}
.ui-diary-progress-label {
  font-weight: var(--weight-bold);
  color: var(--color-action);
  text-decoration: underline;
}
