/* Internal area, after docs/design/README.md. Colours, fonts and radii
   come from tokens.css; this file holds no literal colour values. */

/* Space for the scrollbar on every page, short or long, so that header
   and content do not shift by half its width between pages (public area,
   internal area and guest account alike). Overlay scrollbars (phones,
   tablets, macOS with a trackpad) take no space, so nothing changes there. */
html {
  scrollbar-gutter: stable;
  /* Firefox scrolls a focused control into view only when no part of it is
     visible, and counts its focus ring as a part: a link just below the
     window stayed hidden while its ring peeked in. With a scroll-padding it
     counts only what lies inside the padding, and scrolls with room for the
     ring (2px offset and 2px width), 0.19.0. The sticky bar of the event
     form sets its own, larger bottom (html:has(.event-form .form-actions),
     more specific). */
  scroll-padding: 6px;
}

/* Typography */

/* A column, so the footer of pages without side navigation sits at the
   bottom of the window on short pages. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
}

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 17px;
}

p {
  margin: 0 0 0.75em;
}

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

a:hover {
  color: var(--color-accent);
}

:focus-visible {
  outline: 2px solid var(--color-navy);
  outline-offset: 2px;
}

code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.93em;
}

/* Small uppercase labels, e.g. table heads and categories */
.label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-label);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* hidden must win over display rules such as the one for buttons */
[hidden] {
  display: none !important;
}

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

/* The arrow after a link to another host (apps.core.links, W40), on the
   public and the internal pages. */
.link-external {
  margin-left: 0.2em;
}

/* Page layout: header with the brand gradient on top, side navigation on
   the left */

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  color: var(--color-navy);
  background: var(--color-surface);
  border-radius: var(--radius-control);
}

.skip-link:focus {
  top: 0.5rem;
}

/* The ring inside the white box: outside it would lie on the dark header
   (1.2:1, 0.19.0). */
.skip-link:focus-visible {
  outline-offset: -4px;
}

/* The target of the skip link takes the focus (tabindex="-1"), but shows no
   ring around the whole content. */
main:focus {
  outline: none;
}

/* The left padding (24px) puts the logo in line with the icons of the side
   navigation below (12px padding of the navigation plus 12px of each link),
   in the column and in the row of narrow screens. position and z-index let
   the shadow fall onto the white side navigation; z-index 5 keeps the user
   menu above the content as before. */
.topbar {
  position: relative;
  z-index: 5;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 6px 24px;
  color: var(--color-surface);
  background: linear-gradient(
    to right,
    var(--brand-header-start),
    var(--brand-header-end)
  );
  box-shadow: var(--brand-header-shadow);
}

.topbar :focus-visible {
  outline-color: var(--color-surface);
}

/* 5px below the middle of the header, the link with it, so its focus
   outline surrounds the word mark. */
.brand {
  position: relative;
  top: 5px;
  display: flex;
  flex: none;
  align-items: center;
  color: var(--color-surface);
  text-decoration: none;
}

/* The word mark (static/brand/), white with the text in paths. */
.brand-logo {
  display: block;
  flex: none;
  width: 190px;
  height: auto;
}

.topbar-end {
  display: flex;
  flex: none;
  gap: 1rem;
  align-items: center;
}

/* Language switch: two segments, the current language highlighted */

.language-switch {
  display: flex;
  padding: 0;
  margin: 0;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
  list-style: none;
  border: 1px solid var(--brand-header-line);
  border-radius: var(--radius-control);
}

.language-switch a,
.language-switch span {
  display: block;
  padding: 10px;
  line-height: 1;
  color: var(--color-surface);
  text-decoration: none;
}

.language-switch a:hover {
  color: var(--color-surface);
  background: var(--brand-header-veil);
}

/* Inside the link: the switch cuts off everything outside its border. */
.language-switch a:focus-visible {
  outline-offset: -4px;
}

.language-switch [aria-current] {
  font-weight: 500;
  color: var(--color-navy);
  background: var(--color-surface);
}

/* The bell with the number of new notifications (0.20.0) */

.bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-height: var(--control-height);
  color: var(--color-surface);
  border-radius: var(--radius-control);
}

.bell:hover,
.bell[aria-current] {
  color: var(--color-surface);
  background: var(--brand-header-veil);
}

/* At the upper right of the bell, above its middle. */
.bell-number {
  position: absolute;
  top: 3px;
  left: 50%;
  box-sizing: border-box;
  min-width: 18px;
  padding: 0 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 18px;
  color: var(--color-navy);
  text-align: center;
  background: var(--color-avatar);
  border-radius: 9px;
}

/* User menu */

/* The panel hangs from the header, not from the summary: it opens at the
   right edge of the header even when the header wraps and the summary
   stands on the left (0.19.0, step 4). Without top it stays where it would
   be in the flow, below the summary. */
.user-menu {
  position: static;
}

.user-menu summary {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: var(--control-height);
  padding: 0 6px;
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius-control);
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-menu summary:hover,
.user-menu[open] summary {
  background: var(--brand-header-veil);
}

.avatar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-navy);
  background: var(--color-avatar);
  border-radius: 50%;
}

.user-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

/* A very long name is cut off rather than pushing the header onto two
   lines; screen readers still read all of it. */
.user-name {
  max-width: 16rem;
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role {
  font-size: 12px;
  color: var(--color-header-muted);
}

.user-menu-panel {
  position: absolute;
  right: 24px;
  max-width: calc(100vw - 48px);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 14rem;
  padding: 1rem;
  margin-top: 6px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: 0 6px 20px rgb(11 31 58 / 15%);
}

.user-menu-panel button {
  width: 100%;
}

/* Name and address at the top of the panel, wrapping instead of being cut
   off: the name in the header ends in "…" when it is long (or with the text
   spacing of WCAG 1.4.12), here keyboard and touch reach all of it. */
.user-menu-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-wrap: break-word;
}

.user-menu-name {
  font-weight: 600;
}

/* The panel lies in the header but on a white ground: the ring of the page,
   not the white one of the header (0.19.0, step 3b). */
.user-menu-panel :focus-visible {
  outline-color: var(--color-navy);
}

/* Room and rounding for the ring of the link, as in the side navigation;
   the negative margin keeps the text where it stands. */
.user-menu-panel a {
  align-self: flex-start;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: var(--radius-control);
}

.user-menu-panel a:focus-visible {
  outline-offset: 0;
}

/* Below 26rem (416px) the panel reaches from gutter to gutter (0.19.0,
   WCAG 2.5.8): hanging from the right it left a strip of the breadcrumb
   free at 390px, too thin to hit but still a link. Now it covers the
   breadcrumb whole. */
@media (width < 26rem) {
  .user-menu-panel {
    right: 16px;
    left: 16px;
    max-width: none;
  }
}

/* Side navigation and content */

.shell {
  display: grid;
  flex: 1 0 auto;
  grid-template-columns: minmax(0, 1fr);
}

.shell.has-sidenav {
  grid-template-columns: 240px minmax(0, 1fr);
}

/* Left column: navigation at the top, footer at the bottom. */
.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
}

.sidenav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 12px;
}

/* position: relative keeps the hidden text of the counter inside the link;
   otherwise it would be placed relative to the page and, in the scrolling
   row of narrow screens, widen the page. */
.sidenav a {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: var(--control-height);
  padding: 0 12px;
  color: var(--color-text-nav);
  text-decoration: none;
  border-radius: var(--radius-control);
}

.sidenav a:hover {
  color: var(--color-accent-dark);
  background: var(--color-accent-light);
}

.sidenav a[aria-current="page"] {
  font-weight: 600;
  color: var(--color-navy);
  background: var(--color-nav-active);
}

/* The ring reaches 4px beyond the link, the next one begins 2px below and,
   being later in the page, painted over its lower edge (0.19.0, step 4e):
   the focused link lies above its neighbours. */
.sidenav a:focus-visible {
  z-index: 1;
}

.sidenav svg {
  flex: none;
}

.sidenav-heading {
  padding: 16px 12px 4px;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-label);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-top: 1px solid var(--color-divider-strong);
}

main {
  box-sizing: border-box;
  width: 100%;
  max-width: 76rem;
  padding: 32px;
}

/* Without the side navigation (login, error pages for those logged out),
   the content stands in the middle like the footer below it, so its card
   is centred in wide windows too (27.10.2026). */
.shell:not(.has-sidenav) > main {
  justify-self: center;
}

/* Below 64rem (1024px): the side navigation becomes a row below the header,
   the user menu shows only the initials (the name stays for screen
   readers). */
@media (width < 64rem) {
  .user-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .shell.has-sidenav {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .sidenav {
    flex-direction: row;
    gap: 4px;
    padding: 6px 12px;
    overflow-x: auto;
    /* keyboard.js brings a link in whole, with room for its focus ring
       (2px offset and 2px width), 0.19.0. */
    scroll-padding-inline: 4px;
  }

  .sidenav a {
    flex: none;
  }

  .sidenav-heading {
    display: none;
  }
}

/* Below 52rem (832px): less room around the content. */
@media (width < 52rem) {
  main {
    padding: 20px 16px;
  }
}

/* Below 30rem (480px): the gap in the header narrows, so the language
   switch and the user menu stay on the logo's line. With the bell, the
   switch shows only the language to switch to (0.20.0). */
@media (width < 30rem) {
  .topbar {
    column-gap: 12px;
  }

  .has-bell {
    gap: 8px;
  }

  .has-bell .language-current {
    display: none;
  }

  .bell {
    width: 32px;
  }
}

/* Below 24rem (384px), on phones 360px wide: the word mark at 160px, so the
   language switch and the user menu still fit beside it. */
@media (width < 24rem) {
  .brand-logo {
    width: 160px;
  }
}

/* Below 22.5rem (360px), down to 320px (WCAG 1.4.10): the word mark at
   136px and gaps of 8px, so everything stays on one line (0.19.0). */
@media (width < 22.5rem) {
  .brand-logo {
    width: 136px;
  }

  .topbar {
    column-gap: 8px;
  }

  .topbar-end {
    gap: 8px;
  }

  .topbar-end.has-bell {
    gap: 4px;
  }
}

/* Login: no navigation, the form as a card in the middle */

.login-card {
  max-width: 26rem;
  padding: 28px;
  margin: 48px auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}

.login-card h1 {
  font-size: 26px;
}

.login-card input {
  width: 100%;
}

.login-card button {
  width: 100%;
}

/* The page for blocked logins ends with its text. */
.login-card > :last-child {
  margin-bottom: 0;
}

/* "Forgot password?" under the login form */
.login-forgot {
  margin: 12px 0 0;
  font-size: 14px;
}

/* A link styled as a button fills the card like the buttons of its forms,
   its text centred as in every button (flex, not block). */
.login-card a.button {
  display: flex;
  text-align: center;
}

/* How long a login lasts, under the form */
.login-hint {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--color-text-secondary);
}

/* Error pages (templates/errors/, 500.html): a card in the middle, like
   the login, internal and on the public website. */

.error-card {
  max-width: 34rem;
  padding: 28px;
  margin: 48px auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}

.error-card h1 {
  font-size: 26px;
  overflow-wrap: break-word;
  hyphens: auto;
}

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

/* Messages */

.messages {
  padding: 0;
  list-style: none;
}

.message {
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-navy);
  border-radius: var(--radius-control);
}

/* Only messages shown elsewhere (e.g. missing fields on the event page) */
.messages:not(:has(li)) {
  display: none;
}

.message-success {
  border-left-color: var(--color-success);
}

.message-error {
  border-left-color: var(--color-error);
}

/* Buttons. Primary actions use the accent, secondary ones are outlined. */

.button,
button {
  box-sizing: border-box;
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height);
  padding: 0 1.1rem;
  font: inherit;
  font-weight: 600;
  color: var(--color-surface);
  text-decoration: none;
  cursor: pointer;
  background: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-control);
}

.button:hover,
button:hover {
  color: var(--color-surface);
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
}

.button-secondary,
button.button-secondary {
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-surface);
  border-color: var(--color-choice-border);
}

.button-secondary:hover,
button.button-secondary:hover {
  color: var(--color-accent-dark);
  background: var(--color-accent-light);
  border-color: var(--color-accent);
}

/* Destructive actions, e.g. deleting a draft */
.button-danger,
button.button-danger {
  background: var(--color-error);
  border-color: var(--color-error);
}

.button-danger:hover,
button.button-danger:hover {
  background: var(--color-error-dark);
  border-color: var(--color-error-dark);
}

/* Form fields: label above the field, at least 44px high */

input:not([type="checkbox"], [type="radio"], [type="hidden"]),
select,
textarea {
  box-sizing: border-box;
  max-width: 100%;
  min-height: var(--control-height);
  padding: 0 0.75rem;
  font: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-input-border);
  border-radius: var(--radius-control);
}

textarea {
  padding: 0.6rem 0.75rem;
}

/* Own colour for placeholders: Firefox shows the text colour at 54 %
   opacity (3.8 : 1), so the opacity goes back to 1. */
::placeholder {
  color: var(--color-placeholder);
  opacity: 1;
}

/* A select is never wider than its container (29.10.2026): Firefox sizes it
   after its longest option (names of departments, funding bodies, persons)
   and does not let a flex or grid item shrink below that, even with
   max-width: 100%. So every box holding a select may shrink, without
   specificity, so that an explicit min-width wins. The closed field then
   cuts a long option off, the open list shows it in full. */
:where(:has(select)) {
  min-width: 0;
}

select {
  text-overflow: ellipsis;
}

/* Selects draw their own arrow (0.19.0): Safari on the Mac draws a select
   as a control of the system, at a height of its own, and keeps neither
   min-height nor padding, so it stood lower than the text fields beside it.
   Without the look of the system every browser takes our height. The list
   that opens stays the browser's own, for the keyboard and screen readers
   nothing changes. The arrow is a triangle of two gradients in the colour of
   the text. Lists shown open (multiple, size) keep their look. In forced
   colours the system draws the select again (the block at the end). */
select:not([multiple], [size]) {
  appearance: none;
  padding-right: 2.25rem;
  background-image:
    linear-gradient(45deg, transparent 50%, currentcolor 50%),
    linear-gradient(135deg, currentcolor 50%, transparent 50%);
  background-repeat: no-repeat;
  background-position:
    right calc(0.75rem + 5px) center,
    right 0.75rem center;
  background-size: 5px 5px;
}

/* Date and time fields at a fixed height (0.19.0), like the other fields. */
input:is([type="date"], [type="time"]) {
  height: var(--control-height);
}

/* Two rules only for Safari (0.19.0), hanging-punctuation only Safari
   supports.

   Safari puts the date at the top of the field instead of in the middle,
   with IBM Plex Sans (7px above, 25px below the digits in WebKit under
   Linux, with the system font it stands in the middle). As a flex box the
   field centres the date. The field keeps its kind of box: a block in
   .field, inline in the room reservations.

   An empty date or time field in Safari on the Mac shows today's date (or
   the time) in a pale colour, as if it were filled in (WebKit bug 233215).
   static/js/date-fields.js marks the empty fields (data-empty), and while
   such a field has no focus the date is not shown. With the focus it comes
   back, to be typed over. Chrome shows the pattern "TT.MM.JJJJ" in an empty
   field through the same pseudo-element, and keeps it. */
@supports (hanging-punctuation: first) {
  input:is([type="date"], [type="time"]) {
    display: inline-flex;
    align-items: center;
  }

  .field > input:is([type="date"], [type="time"]) {
    display: flex;
  }

  input:is([type="date"], [type="time"])[data-empty]:not(:focus)::-webkit-datetime-edit {
    opacity: 0;
  }
}

/* File fields: the button stands on a line of its own and the status
   ("Keine Datei ausgewählt." or the file name) below it (0.19.0). Side by
   side the German texts need about 386px, more than many fields have (286px
   on the guest and website pages at every width, 246px at 320px), and the
   browser cuts them off. The field grows to the height of both lines. */
input[type="file"] {
  min-height: 0;
  height: auto;
  padding: 4px;
}

input[type="file"]::file-selector-button {
  display: block;
  box-sizing: border-box;
  height: calc(var(--control-height) - 10px);
  padding: 0 0.75rem;
  margin: 0 0 4px;
  font: inherit;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  background: var(--color-surface);
  border: 1px solid var(--color-choice-border);
  border-radius: var(--radius-control);
}

input[type="file"]::file-selector-button:hover {
  color: var(--color-accent-dark);
  background: var(--color-accent-light);
  border-color: var(--color-accent);
}

/* A file kept after an error elsewhere in the form
   (templates/forms/kept_file.html), above its file field. */
.kept-file {
  box-sizing: border-box;
  max-width: 32rem;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--color-accent-light);
  border-radius: var(--radius-control);
}

.kept-file p {
  margin: 0;
}

.kept-file-name {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.kept-file button {
  margin-top: 8px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--color-navy);
}

label {
  font-weight: 500;
}

.form > div {
  margin-bottom: 1rem;
}

/* :where() adds no specificity, so a class on a label (.choice, .confirm)
   wins over this default. */
:where(.form) label {
  display: block;
  margin-bottom: 0.25rem;
}

.errorlist {
  padding: 0;
  margin: 0 0 0.25rem;
  color: var(--color-error);
  list-style: none;
}

.meta,
.help,
.helptext {
  font-size: 14px;
  color: var(--color-text-secondary);
}

/* Page building blocks */

.page-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0;
}

.lead {
  margin: 6px 0 0;
  color: var(--color-text-secondary);
}

/* Card: white surface with a border; header and footer separated by lines */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-divider-strong);
}

.card-header h2 {
  margin: 0;
}

.empty {
  padding: 20px;
  margin: 0;
  color: var(--color-text-secondary);
}

.nowrap {
  white-space: nowrap;
}

/* Start page tiles: a number with label and hint, the whole tile is a link */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 16px;
  padding: 0;
  margin: 0 0 24px;
  list-style: none;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  box-sizing: border-box;
  padding: 18px 20px;
  color: var(--color-text);
  text-decoration: none;
  background: var(--color-surface);
  border: 1px solid var(--color-choice-border);
  border-radius: var(--radius-card);
}

.tile:hover {
  color: var(--color-text);
  border-color: var(--color-accent);
}

.tile-count {
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.tile-hint {
  font-size: 13px;
  color: var(--color-text-secondary);
}

section {
  margin: 1.5rem 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
}

.table th,
.table td {
  padding: 14px 20px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-divider);
}

.table thead th {
  padding-top: 12px;
  padding-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.table tbody tr:last-child > * {
  border-bottom: 0;
}

/* Tables adapt to the room they get, not to the window (side navigation,
   cards, columns): the wrapper is a size container, asked by the rules under
   "Tables in less room" at the end. A table scrolls sideways only if its
   wrapper says why: data-may-scroll="<reason>" (tests/layout_check.js). */
/* The padding gives the focus ring of a field at the edge room inside the
   clipping wrapper (2px offset and 2px width), the negative margin keeps
   the table where it was (0.19.0). */
.table-scroll {
  padding: 4px;
  margin: -4px;
  overflow-x: auto;
  container: table / inline-size;
}

/* Tables with a block view never scroll sideways (tests/layout_check.js), so
   their wrapper need not clip: a confirmation (Delete, Remove) floats over
   the rows below it, as everywhere else. */
.table-scroll:has(> .table-stack) {
  overflow-x: visible;
}

/* Long German words in titles (Bewirtungskosten) are hyphenated instead of
   widening the table; the pages carry lang. */
.event-title {
  font-weight: 600;
  text-decoration: none;
  hyphens: auto;
}

/* Short names have no spaces (up to 50 characters): they break anywhere
   instead of widening the first column. */
.event-slug {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-label);
  overflow-wrap: anywhere;
}

/* Label and value side by side. Each list measures its own place
   (0.19.0): the label column is as wide as the widest label, but at most
   13rem (wider labels wrap, at 1280px no label reaches it), and the value
   takes the rest. Where the value would keep less than 20 characters beside
   a label column of 13rem, the label stands above its value. The PDF of the
   board submission (table.data) loads only its own print stylesheet. */
.data {
  container: data / inline-size;
  display: grid;
  grid-template-columns: fit-content(13rem) minmax(0, 1fr);
  gap: 0.25rem 1rem;
}

@container data (width < calc(14rem + 20ch)) {
  .data > :is(dt, dd) {
    grid-column: 1 / -1;
  }

  .data > dd + dt {
    margin-top: 0.5rem;
  }
}

.data dt {
  font-weight: 600;
}

/* Words in values never break inside: only a string longer than the line
   (a link, an address, a name without spaces) breaks where it must. */
.data dd {
  margin: 0;
  overflow-wrap: break-word;
}

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

/* Names of uploaded files have no spaces: they break anywhere instead of
   widening the page. */
.file-name {
  overflow-wrap: anywhere;
}

/* Names of funding bodies can hold long compounds
   ("…Grundlagenforschung"): they break instead of widening the table. */
.funding-bodies {
  hyphens: auto;
  overflow-wrap: anywhere;
}

/* Status pills and badges: colour always together with the status text */

.status,
.badge {
  display: inline-block;
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--status-neutral);
  white-space: nowrap;
  background: var(--status-neutral-bg);
  border-radius: 12px;
}

.status-submitted {
  color: var(--status-submitted);
  background: var(--status-submitted-bg);
}

.status-in_review {
  color: var(--status-review);
  background: var(--status-review-bg);
}

.status-costing {
  color: var(--status-costing);
  background: var(--status-costing-bg);
}

.status-awaiting_approval {
  color: var(--status-approval);
  background: var(--status-approval-bg);
}

.status-approved,
.status-held,
.status-settlement {
  color: var(--status-done);
  background: var(--status-done-bg);
}

.status-rejected,
.status-cancelled {
  color: var(--status-stopped);
  background: var(--status-stopped-bg);
}

.badge-query {
  color: var(--color-accent-dark);
  background: var(--color-accent-light);
}

.notice {
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-card);
}

/* Under the approximate amount of annex D: no catering costs yet. With
   .notice, so it wins over the later margin of .notice. */
.notice.annex-d-hint {
  padding: 0.6rem 0.9rem;
  margin: 8px 0 0;
}

.notice-query {
  background: var(--color-accent-light);
}

/* The box "Conditions of the board" above the tabs of an event (0.20.0). */
.conditions form {
  display: grid;
  gap: 8px;
  justify-items: start;
}

/* The follow-up after the decision keeps the distance of the fields. */
.paper-decision-form > .question {
  margin-bottom: 16px;
}

/* A normal case worth knowing, not a warning (e.g. a person who exists
   already). */
.notice-info {
  background: var(--status-submitted-bg);
  border-left-color: var(--status-submitted);
}

/* Overview filters */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: end;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.filter label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.filter-q {
  flex: 1 1 14rem;
}

.filter-q input {
  width: 100%;
}

/* Checkboxes among the filters: the box before its label. */
.filter-open_query,
.filter-deputy {
  display: flex;
  flex-direction: row-reverse;
  gap: 0.4rem;
  align-items: center;
  min-height: var(--control-height);
}

.filter-open_query label,
.filter-deputy label {
  margin: 0;
}

.pagination {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid var(--color-divider-strong);
}

/* Event form: each fieldset is a card, its legend the card header. */

.event-form {
  max-width: 56rem;
}

.event-form > fieldset {
  min-width: 0;
  padding: 0;
  margin: 0 0 24px;
}

/* A floated legend behaves like a normal block instead of sitting on the
   fieldset border, so it can look like a card header. */
.event-form > fieldset > legend {
  float: left;
  box-sizing: border-box;
  width: 100%;
  padding: 18px 20px;
  margin: 0;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  border-bottom: 1px solid var(--color-divider-strong);
}

.event-form > fieldset > legend + * {
  clear: both;
}

/* One field in every form (templates/forms/field.html): label, input,
   help text, errors. Help text and errors stand below the input, so fields
   side by side keep their inputs level (checked by tests/layout_check.js). */

.field {
  margin-bottom: 16px;
}

.field:last-child {
  margin-bottom: 0;
}

/* The input as a block: without a line box around it (room for
   descenders, larger beside a text area), help text and errors stand at the
   same distance below every kind of input. */
.field > :is(input, select, textarea) {
  display: block;
}

.field .helptext {
  margin-top: 4px;
}

.field .errorlist {
  margin: 4px 0 0;
}

/* Lists of choices: a fieldset whose legend is the label. */
.field > fieldset {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.field > fieldset > legend {
  padding: 0;
  margin-bottom: 6px;
  font-weight: 500;
}

.field :is(input[type="text"], input:not([type]), select, textarea) {
  width: 100%;
}

/* Fields required for saving the draft (field.required) */
.required-mark {
  color: var(--color-accent-dark);
  font-weight: 600;
}

.required-legend {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--color-text-label);
}

/* Fields needed only for submitting, not for saving the draft */
.submit-hint {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-label);
}

/* Conditional ones (e.g. notes after "yes") only while "yes" is chosen */
.planning-row:not(:has(> .field input[value="True"]:checked)) .submit-hint-if-yes {
  display: none;
}

.field:has(.errorlist) :is(input, select, textarea) {
  border-color: var(--color-error);
}

/* Cost centres: one short input per cost centre with its remove button.
   Only the inputs with an error get the error border. */
.cost-center-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

/* Beats the full width of .field inputs above. */
.cost-centers .cost-center-row input {
  width: 14ch;
  flex: none;
}

.field:has(.errorlist) .cost-center-row input:not([aria-invalid="true"]) {
  border-color: var(--color-input-border);
}

.cost-center-row .errorlist {
  flex-basis: 100%;
  margin: 0;
}

.event-form .row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0 16px;
}

/* Every field of a row keeps its space below, also when the fields wrap
   onto further lines (one column on phones); the row needs none of its own.
   No row gap: with subgrid it would also stand inside each field. */
.event-form .row > .field {
  margin-bottom: 16px;
}

/* Fields side by side share their rows: label, input, help text, errors
   (templates/forms/field.html). A label over two lines (e.g. with
   "required for submission" in a narrow column) moves the inputs beside it
   down too, so they stay level. Without subgrid, as before: each field its
   own box. */
@supports (grid-template-rows: subgrid) {
  .event-form .row > .field {
    display: grid;
    grid-row: span 4;
    grid-template-rows: subgrid;
  }
}

.event-form .row :is(input, select) {
  width: 100%;
}

/* A part that event-form.js shows only while a number is above zero
   (catering in the breaks): its last field has no space below, so the part
   keeps it; hidden, it takes the space along. */
.event-form [data-shown-if-positive] {
  margin-bottom: 16px;
}

.planning-row {
  padding: 16px 0;
  border-bottom: 1px solid var(--color-divider);
}

.planning-row:first-child {
  padding-top: 0;
}

.planning-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.planning-row > * + .field {
  margin-top: 12px;
}

/* Planned fees and room reservations: compact tables of inputs */

.formset {
  margin: 8px 0 16px;
}

.formset th,
.formset td {
  padding: 8px 12px 8px 0;
  vertical-align: middle;
  background: none;
}

.formset :is(input:not([type="checkbox"]), select) {
  width: 100%;
  min-width: 7rem;
}

/* Remove column: a symbol in the head (templates/_remove_column_head.html)
   instead of a word that would be hyphenated in narrow tables. The room
   formset keeps its own alignment: its rows become blocks with labels. */
.remove-symbol svg {
  display: block;
}

.formset:not(.formset-rooms) .col-remove {
  width: 1%;
  text-align: center;
}

.formset:not(.formset-rooms) th.col-remove .remove-symbol svg {
  margin-inline: auto;
}

/* Reservation days outside the event's dates: allowed, but pointed out */
.outside-hint {
  margin-top: 4px;
  font-size: 13px;
  color: var(--color-accent-dark);
}

[data-add-reservation] {
  margin-top: 4px;
}

/* The buttons stay in view at the bottom while scrolling the long form. */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Room for the sticky bar below: a field reached with the keyboard is
   scrolled into view above it, not under it (WCAG 2.4.11, 0.19.0). The bar
   is the height of a button and 2 × 16px padding; 1rem more as a gap. */
html:has(.event-form .form-actions) {
  scroll-padding-bottom: calc(var(--control-height) + 3rem);
}

.event-form .form-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 16px 0;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
}

/* Below 24rem the buttons wrap onto two rows and the bar would cover too
   much: it stands at the end of the form, and no room is kept for it. */
@media (width < 24rem) {
  html:has(.event-form .form-actions) {
    scroll-padding-bottom: 0;
  }

  .event-form .form-actions {
    position: static;
  }
}

.notice-error {
  margin-bottom: 24px;
  border-left-color: var(--color-error);
}

.missing-list {
  padding-left: 1.25rem;
  margin: 8px 0 16px;
}

/* The page to cancel an event (version 0.15.0): what happens, and who is
   to be informed personally. */
.cancel-event-notice ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0 0;
}

.cancel-event-people {
  margin-bottom: 2rem;
}

.cancel-event-people .assignment {
  padding-left: 1rem;
}

.cancel-event-people li + li {
  margin-top: 0.5rem;
}

.cancel-event-notice + h3,
.cancel-event-notice + form {
  margin-top: 1.5rem;
}

.confirm-card {
  max-width: 36rem;
}

.confirm-card h1 {
  font-size: 24px;
}

/* Yes/no questions: a fieldset per question (.field > fieldset), the
   answers as two large selectable tiles side by side (docs/design/README.md,
   "Ja/Nein-Auswahl").

   Choice tiles, the same everywhere: the yes/no questions of the event
   form and the VAT choice of a cost item (Django's RadioSelect, labels
   without a class) and .choice (paper and digital decision). The radio vertically centred with its text, the
   tile only as high as needed; checked tiles keep the text in place. */

:is(.choice-row, :is(.event-form, .cost-item-form) fieldset fieldset > div:has(input[type="radio"])) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

:is(.choice, :is(.event-form, .cost-item-form) fieldset fieldset label:has(input[type="radio"])) {
  box-sizing: border-box;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  min-width: 8rem;
  min-height: var(--control-height);
  padding: 0 1rem;
  margin: 0;
  cursor: pointer;
  background: var(--color-surface);
  border: 1px solid var(--color-choice-border);
  border-radius: var(--radius-control);
}

:is(.choice, :is(.event-form, .cost-item-form) fieldset fieldset label):has(input[type="radio"]:checked) {
  padding: 0 calc(1rem - 1px);
  background: var(--color-selected);
  border: 2px solid var(--color-navy);
}

:is(.choice, :is(.event-form, .cost-item-form) fieldset fieldset label):has(
    input[type="radio"]:focus-visible
  ) {
  outline: 2px solid var(--color-navy);
  outline-offset: 2px;
}

:is(.choice, :is(.event-form, .cost-item-form) fieldset fieldset label) input[type="radio"] {
  flex: none;
  margin: 0;
}

/* Follow-up questions show only while the main question is answered "yes".
   Pure CSS: the values stay in the form, the service drops them on save. */

.question > .follow-up {
  display: none;
  padding-left: 16px;
  margin-top: 16px;
  border-left: 3px solid var(--color-divider-strong);
}

/* flow-root: the negative margin of a .table-scroll at its end stays inside,
   so the line on the left keeps its length (0.19.0). */
.question:has(> .field > fieldset input[value="True"]:checked) > .follow-up {
  display: flow-root;
}

/* Event page (design draft, docs/design/README.md): header with
   actions, course of the event, main column and side column */

.breadcrumb {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.event-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.event-heading h1 {
  margin: 8px 0 0;
}

.event-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.event-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

/* The comment form of a status change opens below the buttons, at their
   right edge; when the buttons wrap below the title they stay on the right,
   so the form never leaves the window on the left. Below 52rem it opens in
   the flow (see .transition-panel). */
@media (width >= 52rem) {
  .event-actions {
    margin-left: auto;
  }

  .event-actions .transition {
    position: static;
  }
}

/* Status transitions: the summary looks like a button, the form opens below */

.transition {
  position: relative;
}

.transition summary {
  list-style: none;
}

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

/* Open: marked like a chosen tile, not with a ring, so it never looks like
   the focus while the focus is elsewhere (0.19.0). The inset shadow thickens
   the border to 2px without changing the size of the button. */
.transition[open] summary {
  color: var(--color-navy);
  background: var(--color-selected);
  border-color: var(--color-navy);
  box-shadow: inset 0 0 0 1px var(--color-navy);
}

.transition-panel {
  position: absolute;
  right: 0;
  z-index: 5;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(24rem, 90vw);
  padding: 16px;
  margin-top: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: 0 6px 20px rgb(11 31 58 / 15%);
}

.transition-panel textarea {
  width: 100%;
}

/* Course of the event: done steps in green, the current one in navy */

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0;
  margin: 0 0 24px;
  font-size: 13px;
  list-style: none;
}

.step {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px 12px;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
}

.step-done {
  color: var(--color-success);
  background: var(--color-success-bg);
  border-color: var(--color-success-bg);
}

/* Empty alternative text: screen readers already hear "done:". */
.step-done::before {
  content: "✓" / "";
}

.step-current {
  font-weight: 600;
  color: var(--color-surface);
  background: var(--color-navy);
  border-color: var(--color-navy);
}

/* Rejected or cancelled: the last station reached and the red end mark.
   Rejected also shows the stations not reached yet. */
.step-reached {
  color: var(--color-success);
  border-color: var(--color-success);
}

.step-stopped {
  font-weight: 600;
  color: var(--color-surface);
  background: var(--color-error);
  border-color: var(--color-error);
}

.step-stopped::before {
  content: "✕" / "";
}

.step-skipped {
  color: var(--color-text-label);
  background: var(--color-bg);
  border-style: dashed;
}

/* Two columns; the side column moves below on narrow screens. */

.event-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: 24px;
  align-items: start;
}

.event-main,
.event-aside {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.event-main > section,
.event-aside > section {
  margin: 0;
}

@media (width < 68rem) {
  .event-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* On small screens the comment form opens in the flow, across the width. */
@media (width < 52rem) {
  .transition[open] {
    flex-basis: 100%;
  }

  .transition-panel {
    position: static;
    width: 100%;
  }
}

.card-body {
  padding: 20px;
}

.description {
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--color-divider);
}

.description p:last-child {
  margin-bottom: 0;
}

.table-planning th {
  width: 30%;
  font-weight: 500;
}

/* The short answers ("ja", "keine Angabe") stay on one line; the notes
   column next to them wraps. Not the cost centres, which span both. */
.table-planning td:nth-child(2):not([colspan]) {
  white-space: nowrap;
}

/* Below 24rem three columns no longer fit: each row becomes a block, the
   question above, answer and notes below it (0.19.0, WCAG 1.4.10). The table
   keeps explicit roles, like .table-stack. */
@media (width < 24rem) {
  .table-planning,
  .table-planning :is(tbody, tr, th, td) {
    display: block;
  }

  .table-planning tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--color-divider);
  }

  .table-planning tr:last-child {
    border-bottom: 0;
  }

  .table.table-planning :is(th, td) {
    width: auto;
    padding: 0;
    border: 0;
  }

  .table-planning :is(th, td[colspan]) {
    grid-column: 1 / -1;
  }

  .table-planning td:empty {
    display: none;
  }

  .table-planning td:nth-child(2):not([colspan]) {
    white-space: normal;
  }
}

/* Lists in the side column: small label, value below */

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

.aside-list > * {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-divider);
}

.aside-list > :last-child {
  border-bottom: 0;
}

.aside-list dd {
  margin: 0;
}

.history-comment {
  font-size: 14px;
  white-space: normal;
}

.notice {
  margin-bottom: 24px;
}

.notice h2 {
  font-size: 18px;
}

.notice blockquote {
  padding-left: 12px;
  margin: 0 0 8px;
  border-left: 2px solid var(--color-accent);
}

/* Review items on the event page (design draft, docs/design/README.md) */

.review-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}

.review-comment-hint {
  padding: 12px 20px;
  margin: 0;
  border-bottom: 1px solid var(--color-divider);
}

/* Rows with dividers, like the entries of the card "People". */
.review-item {
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-divider);
}

.review-item:last-child {
  border-bottom: 0;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}

/* Each row ends with its padding, like a card body (10.11.2026). */
.review-item > :last-child {
  margin-bottom: 0;
}

/* Open items stand out, "not fulfilled" is marked red, by a stripe that takes no
   room. Their status is also said in words or by the pressed button. */
.review-open {
  box-shadow: inset 3px 0 0 var(--color-accent);
}

.review-not_fulfilled {
  box-shadow: inset 3px 0 0 var(--color-error);
}

.review-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.review-category {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chip {
  padding: 0 0.5rem;
  font-size: 13px;
  color: var(--status-neutral);
  background: var(--status-neutral-bg);
  border-radius: 10px;
}

/* Something still to be settled, e.g. travel costs of a speaker. The chip
   shape tells it apart from plain text, a visually hidden text says it to
   screen readers (position: relative keeps that text inside the chip). */
.chip-attention {
  position: relative;
  font-weight: 500;
  white-space: nowrap;
  color: var(--status-approval);
  background: var(--status-approval-bg);
}

/* A mark that is neither an action (orange) nor a problem (red), e.g.
   "employed" behind a name. The chip shows a short word, a visually hidden
   text gives screen readers the full meaning. */
.chip-mark {
  position: relative;
  font-weight: 400;
  white-space: nowrap;
  color: var(--color-product);
  background: var(--color-product-light);
}

.review-text {
  margin: 0.25rem 0 0.5rem;
  font-weight: 600;
}

.review-controls {
  padding: 0;
  margin: 0;
  border: 0;
}

.review-controls textarea {
  width: 100%;
}

/* Disabled by HTMX while the request runs (hx-disabled-elt). */
.review-controls:disabled {
  cursor: progress;
  opacity: 0.6;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}

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

.segmented button {
  padding: 0 0.9rem;
  font-weight: 500;
  color: var(--color-text-nav);
  background: var(--color-surface);
  border: 0;
  border-radius: 0;
}

.segmented button:hover {
  color: var(--color-accent-dark);
  background: var(--color-accent-light);
}

/* The ring inside, in the colour of the text: the group clips its overflow
   (rounded corners), and next to a chosen button a navy ring outside would
   be too faint. Its contrast is that of the text, on each state at least
   6.8:1 (0.19.0). */
.segmented button:focus-visible {
  outline-color: currentColor;
  outline-offset: -4px;
}

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

.segmented button[aria-pressed="true"] {
  font-weight: 600;
  color: var(--color-surface);
}

.review-fulfilled .segmented [aria-pressed="true"] {
  background: var(--color-success);
}

.review-not_fulfilled .segmented [aria-pressed="true"] {
  background: var(--color-error);
}

.review-not_applicable .segmented [aria-pressed="true"] {
  background: var(--color-text-secondary);
}

.review-item blockquote {
  padding-left: 0.75rem;
  margin: 0.5rem 0;
  border-left: 2px solid var(--color-choice-border);
}

.review-history {
  margin-top: 0.5rem;
  font-size: 14px;
}

.review-history summary {
  cursor: pointer;
}

.review-history ol {
  padding-left: 1.25rem;
  margin: 0.25rem 0 0;
}

/* Tabs of the event: separate pages, the open one marked by aria-current, like
   an index card: open at the bottom, it runs into the white card below. Always
   on one line, because only a tab on the last line could touch the card. When
   they do not fit they scroll sideways, and a fade at each edge shows that more
   follow on that side. */

.tabs {
  /* The space left and right in a tab, also the inset of its underline. */
  --tab-padding-inline: 12px;

  position: relative;
  /* Keeps the layers of the fades inside the tabs. */
  isolation: isolate;
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  overflow-x: auto;
  /* Hidden for every pointer, but it still scrolls by trackpad, by swiping and
     with the keyboard. The fades at the edges show that more follow. */
  scrollbar-width: none;
  /* The line under the tabs, as a background: a border would lie outside the
     scrolling area, where the open tab could not cover it. */
  background: linear-gradient(var(--color-border), var(--color-border)) left bottom / 100% 1px no-repeat;
}

/* Safari before version 18.2 knows only this. */
.tabs::-webkit-scrollbar {
  display: none;
}

/* Sticks to the right edge while tabs are hidden there. Scrolled to the end, and
   when all tabs fit, it stands behind the last tab, over nothing. Above the line
   under the tabs, so it does not fade that line. */
.tabs::after {
  position: sticky;
  right: 0;
  flex: none;
  width: 32px;
  margin-bottom: 1px;
  pointer-events: none;
  content: "";
  background: linear-gradient(to right, transparent, var(--color-bg));
}

/* Sticks to the left edge. It takes no room (its width and the gap), and at the
   start it lies under the first tab, which stands above it: there it only paints
   the page colour on the page colour. Once tabs are scrolled away it lies over the
   next ones. Plain CSS in every browser, unlike a scroll-driven animation, which
   Firefox does not know. The first tab itself stays above, so it is cut without
   a fade while it leaves. */
.tabs::before {
  position: sticky;
  left: 0;
  z-index: 1;
  flex: none;
  width: 32px;
  margin-right: -36px;
  margin-bottom: 1px;
  pointer-events: none;
  content: "";
  background: linear-gradient(to left, transparent, var(--color-bg));
}

.tabs a:first-of-type {
  z-index: 2;
}

/* A card directly below the tabs takes their line as its upper edge. Anything
   else, such as a notice or the review on the tab "Application", keeps the
   distance. These selectors name the same cases: only then the margin goes. */
.tabs:has(+ .card, + .costing, + .event-columns > .event-main > .card:first-child) {
  margin-bottom: 0;
}

.tabs + .card,
.tabs + .costing > .card:first-child,
.tabs + .event-columns > .event-main > .card:first-child {
  margin-top: 0;
  border-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* Beside that card the side column keeps its upper edge and the usual distance. */
@media (width >= 68rem) {
  .tabs + .event-columns:has(> .event-main > .card:first-child) > .event-aside {
    margin-top: 24px;
  }
}

.tabs a {
  position: relative;
  display: inline-flex;
  flex: none;
  gap: 6px;
  align-items: center;
  min-height: var(--control-height);
  padding: 0 var(--tab-padding-inline);
  font-weight: 500;
  color: var(--color-text-nav);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

/* Inside: the scrolling area cuts off whatever lies outside it. */
.tabs a:focus-visible {
  outline-offset: -2px;
}

.tabs a:hover {
  color: var(--color-accent-dark);
}

.tabs a[aria-current="page"] {
  color: var(--color-product);
  background: var(--color-surface);
  border-color: var(--color-border);
  border-bottom-color: transparent;
}

.tabs a[aria-current="page"]::after {
  position: absolute;
  right: var(--tab-padding-inline);
  bottom: 0;
  left: var(--tab-padding-inline);
  height: 3px;
  content: "";
  background: var(--color-product);
}

.tab-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-secondary);
}

.tab-count:empty {
  display: none;
}

/* Costing: amounts right-aligned, sums below a stronger line */

.table .num {
  text-align: right;
}

.table-costing tfoot th,
.table-costing tfoot td {
  font-weight: 600;
  border-bottom: 0;
}

.table-costing .row-total > * {
  border-top: 2px solid var(--color-border);
}

.table-costing tfoot tr:not(.row-total) > * {
  padding-top: 0;
  font-weight: 400;
  color: var(--color-text-secondary);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

/* In a table the confirmation floats at every width (in the block view it
   opens in the flow, see .table-stack); its text wraps, although the column
   of the buttons does not (.col-actions). */
/* In place of a button that a signature blocks (version 0.18.0, cancel and
   remove): as wide and as high as that button, so the other buttons of the
   row stay in their column, with the chip centred in it. The width comes
   from the label of the button, written invisibly in its font
   (data-width-of), the chip does not look like a button. */
.action-slot {
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  min-height: var(--control-height);
}

.action-slot::before {
  grid-area: 1 / 1;
  height: 0;
  padding-inline: calc(1.1rem + 1px);
  overflow: hidden;
  font-weight: 500;
  white-space: nowrap;
  visibility: hidden;
  content: attr(data-width-of);
  content: attr(data-width-of) / "";
}

.action-slot > .chip {
  grid-area: 1 / 1;
}

.row-actions .transition-panel {
  position: absolute;
  width: min(20rem, 80vw);
  white-space: normal;
}

.row-editing > td {
  background: var(--color-bg);
}

.card-errors {
  padding: 16px 20px 0;
  margin: 0;
}

.cost-item-add h3 {
  margin-top: 0;
}

/* "60 × 25,00 € with VAT" and the cost centres below the description. */
.cost-item-quantity,
.cost-item-cost-centers {
  display: block;
}

/* The form for a cost item adapts to its own width: below the table, or in
   the row being edited. */
.cost-item-form {
  container: cost-item / inline-size;
}

.cost-item-form fieldset {
  padding: 0;
  margin: 0;
  border: 0;
}

.cost-item-form fieldset:disabled {
  opacity: 0.6;
}

/* Category and description; quantity, unit price, amount and VAT rate;
   below them the choice "without VAT" / "with VAT" across the row. */
.cost-item-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.cost-item-description {
  grid-column: span 3;
}

.cost-item-entered_with_vat,
.cost-item-allocations {
  grid-column: 1 / -1;
}

/* Cost centres of a cost item: a choice, the gross amount and the remove
   button per row; they wrap on narrow forms. Beats the full width of the
   inputs above. */
.allocation-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.cost-item-field .allocation-row select {
  flex: 1 1 16rem;
  width: auto;
  min-width: 0;
  max-width: 32rem;
}

.cost-item-field .allocation-row input {
  flex: 0 1 9rem;
  width: 9rem;
  min-width: 6rem;
}

/* Only the inputs of a row with an error get the error border. */
.field:has(.errorlist) .allocation-row :is(input, select):not([aria-invalid="true"]) {
  border-color: var(--color-input-border);
}

.allocation-row .errorlist {
  flex-basis: 100%;
  margin: 0;
}

.allocations .helptext {
  margin-top: 8px;
}

.cost-item-field :is(input:not([type="radio"]), select) {
  width: 100%;
}

/* Two columns, then one. */
@container cost-item (width < 42rem) {
  .cost-item-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cost-item-description {
    grid-column: auto;
  }
}

@container cost-item (width < 24rem) {
  .cost-item-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Costing page: cost items and funding sources one below the other */

.costing {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.costing > section {
  margin: 0;
}

.funding-sources {
  padding: 0;
  margin: 0;
  list-style: none;
}

.funding-source {
  padding: 20px;
  border-bottom: 1px solid var(--color-divider);
}

.funding-source:last-child {
  border-bottom: 0;
}

.funding-source-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 12px;
}

.funding-source-head h3 {
  margin: 0;
}

.funding-source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.funding-source-actions .transition-panel {
  right: auto;
  left: 0;
}

.funding-source-form :is(input:not([type="checkbox"]), select, textarea),
.person-form :is(input:not([type="checkbox"], [type="radio"]), select, textarea),
.password-form input {
  width: 100%;
  max-width: 32rem;
}

/* Help texts no wider than the inputs above them (20.10.2026). */
:is(
    .funding-source-form,
    .person-form,
    .paper-decision-form,
    .password-form,
    .withdrawal-form
  )
  .helptext,
.password-form > .help {
  max-width: 32rem;
}

/* "Change password": the three fields one below the other, like the
   persons' form (23.10.2026). */
.password-form .field {
  margin-bottom: 1rem;
}

/* Expected revenue: one number field per row */

.plain-fieldset {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.plain-fieldset:disabled {
  opacity: 0.6;
}

/* Blocks of a form under a heading (a fieldset with an h3 in its legend, or
   a section with an h3 such as the consents of a guest): the same distance
   before every heading, whatever ends the block above (09.11.2026). It
   counts from the bottom edge of an input. A block ending in text (help
   text, errors, the label of a checkbox, a paragraph, a list of data) gives
   back the space below the baseline of its last line: half the leading plus
   the descent of IBM Plex Sans, 0.39em (5.5 px at 14 px). The text margins
   collapse through .field, which has no padding or border. :has() must not
   hold another :has(), so the block above finds the heading below with a
   relative selector. */
.form
  :is(.plain-fieldset, .consent-section)
  + :is(.plain-fieldset:has(> legend > h3), .consent-section) {
  margin-top: 2.5rem;
}

.form
  :is(.plain-fieldset, .consent-section):has(
    + .plain-fieldset > legend > h3,
    + .consent-section
  )
  > :last-child {
  margin-bottom: 0;
}

.form
  :is(.plain-fieldset, .consent-section):has(
    + .plain-fieldset > legend > h3,
    + .consent-section
  )
  > .field:last-child
  > :is(.helptext, .errorlist, .confirm):last-child,
.form
  :is(.plain-fieldset, .consent-section):has(
    + .plain-fieldset > legend > h3,
    + .consent-section
  )
  > :is(p, dl):last-child {
  margin-bottom: -0.39em;
}

.table-revenue input {
  width: 7rem;
  text-align: right;
}

.missing-hint {
  margin-top: 4px;
  font-size: 13px;
  color: var(--color-accent-dark);
}

/* Board submission card: the stored version apart from the current
   calculation, each with its heading; without the margin of sections */

.board-submission-part {
  margin: 0;
}

.board-submission-part + .board-submission-part {
  margin-top: 24px;
}

/* Total costs, expected revenue and the result, one per line */

.costing-figures {
  max-width: 28rem;
  margin: 0 0 12px;
}

/* The amount wraps below its label when both do not fit (320px). */
.costing-figures > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 16px;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-divider);
}

.costing-figures dd {
  margin: 0;
}

.costing-figures .figure-result {
  font-size: 20px;
  font-weight: 600;
  border-bottom: 0;
}

/* Footer: name, version and copyright, unobtrusive. In the side
   navigation as lines at its bottom, aligned with the link texts;
   elsewhere one centred line at the end of the page. */

.sidebar-footer,
.page-footer {
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  padding: 16px 24px 20px;
  margin-top: auto;
}

.page-footer {
  padding: 16px;
  text-align: center;
}

/* The link to the accessibility statement (version 0.19.0): in the colour
   of the footer, marked by its underline, like the public footer. */
.sidebar-footer a,
.page-footer a {
  color: var(--color-text-secondary);
}

/* With side navigation, only shown on narrow screens. */
.page-footer-narrow {
  display: none;
}

/* Below 64rem the side navigation is a row (see above), so the footer
   moves to the end of the page. After the rules above, so it wins. */
@media (width < 64rem) {
  .sidebar-footer {
    display: none;
  }

  .page-footer-narrow {
    display: block;
  }
}

/* Tab "Website" of an event: where the public page lies and what it shows */

/* Like a card body (10.11.2026, before 16 px above and below). */
.website-card {
  padding: 20px;
}

/* Addresses have no spaces: they break anywhere instead of widening the card. */
.website-address {
  overflow-wrap: anywhere;
}

.website-state .badge {
  margin-right: 6px;
}

.website-card .checklist {
  margin-bottom: 12px;
}

.website-publish {
  margin-bottom: 12px;
}

.website-publish .help {
  margin: 6px 0 0;
}

.notice.website-hidden {
  margin-bottom: 16px;
}

/* The banner on its gradient as on the page (--head-top and --head-bottom
   set on the element), at most its own width, never cropped. */
.banner-preview {
  margin: 0 0 16px;
}

.banner-preview-image {
  padding: 12px;
  background: linear-gradient(
    var(--head-top, var(--color-navy)),
    var(--head-bottom, var(--color-header-field))
  );
  border-radius: var(--radius-control);
}

.banner-preview img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 20rem;
  margin: 0 auto;
}

.banner-preview figcaption {
  margin-top: 6px;
}

.color-swatch {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-left: 4px;
  vertical-align: -0.1em;
  border: 1px solid var(--color-border);
  border-radius: 3px;
}

.banner-texts {
  margin: 0 0 16px;
}

/* Own gradient colours only while "Choose the gradient colours myself" is
   ticked (CSS only, like the follow-up questions). */
.banner-form:not(:has(input[name="use_own_colors"]:checked))
  .field:has(> input[type="color"]) {
  display: none;
}

/* "Limit the height" once per layout, each with its own default; only the
   one of the chosen layout is shown (website.forms.limit_height_field). */
.banner-form:has(input[name="banner_layout"][value="full_width"]:checked)
  .field:has(input[name="limit_height_centered"]),
.banner-form:not(
    :has(input[name="banner_layout"][value="full_width"]:checked)
  )
  .field:has(input[name="limit_height_full_width"]) {
  display: none;
}

/* The height in percent only while "Limit the height" of the chosen
   layout is ticked (part B2). */
.banner-form:has(input[name="banner_layout"][value="full_width"]:checked):not(
    :has(input[name="limit_height_full_width"]:checked)
  )
  .field:has(input[name="banner_height_limit"]),
.banner-form:not(
    :has(input[name="banner_layout"][value="full_width"]:checked)
  ):not(:has(input[name="limit_height_centered"]:checked))
  .field:has(input[name="banner_height_limit"]) {
  display: none;
}

.banner-form input[name="banner_height_limit"] {
  max-width: 8rem;
}

input[type="color"] {
  width: 5rem;
  padding: 4px;
}

/* Welcome on the tab: the texts as on the page, about 70 characters a
   line. */
.welcome-texts {
  margin: 0 0 16px;
}

.welcome-texts .site-prose {
  max-width: 70ch;
}

/* Lists in running text keep the space of a paragraph below them, on the
   tab and on the website (0.19.0). Inside a dl (.data) the browser sets
   margin-block: 0 on every list, so the next paragraph stuck to it. Without
   specificity, so .site-prose > :last-child still wins. */
.site-prose > :where(ul, ol) {
  margin: 0 0 0.75em;
}

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

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

/* Sites and funding sources on the tab (part B3). */
.venue-site + .venue-site {
  margin-top: 12px;
}

.funding-list {
  padding-left: 1.4em;
  margin: 0;
}

/* Photos on the tab: a small picture beside its texts and buttons; one
   below the other where the card is narrow. */
.photo-list {
  padding: 0;
  margin: 0 0 16px;
  list-style: none;
  container: photo-list / inline-size;
}

.photo-entry {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 12px 20px;
  align-items: start;
  padding: 16px 0;
  border-top: 1px solid var(--color-divider);
}

.photo-entry:first-child {
  padding-top: 0;
  border-top: 0;
}

.photo-entry img,
.photo-preview img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 12rem;
  border-radius: var(--radius-control);
}

.photo-entry .data {
  margin: 0 0 8px;
}

.photo-entry .meta {
  margin: 0 0 12px;
}

.photo-entry .row-actions {
  justify-content: flex-start;
}

.photo-entry .row-actions form:not(.transition-panel) {
  margin: 0;
}

.photo-preview {
  margin: 0 0 16px;
}

/* Tab "Registration" (Phase 4, part B): the card of the form with its
   conditions, "No longer offer" / "Offer again" in the actions of a row. */
.registration-state .badge {
  margin-right: 6px;
}

.registration-card .checklist {
  margin-bottom: 16px;
}

/* Settings read only (tab "Registration", reception, check-in correction):
   a .data list, so it measures its own place like every other (0.19.0).
   Below it the gap of a paragraph, e.g. before a notice (check-in
   correction). Last in a card body it falls away (end of this file). */
.registration-settings-read {
  margin: 0 0 0.75em;
}

.registration-settings-read dt {
  font-weight: 500;
}

.row-actions .offer-form {
  margin: 0;
}

.photo-preview figcaption {
  margin-top: 6px;
}

@container photo-list (width < 36rem) {
  .photo-entry {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Conditions for requesting approval: a tick when done, a dash when not */

.checklist-heading {
  margin: 16px 0 8px;
  font-size: 15px;
}

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

.checklist li {
  position: relative;
  padding: 4px 0 4px 26px;
}

.checklist li::before {
  position: absolute;
  left: 0;
  font-weight: 700;
}

.check-done::before {
  color: var(--color-success);
  content: "✓" / "";
}

.check-open::before {
  color: var(--color-accent-dark);
  content: "–" / "";
}

/* Requests for approval, newest first */

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

.approval {
  padding: 20px;
  border-bottom: 1px solid var(--color-divider);
}

/* The switch "Public website" above the versions (version 0.18.2). */
.approval-website {
  padding: 14px 20px;
  margin: 0;
  border-bottom: 1px solid var(--color-divider);
}

.approval:last-child {
  border-bottom: 0;
}

.approval-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 12px;
}

.approval-head h3 {
  margin: 0;
}

.approval-withdrawn {
  color: var(--color-text-secondary);
}

.approval-hint {
  margin: 12px 0 0;
}

/* At the top of the cost items card: travel costs missing in the costing,
   or cost items without a cost centre. Likewise the hints of the sums per
   cost centre. With .notice, so it wins over the
   margin of .notice. */
.notice:is(.travel-costs-hint, .cost-center-hint, .cost-center-sum-hint) {
  margin: 16px 20px 0;
  padding: 0.6rem 0.9rem;
}

.notice:is(.cost-center-hint, .cost-center-sum-hint) p {
  margin: 0;
}

.notice:is(.cost-center-hint, .cost-center-sum-hint) p + p {
  margin-top: 0.25rem;
}

/* At the top of the expected revenue card: costs of the social event
   missing or not covered by the surcharge. */
.notice.social-event-hint {
  margin: 16px 20px;
  padding: 0.6rem 0.9rem;
}

.approval-decision {
  margin: 12px 0;
}

.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.paper-decision-form :is(input:not([type="radio"]), select, textarea),
.withdrawal-form input[type="text"] {
  width: 100%;
  max-width: 32rem;
}

/* A withdrawal entered by staff (version 0.14.0, W22): what, how it came. */
.withdrawal-form .field {
  margin-bottom: 1rem;
}

/* Its tiles may take two lines when narrow: the radio in line with the
   first one, as in the registration form (website.css). Likewise in the
   account and when entering a participant (version 0.22.0). */
:is(.withdrawal-form, .account-form, .entry-form) .choice-row .choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  align-items: start;
}

:is(.withdrawal-form, .account-form, .entry-form) .choice-row .choice input[type="radio"] {
  margin-top: 0.2em;
}

/* Number of open requests next to "Approvals" in the side navigation */
.nav-count {
  min-width: 20px;
  padding: 0 6px;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 20px;
  color: var(--color-surface);
  text-align: center;
  background: var(--color-accent);
  border-radius: 10px;
}

/* "New for you": the notifications behind the bell (0.20.0) */
.notifications {
  padding: 0;
  margin: 0;
  list-style: none;
}

.notification {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--color-divider-strong);
}

.notification:first-child {
  border-top: 0;
}

.notification-text {
  flex: 1 1 16rem;
  min-width: 0;
}

.notification p {
  margin: 0;
}

.notification-title {
  overflow-wrap: anywhere;
}

.notification-new .notification-title {
  font-weight: 600;
}

/* A board member's decision on the open version */
.digital-decision {
  max-width: 40rem;
  padding: 16px 20px;
  margin-top: 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}

.digital-decision h4 {
  margin: 0 0 12px;
}

.digital-decision textarea {
  width: 100%;
}

/* A checkbox and its text in one label (.confirm, Django's
   CheckboxSelectMultiple, "Remove the approval letter"): the box in line
   with the first line, a longer text wraps beside it, never below. */
:is(.confirm, :where(.form) label:has(> input[type="checkbox"])) {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

:is(.confirm, :where(.form) label:has(> input[type="checkbox"])) > input {
  flex: none;
  margin: 0.2em 0 0;
}

/* Persons of an event: plain fields in two groups */

.person-form .field {
  margin-bottom: 1rem;
}

.person-form legend h3,
.person-form .consent-section h3 {
  margin: 0 0 0.5rem;
}

.person-form .consent-actions {
  margin-top: 0.75rem;
}

.person-form .notice {
  margin-bottom: 1.5rem;
}

/* Helpers: the assignment follows the roles and shows only while
   "Helper" is ticked (pure CSS, like the follow-up questions of the event
   form); the service drops it without that role. */
.person-form
  .field:has(input[name$="roles"][value="helper"]:not(:checked))
  + .field:has(textarea[name$="assignment"]) {
  display: none;
}

/* Guests: the host follows the roles likewise, shown only while "Speaker"
   or "Chair" is ticked; the assignment lies between, hence "~". */
.person-form
  .field:has(input[name$="roles"][value="speaker"]:not(:checked)):has(
    input[name$="roles"][value="chair"]:not(:checked)
  )
  ~ .field:has(select[name$="-host"]) {
  display: none;
}

/* The commitment to a guest follows the travel costs likewise: covered
   types and maximum amount show only while "Institute" or "Funding" is
   chosen; the service drops them for other bearers. */
.person-form
  .field:has(select[name$="travel_costs"]):not(
    :has(option:is([value="institute"], [value="funding"]):checked)
  )
  ~ .field:is(
    :has(input[name$="covered_travel_cost_types"]),
    :has(input[name$="travel_cost_limit"])
  ) {
  display: none;
}

/* Persons list: the assignment of a helper, the host of a guest and the
   guests of a host below the roles, the commitment below the travel costs.
   The consents of a guest look the same, in the list and on the page to
   edit the person (version 0.14.0, step 4), as does the answer of a guest
   (version 0.21.0). */
.table-persons .assignment,
.cancel-event-people .assignment,
.person-form .consent-state .assignment,
.person-form dd .assignment {
  margin-top: 2px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* One line per consent with a little room between them. The first line
   starts at the top like the other cells. */
.consent-state .assignment:first-child {
  margin-top: 0;
}

.consent-state .assignment + .assignment {
  margin-top: 4px;
}

/* The photo of a guest on the page of the consents (step 5, W29): a small
   preview, read-only, linked to the whole photo. */
.consent-photo {
  margin: 0;
}

.consent-photo img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 8rem;
  border-radius: var(--radius-control);
}

.consent-photo figcaption {
  margin-top: 4px;
}

/* Registrations (Phase 4, part C): institution, other roles and the
   objection below the name, the cancellation below the date; normal weight
   also in the block view, where the name is bold. */
.table-participants .assignment {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-secondary);
}

/* Registrations in figures: fee categories and add-ons side by side where
   their place allows it, one below the other otherwise. */
.figures-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
  gap: 1rem 2rem;
}

/* Registrations in figures and for the catering: numbers before the labels,
   so long labels wrap. */
.count-list {
  margin-bottom: 1rem;
}

.count-list:last-child {
  margin-bottom: 0;
}

.count-list li + li {
  margin-top: 4px;
}

.count-number {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Programme item form: date, start and end in three equal columns as wide
   as the single fields below (32rem), so their edges align; where they do
   not fit, a field wraps and keeps its column width. Every field keeps its
   space below, also the last one when it wraps. A label without a field
   (no speakers yet) looks like the others. */
.person-form .field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0 1rem;
  max-width: 32rem;
}

.person-form .field-row > .field {
  margin-bottom: 1rem;
}

.person-form .field-label {
  margin: 0 0 0.25rem;
  font-weight: 500;
}

/* Programme: a heading row for each day. */
.table .programme-day-row th {
  padding-top: 18px;
  font-size: 15px;
  font-weight: 600;
  background: var(--color-divider);
}

.programme-day {
  margin-right: 8px;
}

.table-programme .col-time {
  width: 1%;
}

/* The type of a programme item: wraps as one box, not line by line. */
.table-programme .chip {
  display: inline-block;
  margin-top: 4px;
}

/* Second line in a table cell, e.g. the English title of a programme item. */
.cell-note {
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* In the card "Name badges": the PDF and the Excel file. */
.badge-export {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--color-divider);
}

.badge-export :is(p, form) {
  margin: 0;
}

.badge-export form > .notice {
  margin: 0 0 1rem;
}

/* The tab "Reception": the summary and the way to the check-in list. */
.reception-state {
  display: grid;
  gap: 12px;
}

.reception-state p {
  margin: 0;
}

.reception-check-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

/* The check-in list at the reception, on a laptop, a tablet and a phone. */
.check-in-head {
  margin-bottom: 16px;
}

.check-in-head h1,
.check-in-head p {
  margin: 0;
}

.check-in-count {
  margin-top: 8px;
  font-weight: 600;
}

.check-in-last {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 20px;
  margin-bottom: 16px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.check-in-last p {
  margin: 0;
  font-weight: 600;
}

.check-in-search {
  margin-bottom: 0;
}

/* "Enter participant" (version 0.22.0): at the end of the search, to the
   right while there is room. */
.check-in-search .check-in-add {
  margin-left: auto;
}

.check-in-add-alone {
  padding: 0 20px 20px;
  margin: 0;
}

.check-in-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-in-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 12px 20px;
  border-top: 1px solid var(--color-divider);
}

/* One person behind the QR code: the row alone in its card. */
.check-in-single {
  border-top: 0;
}

/* Behind the QR code, checked in: the time large above the row
   (version 0.18.0). */
.check-in-time {
  padding: 16px 20px 0;
  margin: 0;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.check-in-time time {
  display: block;
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--color-success);
}

.check-in-person {
  flex: 1 1 16rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.check-in-name {
  font-weight: 600;
}

.check-in-institution,
.check-in-roles,
.check-in-when {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.check-in-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 16px;
  margin-left: auto;
}

.check-in-done {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

/* The paper list when the device for the signatures fails (version 0.18.0):
   below the count of the list and in the tab "Reception". */
.check-in-paper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 16px;
}

.check-in-paper p {
  margin: 0;
}

.reception-state .check-in-paper {
  margin-bottom: 0;
}

/* The card "Signature list" in the tab "Reception" (version 0.18.0). */
.signature-card {
  display: grid;
  gap: 12px;
}

.signature-card > p {
  margin: 0;
}

/* The pages of the signature (version 0.18.0), in the hands of the person who
   signs: no header, no navigation, no footer (signature_base.html). Field and
   "Save" fit a tablet held either way, at 1024 × 768 with room to spare. */
.signature-body {
  background: var(--color-bg);
}

.signature-page {
  max-width: 60rem;
  padding: 24px 32px;
  margin: 0 auto;
}

.signature-name {
  margin: 0 0 16px;
  overflow-wrap: anywhere;
}

/* The sentence on the privacy notice (version 0.22.0), for those who have
   not acknowledged it yet: read before signing, so above the field. */
.signature-privacy {
  max-width: 48rem;
  margin: 0 0 16px;
}

.signature-label {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-label);
}

/* A line to sign on, under the canvas, so it is not part of the image. */
.signature-field {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-input-border);
  border-radius: var(--radius-card);
}

.signature-field::after {
  position: absolute;
  right: 24px;
  bottom: 28%;
  left: 24px;
  content: "";
  pointer-events: none;
  border-bottom: 1px solid var(--color-divider-strong);
}

/* A fixed height: the canvas must not size its box from its pixels, which
   the script sets after the box. No scrolling, zooming or callout while
   drawing. The colour is the ink. */
.signature-canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: clamp(160px, 30vw, 340px);
  color: var(--color-text);
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.signature-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.signature-buttons button {
  min-width: 8rem;
}

.signature-buttons button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.signature-buttons button:disabled:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.signature-saved {
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--color-success);
}

.signature-page .check-in-time {
  padding: 0;
  margin: 0 0 16px;
}

/* The saved image is greyscale on white, whatever the page. */
.signature-preview {
  box-sizing: border-box;
  display: block;
  max-width: 100%;
  height: auto;
  padding: 8px;
  margin: 0 0 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}

/* Inconspicuous: for the reception, not for the person who signs. */
.signature-back {
  margin: 40px 0 0;
  font-size: 14px;
}

.signature-back a {
  color: var(--color-text-secondary);
}

@media (width < 40rem) {
  .signature-page {
    padding: 16px;
  }
}

/* A phone held sideways (fix of 26.11.2026; Android with Chrome: about
   800 x 360 CSS pixels less the address bar): the field takes the height
   that is left, at least 120px, and the buttons stand beside it, so the
   sentence on privacy, the field and "Save" fit without scrolling. Only
   while the field is shown (signature.js), never on a tablet: 32rem is far
   below one held sideways (768px), whose sizes stay as above. The canvas
   lies on its box, so its pixels never size the field. */
@media (orientation: landscape) and (height <= 32rem) {
  .signature-page:has(.signature-form:not([hidden])) {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding: 12px 24px;
  }

  .signature-page:has(.signature-form:not([hidden])) > * {
    flex: none;
  }

  .signature-page .signature-name {
    margin-bottom: 8px;
    font-size: 20px;
  }

  .signature-privacy,
  .signature-page .errorlist {
    margin-bottom: 8px;
  }

  .signature-page > .signature-form:not([hidden]) {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  .signature-form > * {
    flex: none;
  }

  .signature-form > .signature-area {
    display: flex;
    flex: 1 1 auto;
    gap: 16px;
    min-height: 0;
  }

  .signature-field {
    flex: 1 1 auto;
    min-height: 120px;
  }

  .signature-canvas {
    position: absolute;
    inset: 0;
    height: 100%;
  }

  .signature-buttons {
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-end;
    margin-top: 0;
  }

  .signature-page .signature-back {
    margin-top: 8px;
  }
}

/* Email addresses wrap after "@" (filter email_breaks). Inside the part up
   to "@" or the domain only when the part alone is wider than its column
   (tests/layout_check.js); never with an added hyphen. */
.email-part {
  hyphens: none;
  overflow-wrap: anywhere;
}

.email-glue {
  white-space: nowrap;
}

/* Email address under the name in the persons table: wide enough for the
   usual "first.last@" on one line, so the column is not squeezed below it;
   longer parts break where they must (20.10.2026). */
.person-email {
  min-width: 20ch;
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-secondary);
}

.candidates {
  padding: 0;
  margin: 0.75rem 0;
  list-style: none;
}

.candidates li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  padding: 6px 0;
}

/* Edit and Remove (or Delete) side by side in every row: the column takes
   the width of its buttons instead of wrapping them. Persons and cost items. */
.table .col-actions {
  width: 1%;
  white-space: nowrap;
}

.col-actions .row-actions {
  flex-wrap: nowrap;
  align-items: flex-start;
}

/* Tab "Registration" (Phase 4, part B): up to three buttons a row (Edit,
   No longer offer, Delete), always one below the other and equally wide;
   the block view (.table-stack, later in this file) puts them side by side
   again. The persons likewise since the invitation to the guest account
   (Edit, Invite, Remove; version 0.14.0). */
:is(.table-fee-categories, .table-add-ons, .table-persons)
  .col-actions
  .row-actions {
  flex-direction: column;
  align-items: stretch;
}

:is(.table-fee-categories, .table-add-ons, .table-persons)
  .col-actions
  .transition
  > summary,
:is(.table-fee-categories, .table-add-ons) .col-actions .offer-form > button {
  width: 100%;
}

/* Tables in less room (container "table", see .table-scroll). After the
   rules for the single tables, so these win. */

/* Column heads break between words only, never with an added hyphen
   ("REISEKOS-TEN", feedback 21.10.2026): a long word sets the width of its
   column. Also against hyphens inherited from a parent. */
.table thead th {
  hyphens: manual;
}


/* Labels of the room reservation fields: for screen readers only while
   the row is a table row. */
.cell-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Below 56rem: tighter cells. */
@container table (width < 56rem) {
  .table :is(th, td) {
    padding-inline: 12px;
  }
}

/* Below 48rem: the row's buttons one below the other, all as wide as the
   widest; the summary of a confirmation fills its <details>. */
@container table (width < 48rem) {
  .col-actions .row-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .col-actions .row-actions .transition > summary,
  .col-actions .row-actions .offer-form > button {
    width: 100%;
  }
}

/* The programme table has many columns: its buttons go one below the other
   from a wider table on. Its rows are several lines high anyway. The areas
   below the persons look the same. The persons table is a block view by
   then (.table-stack-early). */
@container table (width < 66rem) {
  :is(.table-programme, .table-areas) .col-actions .row-actions {
    flex-direction: column;
    align-items: stretch;
  }

  :is(.table-programme, .table-areas) .col-actions .transition > summary {
    width: 100%;
  }
}

/* Below 30rem: the planned fees (label, amount, remove) stay side by side
   with narrower inputs and cells. The room formset is a grid by then. */
@container table (width < 30rem) {
  .formset:not(.formset-rooms) :is(th, td) {
    padding-inline: 0 8px;
  }

  .formset:not(.formset-rooms) :is(input:not([type="checkbox"]), select) {
    min-width: 5.5rem;
  }
}

/* Below 30rem: tables marked .table-stack show each row as a block, the
   column name above each value. display: block removes the table semantics
   in browsers, so these tables carry explicit roles (role="table", "row",
   "cell" …) and screen readers keep announcing the column headers. The
   names from data-label are only shown, not read (alternative text ""). */
@container table (width < 30rem) {
  .table-stack,
  .table-stack :is(thead, tbody, tfoot, tr, th, td) {
    display: block;
  }

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

  .table-stack tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-divider);
  }

  .table-stack tbody tr:last-child {
    border-bottom: 0;
  }

  .table-stack tfoot tr:first-child {
    border-top: 2px solid var(--color-border);
  }

  .table-stack :is(th, td),
  .table-stack .num,
  .table-stack tfoot tr > *,
  .table-stack .row-total > * {
    padding: 2px 0;
    text-align: left;
    border: 0;
  }

  .table-stack td:empty {
    display: none;
  }

  .table-stack .cell-title {
    font-weight: 600;
  }

  .table-stack [data-label] {
    margin-top: 6px;
  }

  .table-stack [data-label]::before {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    content: attr(data-label);
    content: attr(data-label) / "";
  }

  .table-stack .col-actions {
    width: auto;
    margin-top: 10px;
  }

  .table-stack .col-actions .row-actions {
    flex-flow: row wrap;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .table-stack .col-actions .transition > summary,
  .table-stack .col-actions .offer-form > button {
    width: auto;
  }

  .table-stack .col-actions .transition[open] {
    flex-basis: 100%;
  }

  .table-stack .col-actions .transition-panel {
    position: static;
    width: 100%;
  }
}

/* The same block view below 66rem for tables marked .table-stack-early
   as well (the persons table, decided 20.10.2026): their columns hold long
   names and words ("Radioobservatorium") that no longer fit side by side
   without breaking inside a word. Keep in step with the rules above. */
@container table (width < 66rem) {
  .table-stack-early,
  .table-stack-early :is(thead, tbody, tfoot, tr, th, td) {
    display: block;
  }

  .table-stack-early thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .table-stack-early tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-divider);
  }

  .table-stack-early tbody tr:last-child {
    border-bottom: 0;
  }

  .table-stack-early tfoot tr:first-child {
    border-top: 2px solid var(--color-border);
  }

  .table-stack-early :is(th, td),
  .table-stack-early .num,
  .table-stack-early tfoot tr > *,
  .table-stack-early .row-total > * {
    padding: 2px 0;
    text-align: left;
    border: 0;
  }

  .table-stack-early td:empty {
    display: none;
  }

  .table-stack-early .cell-title {
    font-weight: 600;
  }

  .table-stack-early [data-label] {
    margin-top: 6px;
  }

  .table-stack-early [data-label]::before {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    content: attr(data-label);
    content: attr(data-label) / "";
  }

  .table-stack-early .col-actions {
    width: auto;
    margin-top: 10px;
  }

  .table-stack-early .col-actions .row-actions {
    flex-flow: row wrap;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .table-stack-early .col-actions .transition > summary,
  .table-stack-early .col-actions .offer-form > button {
    width: auto;
  }

  .table-stack-early .col-actions .transition[open] {
    flex-basis: 100%;
  }

  .table-stack-early .col-actions .transition-panel {
    position: static;
    width: 100%;
  }
}

/* The same block view below 40rem for tables marked .table-stack-narrow
   (the cost items, the sums per cost centre and the programme, 0.19.0): at
   640px (1280px at a zoom of 200 %) the cost items and the programme need
   about 39rem, and the sums (about 33rem) would scroll just above 30rem. Keep in step with the
   rules above (tests/test_layout_rules.py compares the four). */
@container table (width < 40rem) {
  .table-stack-narrow,
  .table-stack-narrow :is(thead, tbody, tfoot, tr, th, td) {
    display: block;
  }

  .table-stack-narrow thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .table-stack-narrow tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-divider);
  }

  .table-stack-narrow tbody tr:last-child {
    border-bottom: 0;
  }

  .table-stack-narrow tfoot tr:first-child {
    border-top: 2px solid var(--color-border);
  }

  .table-stack-narrow :is(th, td),
  .table-stack-narrow .num,
  .table-stack-narrow tfoot tr > *,
  .table-stack-narrow .row-total > * {
    padding: 2px 0;
    text-align: left;
    border: 0;
  }

  .table-stack-narrow td:empty {
    display: none;
  }

  .table-stack-narrow .cell-title {
    font-weight: 600;
  }

  .table-stack-narrow [data-label] {
    margin-top: 6px;
  }

  .table-stack-narrow [data-label]::before {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    content: attr(data-label);
    content: attr(data-label) / "";
  }

  .table-stack-narrow .col-actions {
    width: auto;
    margin-top: 10px;
  }

  .table-stack-narrow .col-actions .row-actions {
    flex-flow: row wrap;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .table-stack-narrow .col-actions .transition > summary,
  .table-stack-narrow .col-actions .offer-form > button {
    width: auto;
  }

  .table-stack-narrow .col-actions .transition[open] {
    flex-basis: 100%;
  }

  .table-stack-narrow .col-actions .transition-panel {
    position: static;
    width: 100%;
  }
}

/* The same block view below 50rem for tables marked .table-stack-mid (the
   overview of events, 21.10.2026): column heads no longer break inside a
   word, and its six columns need about 48rem then. Keep in step with the
   rules above (tests/test_layout_rules.py compares the three). */
@container table (width < 50rem) {
  .table-stack-mid,
  .table-stack-mid :is(thead, tbody, tfoot, tr, th, td) {
    display: block;
  }

  .table-stack-mid thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .table-stack-mid tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-divider);
  }

  .table-stack-mid tbody tr:last-child {
    border-bottom: 0;
  }

  .table-stack-mid tfoot tr:first-child {
    border-top: 2px solid var(--color-border);
  }

  .table-stack-mid :is(th, td),
  .table-stack-mid .num,
  .table-stack-mid tfoot tr > *,
  .table-stack-mid .row-total > * {
    padding: 2px 0;
    text-align: left;
    border: 0;
  }

  .table-stack-mid td:empty {
    display: none;
  }

  .table-stack-mid .cell-title {
    font-weight: 600;
  }

  .table-stack-mid [data-label] {
    margin-top: 6px;
  }

  .table-stack-mid [data-label]::before {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    content: attr(data-label);
    content: attr(data-label) / "";
  }

  .table-stack-mid .col-actions {
    width: auto;
    margin-top: 10px;
  }

  .table-stack-mid .col-actions .row-actions {
    flex-flow: row wrap;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .table-stack-mid .col-actions .transition > summary,
  .table-stack-mid .col-actions .offer-form > button {
    width: auto;
  }

  .table-stack-mid .col-actions .transition[open] {
    flex-basis: 100%;
  }

  .table-stack-mid .col-actions .transition-panel {
    position: static;
    width: 100%;
  }
}

/* Room reservations: below 66rem the eight fields of a row no longer fit
   side by side, so each reservation becomes a block of labelled fields that
   wrap. Like .table-stack, the table keeps explicit roles. */
@container table (width < 66rem) {
  .formset-rooms,
  .formset-rooms :is(thead, tbody, tr, th, td) {
    display: block;
  }

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

  .formset-rooms tr {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 10px 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-divider);
  }

  .formset-rooms td {
    padding: 0;
    border: 0;
  }

  .formset-rooms td:empty {
    display: none;
  }

  .formset-rooms :is(input:not([type="checkbox"]), select) {
    min-width: 0;
  }

  .formset-rooms .cell-label {
    position: static;
    display: block;
    width: auto;
    height: auto;
    margin-bottom: 4px;
    overflow: visible;
    clip-path: none;
    font-size: 13px;
    font-weight: 500;
    white-space: normal;
  }
}

/* A card body ends with its padding, as it begins (10.11.2026): the bottom
   margin of its last element (a help text, the buttons of a form, a notice)
   does not add to it. Margins pass through a parent without padding, so the
   rule follows the last element down three levels (form > field > help
   text). An empty placeholder at the end, swapped out of band later, does
   not count (#approval-checklist). Like .site-section in website.css. Tables
   run to the edge of the card and are not in a card body. Last in this
   file on purpose: it wins over the margin of a single element of equal
   weight (.notice.website-hidden). */
:is(.card-body, .website-card) > :is(:last-child, :has(+ :empty:last-child)),
:is(.card-body, .website-card)
  > :is(:last-child, :has(+ :empty:last-child))
  > :last-child,
:is(.card-body, .website-card)
  > :is(:last-child, :has(+ :empty:last-child))
  > :last-child
  > :last-child {
  margin-bottom: 0;
}

/* Forced colours (0.19.0, step 4e): Windows contrast themes and Firefox with
   the contrast control "Custom" replace our colours with the few of the
   system, and backgrounds, gradients and shadows disappear. Whatever was
   marked by a background, a gradient or a shadow gets a mark that stays,
   in borders and lines.
   Only Canvas, CanvasText, LinkText and ButtonText/ButtonFace: the user sets
   these (in Firefox under "Manage colours"). Highlight, SelectedItem and
   ButtonBorder come from the operating system and are pale greys on macOS,
   too faint for a mark and below 4.5:1 for white text
   (tests/test_forced_colors.py allows no others). Two patterns:
   - "chosen" (a pressed segment button, the current language): inverted,
     background CanvasText and text Canvas;
   - "here I am" (the open tab, the current entry of the side navigation,
     the current step of the status bar): a line or border in CanvasText,
     thicker than the borders around. */
@media (forced-colors: active) {
  /* The word mark (static/brand/, white, the files stay as they are) would
     vanish on the header, which turns Canvas: the link keeps the gradient of
     the header as its ground, white on dark whatever colours the user chose
     (an inverting filter would give black on black with dark ones). A
     gradient, not a background colour: inside a visited link (the link to
     the start page, mostly visited) Firefox takes the background colour from
     the style of :visited, which forced colours replace even here. The one
     exception to the system colours, named in tests/test_forced_colors.py.
     The negative margin keeps the word mark where it stands; the ring in
     CanvasText around the dark box, as the white of the header would
     vanish. */
  .brand {
    forced-color-adjust: none;
    padding: 4px 8px;
    margin: -4px -8px;
    background: linear-gradient(
      to right,
      var(--brand-header-start),
      var(--brand-header-end)
    );
    border-radius: var(--radius-control);
  }

  .brand:focus-visible {
    outline-color: CanvasText;
  }

  /* forced-color-adjust: none keeps the background, which the mode would
     otherwise drop. The review states (.review-fulfilled …) name the button
     with more weight, so they are listed as well. */
  .segmented button[aria-pressed="true"],
  :is(.review-fulfilled, .review-not_fulfilled, .review-not_applicable) .segmented [aria-pressed="true"],
  .language-switch [aria-current] {
    forced-color-adjust: none;
    color: Canvas;
    background: CanvasText;
  }

  /* The line under the tabs, a gradient in the normal colours, which the
     mode drops: kept here in CanvasText. A border of .tabs would lie
     outside its scrolling area, where the open tab could not cover it, and
     the card below takes this line as its upper edge (.tabs + .card).
     Only the tabs themselves are adjusted again, with the fades at the
     edges. */
  .tabs {
    forced-color-adjust: none;
    background: linear-gradient(CanvasText, CanvasText) left bottom / 100% 1px no-repeat;
  }

  .tabs > *,
  .tabs::before,
  .tabs::after {
    forced-color-adjust: auto;
  }

  /* Tabs and side navigation in one colour, visited or not: the colour of
     visited links would otherwise tint single entries by the history of the
     browser, and the open tab would look marked only by that. */
  .tabs a,
  .tabs a:visited,
  .sidenav a,
  .sidenav a:visited {
    color: LinkText;
  }

  /* Only the open tab has a frame (the others would get one from their
     transparent border), and it stays open towards the card: its Canvas
     covers the line. The other tabs have no border at the top and sides
     (a Canvas border would grey the corners of the line), the padding
     gives back its width. Below them their border is the line. */
  .tabs a:not([aria-current="page"]) {
    padding-inline: calc(var(--tab-padding-inline) + 1px);
    border-width: 0 0 1px;
    border-bottom-color: CanvasText;
  }

  .tabs a[aria-current="page"] {
    border-color: CanvasText;
    border-bottom-color: Canvas;
  }

  /* The bar under the open tab: the ::after of the normal colours, so
     nothing moves. */
  .tabs a[aria-current="page"]::after {
    forced-color-adjust: none;
    background: CanvasText;
  }

  /* The padding gives back the width of the border, so the text stays. */
  .sidenav a[aria-current="page"] {
    padding-left: 9px;
    border-left: 3px solid CanvasText;
  }

  /* On "New for you" a bar under the bell; the number keeps a ground of its
     own, as it lies over the symbol. */
  .bell[aria-current="page"] {
    border-bottom: 3px solid CanvasText;
  }

  .bell-number {
    forced-color-adjust: none;
    color: Canvas;
    background: CanvasText;
  }

  /* 2px against the 1px of the other steps. */
  .step[aria-current="step"] {
    padding: 5px 11px;
    border: 2px solid CanvasText;
  }

  /* Instead of the stripe (a shadow): the status is also on the pressed
     button, so one line for both. */
  :is(.review-open, .review-not_fulfilled) {
    padding-left: 17px;
    border-left: 3px solid CanvasText;
  }

  /* Without its fill the main button looks like the secondary ones: a wider
     border sets it apart. Destructive buttons are filled as well. */
  .button,
  button {
    border-width: 2px;
  }

  .button-secondary,
  button.button-secondary {
    border-width: 1px;
  }

  /* The arrow of our selects is a gradient, which the mode drops: the
     system draws the select again, with its own arrow. */
  select:not([multiple], [size]) {
    appearance: auto;
    background-image: none;
  }
}

/* Reduced motion (0.19.0): our pages move nothing, no transition, animation
   or smooth scrolling (tests/test_reduced_motion.py keeps it so, outside
   @media (prefers-reduced-motion: no-preference)). This rule also stills
   what a stylesheet of an instance might add, for everyone who asks their
   system for less motion. */
@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
  }
}
