/* Stadt Leipzig corporate design — LimeSurvey 7.1 survey theme (reference theme of the CD
 * skill, assets/theming/apps/limesurvey/).
 *
 * theme-version: 1.3.0
 *
 * Mode task (D88, D89). Leitfarbe, Absender, logo, light/dark mode and legal links are theme
 * options; the views set data-leitfarbe and data-theme on <html> and tokens.css does the
 * rest, so this file holds no colour of its own — every value comes from tokens.css
 * (check_style.py: 0 findings). Dark theme "Graphit" (D117, D118): the views write
 * data-theme="auto" (the default: the participant's system decides) or "dark" (theme option
 * cdthememode), nothing for "light"; tokens.css 1.5.0 re-points the semantic tokens in its
 * [data-theme] blocks, which sit in @media screen, so print stays light. This file reads only
 * semantic tokens (--color-ui-subtle, --color-ui-overlay, --color-ink …) and the few theme
 * tokens of §1a, which switch with them.
 * Third layer after tokens.css and base-overrides.css (theming.md §2.3). The theme extends
 * "vanilla": Bootstrap 5, LimeSurvey's survey.css and vanilla's base.css, theme.css and
 * noTablesOnMobile.css load before this file, so most rules win by source order; where a
 * host rule carries !important or more classes, the rule here says so on its line.
 *
 * Contents
 *   1 Page, Bootstrap variables, text colours
 *   1a Theme tokens light and dark (check mark, chevron, close icon, tooltip, menu marker),
 *      the logo pair, the date picker's variables
 *   2 Skip link, header, tools, dropdown
 *   3 Intro (Absender), progress
 *   4 Column, welcome, groups, question cards
 *   5 Help, tips, validation errors, alerts
 *   6 Choice rows (radio, checkbox) in lists
 *   7 Segmented buttons (yes/no, gender)
 *   8 Fields and selects
 *   9 Array tables: wide card from 1024 px, named scroll box with an edge cue
 *  10 Buttons and navigation
 *  11 Footer
 *  12 Error and maintenance pages, modal
 *  13 Public survey list (start page)
 *  14 Screens outside the question flow: save, load, register, access code, clear-all,
 *     end page with assessment
 *
 * Scope: [data-cd-theme] on <html> (base-overrides.css §3). It is an attribute, not only a
 * class, because LimeSurvey's theme editor preview rewrites <html class> but keeps the
 * data-* attributes; an attribute selector has the specificity of a class.
 */

/* --- 1 Page ------------------------------------------------------------------ */
:root:root {
  --bs-body-font-family: var(--font-sans);
  --bs-body-font-size: var(--text-body);
  --bs-body-line-height: var(--leading-normal);
  --bs-body-color: var(--color-text);
  --bs-body-bg: var(--color-ui-bg);
  --bs-emphasis-color: var(--color-text);
  --bs-secondary-color: var(--color-text-muted);
  --bs-heading-color: var(--color-text);
  --bs-border-color: var(--color-ui-line);
  --bs-border-radius: var(--radius-sm);
  --bs-link-color: var(--color-link);
  --bs-link-hover-color: var(--color-link);
}

/* --- 1a Theme tokens, light and dark (D117, D118) --------------------------------- */
/* A few values the LimeSurvey layers need that tokens.css has no name for. Each is derived
   from tokens.css 1.5.0 (the light values and the Graphit layers of D118); none is a new
   colour. Images (an <input>'s check mark, Bootstrap's select chevron and close icon)
   cannot take a token colour, so each comes in its two colours. The dark blocks repeat
   tokens.css's opt-in: data-theme="dark", and data-theme="auto" on a dark system, screens
   only. */
:root {
  /* the mark on a checked box: --color-on-indicator (white on the Vollton) */
  --sl-check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.5l4 4 9-9'/%3E%3C/svg%3E");
  /* the select chevron and the dialog's close cross: --color-ink (black) */
  --sl-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --sl-close-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
  /* the slider's value bubble: black with white words */
  --sl-tooltip-bg: var(--color-schwarz);
  --sl-tooltip-text: var(--color-weiss);
  /* the current step in the "Menü": no bar on the light Helle Ton */
  --sl-current-bar: transparent;
}
@media screen {
  :root[data-theme="dark"] {
    /* the mark on the light indicator is black (D118 --color-on-indicator) */
    --sl-check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.5l4 4 9-9'/%3E%3C/svg%3E");
    /* --color-ink is white in the dark */
    --sl-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    --sl-close-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
    /* overlays lift by lightness (D118 overlay layer), white words, a line for the edge */
    --sl-tooltip-bg: var(--color-graphit-overlay);
    --sl-tooltip-text: var(--color-weiss);
    /* the selected row is the raised neutral plus the indicator (D118): in the menu, whose
       ground is the raised layer too, the indicator bar carries the selection */
    --sl-current-bar: var(--color-primary-indicator);
  }
}
@media screen and (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --sl-check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.5l4 4 9-9'/%3E%3C/svg%3E");
    --sl-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    --sl-close-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
    --sl-tooltip-bg: var(--color-graphit-overlay);
    --sl-tooltip-text: var(--color-weiss);
    --sl-current-bar: var(--color-primary-indicator);
  }
}

/* The logo pair (leipzig.css 2.3 [data-theme-only]): the chosen 2C or 1C Positiv on the
   light header, the delivered 1C Negativ on the dark one (D118, check_layout B2) */
[data-cd-theme] img.sl-logo[data-theme-only="light"] { display: var(--display-light); }
[data-cd-theme] img.sl-logo[data-theme-only="dark"] { display: var(--display-dark); }

/* LimeSurvey's date picker (Tempus Dominus 6) draws its light or dark set from
   <body data-thememode>; both sets read the semantic tokens, so it follows the page in
   every mode (also where LimeSurvey's registration form hard-codes "light"): the overlay
   layer, the indicator for the chosen day, the hover inside an overlay, muted neighbours */
:root:root {
  --td-widget-background: var(--color-ui-overlay);
  --td-font-color: var(--color-text);
  --td-active-bg: var(--color-primary-indicator);
  --td-active-color: var(--color-on-indicator);
  --td-active-border-color: var(--color-on-indicator);
  --td-range-bg: var(--color-primary-indicator);
  --td-btn-hover-bg: var(--color-ui-overlay-subtle);
  --td-disabled-color: var(--color-text-muted);
  --td-alternate-color: var(--color-text-muted);
  --td-dow-color: var(--color-text-muted);
  --td-secondary-border-color: var(--color-ui-line);
  --td-secondary-border-color-rgba: var(--color-ui-line);
  --td-primary-border-color: var(--color-ui-overlay);
  --td-text-shadow: none;
  --td-dark-widget-background: var(--color-ui-overlay);
  --td-dark-font-color: var(--color-text);
  --td-dark-active-bg: var(--color-primary-indicator);
  --td-dark-active-color: var(--color-on-indicator);
  --td-dark-active-border-color: var(--color-on-indicator);
  --td-dark-range-bg: var(--color-primary-indicator);
  --td-dark-btn-hover-bg: var(--color-ui-overlay-subtle);
  --td-dark-disabled-color: var(--color-text-muted);
  --td-dark-alternate-color: var(--color-text-muted);
  --td-dark-dow-color: var(--color-text-muted);
  --td-dark-secondary-border-color: var(--color-ui-line);
  --td-dark-secondary-border-color-rgba: var(--color-ui-line);
  --td-dark-primary-border-color: var(--color-ui-overlay);
  --td-dark-text-shadow: none;
}
/* the picker is an overlay like the menus: the card line, 8 px corners, the overlay shadow */
[data-cd-theme] .tempus-dominus-widget {
  border: var(--border-width) solid var(--color-ui-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-overlay);
  font-family: var(--font-sans);
}

html[data-cd-theme] {
  background-color: var(--color-ui-bg);
}
html[data-cd-theme] body {
  display: flex;
  flex-direction: column;
  min-block-size: 100vh;
  margin: 0;
  padding: 0 !important;                /* check-style: ignore — vanilla's theme.js writes padding-top inline for its fixed navbar; the CD header is not fixed */
  background-color: var(--color-ui-bg);
  color: var(--color-text);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
}
html[data-cd-theme] body > article { flex: 1 0 auto; }

/* Headings: Medium, sizes from the task scale, no host margins (base.css adds 2rem) */
[data-cd-theme] :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) {
  margin: 0;
  color: var(--color-text);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
}

/* Text colours: black, white or the muted grey only (Farben p.14, D91). Bootstrap's
   colour utilities are !important, so these are too. */
[data-cd-theme] :is(.text-primary, .text-info, .text-success, .text-warning, .text-danger, .text-secondary, .text-dark, .text-body) {
  color: var(--color-text) !important;          /* check-style: ignore — beats Bootstrap's !important colour utilities */
}
/* Bootstrap's tables and body text use its own near-black, not the text colour */
[data-cd-theme] :is(.table, .table > :not(caption) > * > *, .card, .modal-content, .form-label, .col-form-label) {
  color: var(--color-text);
}
[data-cd-theme] .text-muted {
  color: var(--color-text-muted) !important;    /* check-style: ignore — beats Bootstrap's !important utility */
}
/* Centred host text goes to the column edge (left aligned only) */
[data-cd-theme] :is(#welcome-container, .group-title, .group-description, .survey-name, .survey-description, #navigator-container) .text-center,
[data-cd-theme] :is(.survey-name, .survey-description, .group-title, .group-description).text-center {
  text-align: start !important;                 /* check-style: ignore — beats Bootstrap's !important .text-center */
}

/* Bootstrap's build colours every <a> in its own blue: the link colour instead
   (components with a class set their own colour below) */
[data-cd-theme] a { color: var(--color-link); }

/* Links outside author content (error contact, privacy links) */
[data-cd-theme] a:not([class]),
[data-cd-theme] a.cd-link {
  color: var(--color-link);
  text-decoration-line: underline;
  text-decoration-thickness: var(--link-underline);
  text-underline-offset: var(--link-underline-offset);
}
[data-cd-theme] a:not([href]):not([class]) {
  color: inherit;                      /* an <a> without href (author markup) is not a link: no link colour */
  text-decoration: none;
}
[data-cd-theme] a:not([class]):is(:hover, :focus-visible) {
  text-decoration-thickness: var(--link-underline-hover);
}

/* No hyphenation (Barrierefrei p.2, D40): vanilla switches automatic hyphenation on for the whole
   survey frame */
[data-cd-theme] #outerframeContainer,
[data-cd-theme] #outerframeContainer * {
  -webkit-hyphens: manual;
  hyphens: manual;
}
/* vanilla: every label Bold, a blue fill on every label::after, the privacy header
   Bold italic. Labels are Medium (D99), no italics (Barrierefrei p.2) */
[data-cd-theme] label { font-weight: var(--weight-medium); }
[data-cd-theme] label::after { background-color: transparent; }
[data-cd-theme] .privacy-header {
  font-style: normal;
  font-weight: var(--weight-medium);
}

/* One column for header, intro, progress, content and footer: base-overrides.css .cd-column
   (40rem, D89); .sl-column is the hook the check_layout profile measures. */
[data-cd-theme] .sl-nowrap { white-space: nowrap; }   /* short hyphenated compounds (D113), set by limesurvey-theme.js */
[data-cd-theme] small,
[data-cd-theme] .small {
  font-size: var(--text-meta);                  /* Bootstrap's .small is 14 px: help, "Pflichtangabe" (D88) */
}

/* --- 2 Skip link, header ---------------------------------------------------- */
.sl-skip-link {
  position: absolute;
  inset-block-start: var(--space-2);
  inset-inline-start: max(var(--ui-gutter), (100% - var(--ui-column)) / 2);
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-min);
  padding: var(--space-2) var(--space-4);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-weight: var(--weight-medium);
  text-decoration-line: underline;
  transform: translateY(calc(-100% - var(--space-6)));
}
.sl-skip-link:focus,
.sl-skip-link:focus-visible { transform: none; }

[data-cd-theme] .sl-header {
  position: relative;
  z-index: 1030;                       /* the language menu opens above the content */
  border-block-end: var(--border-width) solid var(--color-ui-line);
  background-color: var(--color-bg);
  color: var(--color-text);
}
.sl-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-block-size: var(--ui-header-height);
  padding-block: var(--space-2);
}
.sl-header__brand {
  display: flex;
  flex: none;
  margin: 0;
}
[data-cd-theme] img.sl-logo {
  display: block;
  inline-size: auto;
  block-size: var(--ui-logo-height);   /* 44, 48 from 1024 px (D92) */
  max-inline-size: none;
}
.sl-header__tools {
  display: flex;
  min-inline-size: 0;
  margin-inline-start: auto;
}
[data-cd-theme] .sl-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
[data-cd-theme] .sl-tools > li {
  margin: 0;
  padding: 0;
}
/* Header tools: 44 px pills with icon and label (D92, D98) */
[data-cd-theme] .sl-tools .nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-block-size: var(--button-height-sm);
  padding: var(--space-2) var(--space-4);
  border: var(--border-width-thick) solid transparent;
  border-radius: var(--radius-full);
  background-color: transparent;
  color: var(--color-text);
  font-size: var(--text-ui);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
[data-cd-theme] .sl-tools .nav-link:is(:hover, [aria-expanded="true"]) {
  background-color: var(--color-ui-subtle);
  color: var(--color-text);
}
/* vanilla's theme.css greys the tools' label on hover and focus by id (its near-black: 1.2:1 on the
   raised layer of the dark theme) */
[data-cd-theme] #survey-nav .sl-tools .nav-link:is(:hover, :focus) { color: var(--color-text); }
/* the last label ends on the column edge (from 640 px, where the gutter holds the pill's padding) */
@media (min-width: 640px) {
  [data-cd-theme] .sl-tools > li:last-child > .nav-link {
    margin-inline-end: calc(-1 * (var(--space-4) + var(--border-width-thick)));
  }
}
/* Phones: the header stays one 80 px row (D92) — the language tool shows its short
   code ("DE"), the tools move closer (theming.md §4 item 16) */
.sl-tool__short { display: none; }
@media (max-width: 479.98px) {
  [data-cd-theme] .sl-tools { flex-wrap: nowrap; gap: var(--space-1); }
  [data-cd-theme] .sl-tools .nav-link { padding-inline: var(--space-2); }
  [data-cd-theme] .sl-tools .nav-link:has(.sl-tool__short) .sl-tool__label {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  [data-cd-theme] .sl-tools .sl-tool__short { display: inline; }
}
.sl-tool__icon {
  flex: none;
  inline-size: calc(var(--space-4) + var(--space-1));
  block-size: calc(var(--space-4) + var(--space-1));
}
[data-cd-theme] .sl-tools .dropdown-toggle::after {
  margin-inline-start: 0;
  vertical-align: middle;
}
/* Menus: white (the raised overlay layer in the dark, D118), 8 px corners, the overlay
   shadow (D83), 44 px rows. The host's Bootstrap build writes literal values, not --bs-*
   component variables. */
[data-cd-theme] .dropdown-menu {
  padding: var(--space-2) 0;
  border: var(--border-width) solid var(--color-ui-line);
  border-radius: var(--radius-md);
  background-color: var(--color-ui-overlay);
  color: var(--color-text);
  font-size: var(--text-ui);
  box-shadow: var(--shadow-overlay);
}
/* the survey actions inside "Menü" come as nav links: rows like the menu items */
[data-cd-theme] .sl-menu > li {
  margin: 0;
  padding: 0 !important;               /* check-style: ignore — beats Bootstrap's !important .px-2 on LimeSurvey's "clear" item */
}
[data-cd-theme] .sl-menu .nav-link {
  display: flex;
  align-items: center;
  min-block-size: var(--target-min);
  padding: var(--space-2) var(--space-4);
  color: var(--color-text);
  font-size: var(--text-ui);
  font-weight: var(--weight-regular);
  text-decoration: none;
}
[data-cd-theme] .sl-menu .nav-link:is(:hover, :focus) {
  background-color: var(--color-ui-overlay-subtle);
  color: var(--color-text);
}
[data-cd-theme] .sl-menu .sl-menu__title {
  margin: 0;
  padding: var(--space-3) var(--space-4) var(--space-1);
  border-block-start: var(--border-width) solid var(--color-ui-line);
  color: var(--color-text-muted);
  font-size: var(--text-ui);
  font-weight: var(--weight-medium);
}
[data-cd-theme] .sl-menu > li:first-child .sl-menu__title { border-block-start: 0; }
[data-cd-theme] .sl-menu {
  min-inline-size: 16rem;
  max-block-size: 60vh;
  overflow-y: auto;
}
[data-cd-theme] .dropdown-item {
  color: var(--color-text);
  display: flex;
  align-items: center;
  min-block-size: var(--target-min);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-ui);
  white-space: normal;
}
/* language names stay on one line ("Deutsch (Du-Form)" never breaks at its hyphen, D113) */
[data-cd-theme] #language-dropdown .dropdown-item { white-space: nowrap; }
[data-cd-theme] #language-dropdown { max-inline-size: calc(100vw - 2 * var(--space-4)); overflow-x: auto; }
[data-cd-theme] .dropdown-item:is(:hover, :focus) {
  background-color: var(--color-ui-overlay-subtle);
  color: var(--color-text);
}
/* question index: vanilla marks steps with errors and unanswered questions only by red and
   yellow fills. The view writes sl-index--error / --unanswered instead: a step with an error
   gets the 4 px black bar and the word in the menu (D99, D110); the current step is the
   selected row, Bold, aria-current="step" (D97) */
[data-cd-theme] .dropdown-item.sl-index--error {
  border-inline-start: var(--space-1) solid var(--color-status-bar);
  padding-inline-start: calc(var(--space-4) - var(--space-1));
}
/* the word "(Fehler)" after the step: the item is a flex box, which drops the space before it */
[data-cd-theme] .dropdown-item .sl-index__state { margin-inline-start: 0.25em; }
[data-cd-theme] .dropdown-item[aria-current="step"] {
  background-color: var(--color-selected-bg);
  color: var(--color-text);
  font-weight: var(--weight-bold);
}
[data-cd-theme] .dropdown-item[aria-current="step"]:not(.sl-index--error),
[data-cd-theme] .dropdown-item[aria-current="true"] {
  border-inline-start: var(--space-1) solid var(--sl-current-bar);
  padding-inline-start: calc(var(--space-4) - var(--space-1));
}
[data-cd-theme] .dropdown-menu .list-group-item {
  padding: 0;
  border: 0;
  background-color: transparent;
}
[data-cd-theme] .dropdown-item[aria-current="true"] {
  background-color: var(--color-selected-bg);
  font-weight: var(--weight-bold);
}
@media (min-width: 1024px) {
  .sl-header__inner { padding-block: var(--space-4); }
}

/* --- 3 Intro and progress ------------------------------------------------------ */
.sl-main {
  display: flex;
  flex: 1 0 auto;                      /* the footer stays at the bottom of short pages */
  flex-direction: column;
  padding-block-start: var(--space-6);
  container-type: inline-size;         /* cqi = page width without the scrollbar: wide array cards (§9) */
}
.sl-intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);                 /* Absender → h1 (theming.md §4 item 18) */
}
[data-cd-theme] .sl-survey-title {
  margin: 0;
  font-size: var(--text-h1);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
}
[data-cd-theme] #welcome-container .survey-name { margin-block-start: calc(var(--space-2) - var(--space-5)); }
[data-cd-theme] .sl-absender {
  margin: 0;
  color: var(--color-text);
  font-size: var(--text-ui);
  font-weight: var(--weight-regular);
  line-height: var(--leading-snug);
}
[data-cd-theme] .top-container.sl-progress {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-block: var(--space-4) 0;
  margin-inline: auto;
  padding-block: 0;
  padding-inline: var(--ui-gutter);
  color: var(--color-text);
}
[data-cd-theme] .sl-progress__label {
  margin: 0;
  font-size: var(--text-ui);
  font-weight: var(--weight-regular);
}
[data-cd-theme] .sl-progress .progress {
  block-size: var(--space-2);
  margin: 0;
  border-radius: var(--radius-full);
  background-color: var(--color-ui-line);
}
[data-cd-theme] .sl-progress .progress-bar {
  border-radius: var(--radius-full);
  background-color: var(--color-primary-indicator);
}

/* --- 4 Column, welcome, groups, cards ----------------------------------------- */
[data-cd-theme] #outerframeContainer {
  margin-block-start: var(--space-5);
  padding-block: 0;
}
[data-cd-theme] :is(#main-row, #main-col) {
  margin: 0;
  padding: 0;
  inline-size: auto;
}
[data-cd-theme] .space-col { margin-block: 0; }
[data-cd-theme] #main-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);                 /* section gap (D95) */
}
[data-cd-theme] #main-col > :is(div, p, form):empty { display: none; }
[data-cd-theme] form#limesurvey {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Welcome page: the page intro on the grey page, h1 32 Medium (D88) */
[data-cd-theme] #welcome-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
[data-cd-theme] #welcome-container > * { margin: 0; }
[data-cd-theme] #welcome-container > :empty { display: none; }
[data-cd-theme] #welcome-container .survey-name {
  font-size: var(--text-h1);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
}
[data-cd-theme] #welcome-container .survey-description {
  font-size: var(--text-body-lg);
  line-height: var(--leading-normal);
}
[data-cd-theme] #welcome-container .survey-welcome {
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
}
[data-cd-theme] #welcome-container .number-of-questions { font-size: var(--text-meta); }

/* Privacy / anonymity notice on the welcome page: an h4-sized heading, 8 px to its text
   (vanilla shrinks .h4 to 16 px on phones by device width) */
[data-cd-theme] .privacy.row { margin: 0; }
[data-cd-theme] .ls-privacy-head {
  margin-block: 0 var(--space-2);
  font-size: var(--text-h4);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
}
[data-cd-theme] .ls-privacy-body { margin-block: 0 var(--space-4); }

/* Groups: heading 26 Medium (h2 role), intro 8 below, cards 16 apart */
[data-cd-theme] .group-outer-container { display: block; }
[data-cd-theme] .group-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
[data-cd-theme] .group-container > :is(div, p):empty { display: none; }
[data-cd-theme] .group-title {
  margin: 0;
  padding: 0;
  font-size: var(--text-h2);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
}
[data-cd-theme] .group-description {
  margin: 0;
  font-size: var(--text-body);
}
/* vanilla draws the group description as a grey ".well" box: plain intro text here */
[data-cd-theme] .group-description .well {
  min-block-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background-color: transparent;
  box-shadow: none;
}
[data-cd-theme] .group-title + .group-description { margin-block-start: calc(var(--space-2) - var(--space-4)); }
[data-cd-theme] .group-description:not(:empty) { margin-block-end: var(--space-2); }

/* Question card: white, 1 px line, 8 px corners, padding 24 (16 below 480 px) */
[data-cd-theme] .question-container {
  --sl-card-pad: var(--space-5);       /* 24, 16 below 480 px (web.md §0.2 C3) */
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: var(--space-4);
  margin: 0;
  padding: var(--sl-card-pad);
  border: var(--border-width) solid var(--color-ui-line);
  border-radius: var(--radius-md);
  background-color: var(--color-bg);
  color: var(--color-text);
}
[data-cd-theme] .question-container > * {
  inline-size: auto;
  max-inline-size: 100%;
  margin: 0;
  padding: 0;
}
[data-cd-theme] .question-container > :is(.d-none, .hide-tip),
[data-cd-theme] .question-container > .question-valid-container:not(:has(*)),
[data-cd-theme] .question-container > .question-help-container:not(:has(*)),
[data-cd-theme] .question-container > .answer-container:not(:has(:not(input[type="hidden"], script))) {
  display: none;
}
@media (max-width: 479.98px) {
  [data-cd-theme] .question-container { --sl-card-pad: var(--space-4); }
}
[data-cd-theme] .question-title-container {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--space-2);
  padding: 0;
}
[data-cd-theme] :is(.question-number, .question-code) {
  float: none;
  margin: 0;
  font-size: var(--text-ui);
  font-weight: var(--weight-regular);
}
/* the question stays beside number and code while it keeps 16rem; with a long code on a
   phone ("12 MNM", "46 QCDefault") it wraps below them and takes the card's full width */
[data-cd-theme] .question-title-container .question-text {
  flex: 1 1 16rem;
  min-inline-size: 0;
  font-size: var(--text-body-lg);       /* question 18 Medium (D88, web.md §0.2 C4) */
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
}
/* Required: LimeSurvey writes the star and the word ("Pflichtangabe") before the number;
   they move behind the question as their own line, black, the star Bold (D99) */
[data-cd-theme] .question-title-container > .asterisk {
  display: inline-flex;
  flex-basis: 100%;
  align-items: baseline;
  gap: var(--space-1);
  order: 10;
  margin: 0;
  color: var(--color-text);
  font-size: var(--text-meta);
  font-weight: var(--weight-regular);
}
[data-cd-theme] .asterisk :is(.text-danger, sup) {
  color: var(--color-text) !important;          /* check-style: ignore — beats Bootstrap's !important .text-danger */
  font-size: var(--text-meta);
}
[data-cd-theme] .asterisk sup {
  inset-block-start: 0;
  font-weight: var(--weight-bold);
  vertical-align: baseline;
}

/* End page: the end text, then the print and statistics links as 44 px rows (D26) */
[data-cd-theme] .completed-text > :is(p, div) { margin: 0 0 var(--space-4); }
[data-cd-theme] .completed-text .url-wrapper { margin: 0; }
[data-cd-theme] .completed-text .url-wrapper > a,
[data-cd-theme] .completed-text > a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-min);
  text-decoration-line: underline;
  text-decoration-thickness: var(--link-underline);
  text-underline-offset: var(--link-underline-offset);
}

/* --- 5 Help, tips, errors, alerts ------------------------------------------------ */
[data-cd-theme] .question-container :is(.question-help-container, .question-valid-container) {
  color: var(--color-text-muted) !important;   /* check-style: ignore — the containers carry Bootstrap's !important .text-info */
  font-size: var(--text-meta);
  line-height: var(--leading-normal);
}
[data-cd-theme] :is(.ls-questionhelp, .help-block, .questionhelp) {
  font-size: var(--text-meta);
  padding-block-end: 0;
}
/* One text edge for every line under the question: tips, help text and the mandatory error
   all start on the card's content edge. Vanilla hangs a FontAwesome "?" in a 20 px indent of
   the tips only, so a mandatory error (outside that block) started 20 px left of the tip
   lines beside it; the icon is decoration (the tips are muted meta text) and goes. */
[data-cd-theme] .ls-questionhelp {
  margin-block: 0;
  margin-inline: 0;
}
[data-cd-theme] .ls-questionhelp::before { content: none; display: none; }
[data-cd-theme] .question-valid-container :is(.ls-question-message, .ls-question-mandatory) {
  margin-inline: 0;
  padding-inline: 0;
}
[data-cd-theme] .question-valid-container .ls-questionhelp + .ls-questionhelp { margin-block-start: var(--space-2); }
/* A tip that turned into an error: black, Medium, the word "Fehler" first (D99) */
[data-cd-theme] .question-valid-container :is(.ls-em-error, .text-danger) {
  color: var(--color-text) !important;          /* check-style: ignore — beats Bootstrap's !important .text-danger */
  font-weight: var(--weight-medium);
}
[data-cd-theme]:lang(de) .question-valid-container .ls-em-error::before {
  content: "Fehler: ";
  font-weight: var(--weight-bold);
}
/* LimeSurvey's mandatory message after a submit ("Bitte beantworte diese Frage."): the same
   error line — its red icon goes, the word "Fehler" leads */
[data-cd-theme] .question-valid-container .ls-question-mandatory > .fa { display: none; }
[data-cd-theme]:lang(de) .question-valid-container .ls-question-mandatory::before {
  content: "Fehler: ";
  font-weight: var(--weight-bold);
}
/* A question with an error: 4 px black bar on the card's start edge (D99). A mandatory
   question left empty gets no error class from LimeSurvey, only its message. */
[data-cd-theme] .question-container:is(.input-error, .has-error, :has(.ls-question-mandatory:not(.d-none, .hide))) {
  border-inline-start: var(--space-1) solid var(--color-status-bar);
  padding-inline-start: calc(var(--sl-card-pad) - var(--space-1) + var(--border-width));   /* content stays on its edge */
}

/* Status boxes: neutral white box, black text, 4 px bar (D97, D103) */
[data-cd-theme] .alert {
  --bs-alert-color: var(--color-text);
  --bs-alert-bg: var(--color-bg);
  --bs-alert-border-color: var(--color-ui-line);
  --bs-alert-link-color: var(--color-link);
  margin: 0;
  padding: var(--space-4) var(--space-5);
  border: var(--border-width) solid var(--color-ui-line);
  border-inline-start: var(--space-1) solid var(--color-status-bar);
  border-radius: var(--radius-md);
  background-color: var(--color-bg);   /* LimeSurvey's own CSS fills .alert-danger pink */
  color: var(--color-text);
}
[data-cd-theme] .alert-info { border-inline-start-color: var(--color-primary-indicator); }
[data-cd-theme] .alert.row { margin-inline: 0; }

/* --- 6 Choice rows: the whole row is the target (D99) ---------------------------- */
/* vanilla pads every answer block 15 px top and bottom; Bootstrap's !important .mb-3
   sits on several answer wrappers. Spacing comes from the card's gap instead. */
[data-cd-theme] .answer-container .ls-answers { padding-block: 0; }
[data-cd-theme] .answer-container .mb-3 {
  margin-block-end: 0 !important;      /* check-style: ignore — beats Bootstrap's !important .mb-3 inside answers */
}
[data-cd-theme] .answer-container ul:has(> li:is(.radio-item, .checkbox-item, .radio-text-item, .checkbox-text-item)) {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  margin-inline: calc(-1 * var(--space-4));     /* the 24 px boxes stand on the card's content edge */
  padding: 0;
  list-style: none;
}
[data-cd-theme] .answer-container ul[class*="horizontal"]:has(> li) {
  flex-direction: row;
  flex-wrap: wrap;
}
[data-cd-theme] .answer-container li:is(.radio-item, .checkbox-item, .radio-text-item, .checkbox-text-item) {
  position: relative;
  margin: 0 !important;                         /* check-style: ignore — beats Bootstrap's !important .mb-3 on the rows */
  padding: 0;
}
[data-cd-theme] .answer-container li .row { margin: 0; --bs-gutter-x: 0; }
[data-cd-theme] .answer-container li .row > * { padding: 0; }
/* answer grids with two columns (list with comment): a 24 px gutter between them */
[data-cd-theme] .answer-container .ls-answers.row {
  row-gap: var(--space-4);
}
@media (min-width: 768px) {
  [data-cd-theme] .answer-container .ls-answers.row > [class*="col-md-"] + [class*="col-md-"] { padding-inline-start: var(--space-5); }
}

/* the row: label with the box drawn by ::before, 16 px inset from the outer edge */
[data-cd-theme] .answer-container :is(li, div):is(.radio-item, .checkbox-item) label,
[data-cd-theme] li.answer-item :is(.label-radio, .checkbox-label, .radio-label) {
  display: block;
  position: relative;
  min-block-size: var(--control-height);
  margin: 0;
  padding: var(--space-3) calc(var(--space-4) - var(--border-width-thick)) var(--space-3) calc(var(--space-4) - var(--border-width-thick) + var(--space-5) + var(--space-3));
  border: var(--border-width-thick) solid transparent;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  text-align: start;
  cursor: pointer;
}
[data-cd-theme] .answer-container :is(li, div):is(.radio-item, .checkbox-item) label:hover { background-color: var(--color-ui-subtle); }
/* Bootstrap's .form-check wrapper around a choice row: no indent of its own */
[data-cd-theme] .answer-container .form-check {
  min-block-size: 0;
  margin: 0;
  padding: 0;
}
[data-cd-theme] .answer-container div:is(.radio-item, .checkbox-item) {
  position: relative;
  margin: 0;
  padding: 0;
}

/* the native input sits over the drawn box (it keeps keyboard and screen reader) */
[data-cd-theme] .answer-container :is(li, div):is(.radio-item, .checkbox-item) input:is([type="radio"], [type="checkbox"]) {
  position: absolute;
  inset-block-start: var(--space-3);
  inset-inline-start: var(--space-4);
  z-index: 1;
  inline-size: var(--space-5);
  block-size: var(--space-5);
  margin: 0;
  opacity: 0;
}

/* --- 6a The drawn box and mark, shared by list rows and array cells ------------- */
[data-cd-theme] :is(.radio-item, .checkbox-item) label::before {
  content: "";
  position: absolute;
  inset-block-start: var(--space-3);
  inset-inline-start: calc(var(--space-4) - var(--border-width-thick));
  box-sizing: border-box;
  inline-size: var(--space-5);
  block-size: var(--space-5);
  margin: 0;
  border: var(--border-width) solid var(--color-ui-line-strong);
  border-radius: var(--radius-sm);
  background-color: var(--color-bg);
  box-shadow: none;
  transition: none;
}
[data-cd-theme] .radio-item label::before { border-radius: var(--radius-full); }
[data-cd-theme] .radio-item label::after {
  content: "";
  position: absolute;
  inset-block-start: calc(var(--space-3) + 7px);
  inset-inline-start: calc(var(--space-4) - var(--border-width-thick) + 7px);
  inline-size: 10px;
  block-size: 10px;
  margin: 0;
  padding: 0;
  border-radius: var(--radius-full);
  background-color: var(--color-on-indicator);
  transform: scale(0);
  transition: none;
}
[data-cd-theme] .checkbox-item label::after {
  content: none;
  margin: 0;
  padding: 0;
}
/* checked: indicator fill, the mark in --color-on-indicator (white; black on the light
   indicator of the dark theme, D97, D99, D118) */
[data-cd-theme] :is(.radio-item, .checkbox-item) input:checked + label::before {
  border-color: var(--color-primary-indicator);
  background-color: var(--color-primary-indicator);
}
[data-cd-theme] .radio-item input:checked + label::after { transform: none; }
[data-cd-theme] .checkbox-item input:checked + label::after {
  content: "";
  position: absolute;
  inset-block-start: var(--space-3);
  inset-inline-start: calc(var(--space-4) - var(--border-width-thick));
  inline-size: var(--space-5);
  block-size: var(--space-5);
  border-radius: var(--radius-sm);
  background: var(--sl-check-mark) center / 100% 100% no-repeat;
}
/* selected row: the Helle Ton with a 2 px indicator border (D99) */
[data-cd-theme] .answer-container :is(li, div):is(.radio-item, .checkbox-item) input:checked + label {
  border-color: var(--color-primary-indicator);
  background-color: var(--color-selected-bg);
}
/* focus: the row carries the ring (D21); the host's ring on the drawn box goes */
[data-cd-theme] :is(.radio-item, .checkbox-item) input:is(:focus, :focus-visible) + label::before {
  outline-style: none;                 /* the row label below carries the D21 ring */
  box-shadow: none;
}
[data-cd-theme] :is(.radio-item, .checkbox-item) input:focus-visible + label {
  outline: var(--focus-ring-width) solid var(--color-focus);
  outline-offset: var(--focus-ring-offset);
  box-shadow: var(--shadow-focus-halo);
}
[data-cd-theme] :is(.radio-item, .checkbox-item) input:disabled + label {
  color: var(--color-text-muted);
  opacity: 1;
  cursor: not-allowed;
}
[data-cd-theme] :is(.radio-item, .checkbox-item) input:disabled + label::before {
  border-color: var(--color-ui-line-strong);
  background-color: var(--color-ui-subtle);
}

/* "Sonstiges" row: radio row and its text field side by side, wrapping on phones */
[data-cd-theme] li.checkbox-text-item > .row {
  align-items: center;
  row-gap: var(--space-2);
}
[data-cd-theme] li.checkbox-text-item > .row > .comment-item {
  padding-inline: var(--space-4);
  margin-block-end: 0 !important;      /* check-style: ignore — beats Bootstrap's !important .mb-2 */
}
@media (min-width: 768px) {
  [data-cd-theme] li.checkbox-text-item > .row > .comment-item { padding-inline-start: 0; }
}
[data-cd-theme] li:is(.radio-text-item, .checkbox-text-item) .form-check { margin-block-end: 0 !important; }   /* check-style: ignore — beats Bootstrap's !important .mb-2 */
[data-cd-theme] li.radio-text-item {
  display: flex !important;            /* check-style: ignore — keeps Bootstrap's !important .d-flex as a wrapping row */
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) 0;
  margin-inline: 0;
}
/* The list reaches 16 px into the card padding (the rows' hover fill). The "Sonstiges" field
   keeps 16 px on both sides, so beside its row it ends on the content edge and, wrapped
   under it (phones), it starts there too — on the edge of the question text and the boxes. */
[data-cd-theme] li:is(.radio-text-item, .checkbox-text-item) > .other-text-item {
  flex: 1 1 14rem;
  padding-inline: var(--space-4);
}
[data-cd-theme] .answer-container li .col > .other-text-item { padding-inline: var(--space-4); }
/* format hints under a field (date): muted, 8 px below */
[data-cd-theme] .answer-container .help-block {
  margin-block: var(--space-2) 0;
  color: var(--color-text-muted);
}

/* --- 7 Segmented buttons: yes/no, gender (D99) ---------------------------------- */
[data-cd-theme] .answer-container .btn-group {
  display: inline-flex;
  flex-wrap: nowrap;
  inline-size: auto;
  float: none;
}
[data-cd-theme] .btn-group > .btn-check + .btn,
[data-cd-theme] .btn-group > .btn-check:focus + .btn {
  margin-block: 0 !important;          /* check-style: ignore — beats Bootstrap's !important .mb-3 on the labels */
  border: var(--border-width) solid var(--color-ui-line-strong);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  box-shadow: none;
}
[data-cd-theme] .btn-group > .btn-check + .btn:hover {
  border-color: var(--color-ink);
  background-color: var(--color-ui-subtle);
  color: var(--color-text);
}
[data-cd-theme] .btn-group > .btn-check:checked + .btn,
[data-cd-theme] .btn-group > .btn-check:checked:focus + .btn,
[data-cd-theme] .btn-group > .btn-check:checked + .btn:hover {
  border-color: var(--color-primary-indicator);
  background-color: var(--color-primary-indicator);
  color: var(--color-on-indicator);
}
[data-cd-theme] .btn-group > .btn-check:focus-visible + .btn {
  z-index: 2;
  outline: var(--focus-ring-width) solid var(--color-focus);
  outline-offset: var(--focus-ring-offset);
  box-shadow: var(--shadow-focus-halo);
}
[data-cd-theme] .btn .ls-icon {
  display: inline-block;
  font-size: var(--text-body-lg);
  line-height: var(--leading-tight);
}
/* below 480 px the joined pill becomes separate pills (D99) */
@media (max-width: 479.98px) {
  [data-cd-theme] .answer-container .btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
  }
  [data-cd-theme] .answer-container .btn-group > .btn {
    margin-inline-start: 0;
    border-radius: var(--radius-full);
  }
}

/* --- 8 Fields and selects (D99) ----------------------------------------------- */
[data-cd-theme] :is(.form-control, .form-select, select.form-control) {
  min-block-size: var(--control-height);
  padding: var(--space-3);
  border: var(--border-width) solid var(--color-ui-line-strong);
  border-radius: var(--radius-sm);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: var(--text-ui);
  line-height: var(--leading-snug);
  box-shadow: none;
}
[data-cd-theme] :is(.form-control, .form-select):hover { border-color: var(--color-ink); }
[data-cd-theme] :is(.form-control, .form-select):focus {
  border: var(--border-width-thick) solid var(--color-ink);
  padding: calc(var(--space-3) - var(--border-width));
}
[data-cd-theme] textarea.form-control {
  min-block-size: calc(3 * var(--space-7));
  line-height: var(--leading-normal);
}
[data-cd-theme] :is(.form-select, select.form-control) {
  --bs-form-select-bg-img: var(--sl-chevron);
  -webkit-appearance: none;
  appearance: none;
  padding-inline-end: var(--space-7);
  background-image: var(--bs-form-select-bg-img);
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: var(--space-5) var(--space-5);
  cursor: pointer;
}
[data-cd-theme] :is(.form-select, select.form-control):focus { padding-inline-end: calc(var(--space-7) - var(--border-width)); }
[data-cd-theme] :is(.form-control, .form-select)::placeholder {
  color: var(--color-ui-line-strong); /* check-style: ignore — D91 placeholder, its one text use */
  opacity: 1;
}
[data-cd-theme] :is(.form-control, .form-select):disabled {
  border-color: var(--color-ui-line-strong);
  background-color: var(--color-ui-subtle);
  color: var(--color-text-muted);
}
/* labels of text fields: 16 px Medium above the field (D99) */
[data-cd-theme] .answer-container label.control-label:not(.radio-label, .checkbox-label, .label-radio, .ls-label-xs-visibility) {
  font-size: var(--text-ui);
  font-weight: var(--weight-medium);
}
/* selects size to their options, never cut (L5), never wider than the card */
[data-cd-theme] .answer-container :is(.form-select, select.form-control) {
  inline-size: auto;
  min-inline-size: min(100%, 12rem);
  max-inline-size: 100%;
}
[data-cd-theme] .answer-container .row-cols-lg-auto > *,
[data-cd-theme] .answer-container .language-item {
  flex: 0 1 auto;
  inline-size: auto;
  max-inline-size: 100%;
}
[data-cd-theme] .input-group > .btn {
  min-inline-size: var(--control-height);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
/* Add-ons of a field (the date picker icon, "show access code"): part of the field, not a
   button of their own — white, the field's border, a black 20 px icon; the primary fill
   stays with real buttons (D98). The date icon is no tab stop (the picker opens from the
   field), so it gets no button look. */
[data-cd-theme] .input-group > :is(.input-group-addon, .input-group-text),
[data-cd-theme] .input-group > .input-group-addon.btn.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: var(--control-height);
  min-block-size: var(--control-height);
  padding: 0 var(--space-3);
  border: var(--border-width) solid var(--color-ui-line-strong);
  border-inline-start-width: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: calc(var(--space-4) + var(--space-1));    /* 20 px icon */
  font-weight: var(--weight-regular);
}
[data-cd-theme] .input-group > .input-group-addon.btn.btn-primary:is(:hover, :active) {
  border-color: var(--color-ui-line-strong);
  background-color: var(--color-ui-subtle);
  color: var(--color-text);
}
[data-cd-theme] .input-group > button.input-group-text:focus-visible {
  z-index: 3;
  outline: var(--focus-ring-width) solid var(--color-focus);
  outline-offset: var(--focus-ring-offset);
  box-shadow: var(--shadow-focus-halo);
}
[data-cd-theme] .input-group > .form-control:not(:last-child) {
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}

/* Date as three drop-downs (Tag . Monat . Jahr): vanilla stacks them below 576 px with each
   "." on a row of its own. There each select gets its label (LimeSurvey's visually hidden
   "Tag", "Monat", "Jahr") above it and the separators go (theming.md §9.1, D99) */
@media (max-width: 575.98px) {
  [data-cd-theme] .answer-container .date-item.row:has(select) {
    --bs-gutter-y: 0;
    row-gap: var(--space-5);
    margin: 0;
  }
  [data-cd-theme] .answer-container .date-item.row:has(select) > .col-12:not(:has(select)) { display: none; }
  [data-cd-theme] .answer-container .date-item.row:has(select) > .col-12 {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    padding: 0;
  }
  [data-cd-theme] .answer-container .date-item.row:has(select) > .col-12 > label.visually-hidden {
    position: static !important;        /* check-style: ignore — beats Bootstrap's !important .visually-hidden: the label shows here */
    inline-size: auto !important;       /* check-style: ignore — same */
    block-size: auto !important;        /* check-style: ignore — same */
    margin: 0 !important;               /* check-style: ignore — same */
    overflow: visible !important;       /* check-style: ignore — same */
    clip: auto !important;              /* check-style: ignore — same */
    white-space: normal !important;     /* check-style: ignore — same */
    font-size: var(--text-ui);
    font-weight: var(--weight-medium);
  }
}

/* Text and numeric items in lists: the label above its field, 8 px apart, 24 px to the
   next label (D99) — vanilla puts the label right-aligned beside the field */
[data-cd-theme] .answer-container ul:has(> li.text-item) {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}
[data-cd-theme] .answer-container li:is(.text-item, .ls-group-total),
[data-cd-theme] .answer-container .ls-slider-item-row {
  display: flex;
  flex-direction: column;
  align-items: stretch !important;     /* check-style: ignore — beats Bootstrap's !important .align-items-center: label and field on one left edge */
  gap: var(--space-2);
  margin: 0 !important;                /* check-style: ignore — beats Bootstrap's !important .mb-3 on the rows */
  padding: 0;
}
[data-cd-theme] .answer-container li:is(.text-item, .ls-group-total) > *,
[data-cd-theme] .answer-container .ls-slider-item-row > * {
  inline-size: auto;
  max-inline-size: 100%;
  margin: 0;
  padding: 0 !important;               /* check-style: ignore — beats Bootstrap's !important .px-md-5 beside sliders */
}
[data-cd-theme] .answer-container li.text-item .control-label,
[data-cd-theme] .answer-container .ls-slider-item-row > .control-label,
[data-cd-theme] .answer-container .ls-group-total > .control-label {
  font-size: var(--text-ui);
  font-weight: var(--weight-medium);
  text-align: start;
}
/* Sum rows: label and value on the fields' edge, no input look (theming.md §9.1) */
[data-cd-theme] .answer-container li.ls-group-total {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline !important;    /* check-style: ignore — beats the !important rule above for the one-line sum row */
}
[data-cd-theme] .answer-container .ls-group-total .form-control-static {
  min-block-size: 0;
  padding: 0;
  font-weight: var(--weight-bold);
}
/* Sliders: 8 px track in grey, selection and 24 px handle in the indicator colour, no
   gradients (Farben p.9); min and max values clear of the handle */
[data-cd-theme] .answer-container .slider-item { margin-block-end: 0; }
/* min | track | max in one row, "weniger" / "mehr" below its ends */
[data-cd-theme] .ls-slider-answer-row > * {
  flex: 1 1 100%;
  inline-size: 100%;
  margin: 0;
  padding: 0;
}
[data-cd-theme] .ls-slider-answer-row .row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin: 0;
}
[data-cd-theme] .ls-slider-answer-row .row > * {
  inline-size: auto;
  max-inline-size: none;
  margin: 0;
  padding: 0;
}
[data-cd-theme] .ls-slider-answer-row .slider-min-block { grid-column: 1; grid-row: 1; order: 0; }
[data-cd-theme] .ls-slider-answer-row .slider-container { grid-column: 2; grid-row: 1; order: 0; }
[data-cd-theme] .ls-slider-answer-row .slider-max-block { grid-column: 3; grid-row: 1; order: 0; }
[data-cd-theme] .ls-slider-answer-row .slider-left { grid-column: 1 / 3; grid-row: 2; }
[data-cd-theme] .ls-slider-answer-row .slider-right {
  grid-column: 2 / 4;
  grid-row: 2;
  justify-self: end;                   /* the label sits at the scale's end; its text stays left aligned */
  text-align: start !important;        /* check-style: ignore — beats Bootstrap's !important .text-end */
}
[data-cd-theme] table.ls-answers .answertextright { text-align: start; }
[data-cd-theme] .slider.slider-horizontal {
  inline-size: calc(100% - var(--space-5));
  block-size: var(--space-5);
  margin-inline: var(--space-3);       /* the 24 px handle stays clear of the min and max values */
}
[data-cd-theme] .slider.slider-horizontal .slider-track {
  inset-block-start: 50%;
  block-size: var(--space-2);
  margin-block-start: calc(-1 * var(--space-1));
  border-radius: var(--radius-full);
  background: var(--color-ui-line);
  box-shadow: none;
}
[data-cd-theme] .slider .slider-selection {
  border-radius: var(--radius-full);
  background: var(--color-primary-indicator);
  box-shadow: none;
}
[data-cd-theme] .slider :is(.slider-track-low, .slider-track-high) {
  background: transparent;
}
[data-cd-theme] .slider .slider-handle {
  inset-block-start: 0;
  inline-size: var(--space-5);
  block-size: var(--space-5);
  margin-inline-start: calc(-1 * var(--space-3));
  border: var(--border-width-thick) solid var(--color-bg);
  background: var(--color-primary-indicator);
  box-shadow: none;
}
[data-cd-theme] .slider .tooltip-inner {
  border-radius: var(--radius-sm);
  background-color: var(--sl-tooltip-bg);
  color: var(--sl-tooltip-text);
  font-size: var(--text-small);
}
[data-cd-theme] .slider .tooltip .tooltip-arrow::before { border-top-color: var(--sl-tooltip-bg); }
[data-cd-theme] .ls-slider-answer-row :is(.slider-min-block, .slider-max-block, .slider-left, .slider-right) {
  color: var(--color-text-muted);
  font-size: var(--text-meta);
}

/* Ranking: two framed lists side by side, 48 px rows (D99) */
[data-cd-theme] .answer-container .answers-list.row > .ranking-sorted-items { padding-inline-start: var(--space-4); }
[data-cd-theme] .sortable-subtitle {
  display: block;
  margin-block-end: var(--space-2);
  font-weight: var(--weight-medium);
}
[data-cd-theme] .sortable-list.list-group {
  min-block-size: calc(2 * var(--control-height));
  border: var(--border-width) solid var(--color-ui-line-strong);
  border-radius: var(--radius-sm);
  background-color: var(--color-bg);
}
[data-cd-theme] .sortable-list .list-group-item {
  display: flex;
  align-items: center;
  min-block-size: var(--control-height);
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-block-end: var(--border-width) solid var(--color-ui-line);
  border-radius: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  cursor: grab;
}
[data-cd-theme] .sortable-list .list-group-item:hover { background-color: var(--color-ui-subtle); }
[data-cd-theme] .sortable-rank .list-group-item {
  background-color: var(--color-selected-bg);
}

/* --- 9 Array tables: scroll inside the card, never squeezed (D94, D100) -------- */
/* From 1024 px an array whose columns do not fit the 40rem column takes the wide column
   (theming.md §9.1): limesurvey-theme.js measures the table and sets .sl-wide on its card.
   The card keeps the column's left edge and grows to the right, up to --ui-column-wide or
   the page's right gutter: 50cqi + 50% is the distance from the column's left content edge
   to the page centre plus half the page (cqi of .sl-main, §3). */
@media (min-width: 1024px) {
  [data-cd-theme] .question-container.sl-wide {
    inline-size: min(var(--ui-column-wide), 50cqi + 50% - var(--ui-gutter));
    max-inline-size: none;
  }
}
/* The table's box: a named tab stop while it scrolls, the edges with hidden columns shown at
   a third of their strength — leipzig.css 2.2.0 .table-wrap, copied (D100); the script sets
   tabindex, role, the name and data-more. Never a fade (Farben p.9): flat mask tiles. */
[data-cd-theme] :is(.ls-table-wrapper, .answer-container div:has(> table.ls-answers)) {
  --table-edge-full: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25'/%3E%3C/svg%3E");
  --table-edge-dim: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' fill-opacity='.33'/%3E%3C/svg%3E");
  position: relative;                  /* the containing block of LimeSurvey's visually hidden cell labels (absolute): they stay inside the scroll box, not in the page's scroll width */
  max-inline-size: 100%;
  overflow-x: auto;
}
[data-cd-theme] .ls-table-wrapper[data-more]:not([data-more=""]):not(:focus-visible) {
  --table-edge-start: var(--table-edge-full);
  --table-edge-end: var(--table-edge-full);
  -webkit-mask: var(--table-edge-start) left / var(--space-6) 100% no-repeat,
                var(--table-edge-full) center / calc(100% - 2 * var(--space-6)) 100% no-repeat,
                var(--table-edge-end) right / var(--space-6) 100% no-repeat;
  mask: var(--table-edge-start) left / var(--space-6) 100% no-repeat,
        var(--table-edge-full) center / calc(100% - 2 * var(--space-6)) 100% no-repeat,
        var(--table-edge-end) right / var(--space-6) 100% no-repeat;
}
[data-cd-theme] .ls-table-wrapper[data-more~="start"] { --table-edge-start: var(--table-edge-dim); }
[data-cd-theme] .ls-table-wrapper[data-more~="end"] { --table-edge-end: var(--table-edge-dim); }
[data-cd-theme] table.ls-answers {
  --bs-table-bg: transparent;
  --bs-table-color: var(--color-text);
  --bs-table-hover-bg: var(--color-ui-subtle);
  --bs-table-hover-color: var(--color-text);
  --bs-table-striped-bg: transparent;
  --bs-table-border-color: var(--color-ui-line);
  inline-size: 100%;
  margin: 0;
  table-layout: auto;
  border-collapse: collapse;
  font-size: var(--text-ui);
  line-height: var(--leading-snug);
}
[data-cd-theme] table.ls-answers :is(colgroup, thead, tbody, tfoot, tr),
[data-cd-theme] table.ls-answers > :not(caption) > * {
  border-width: 0;
}
[data-cd-theme] table.ls-answers :is(th, td),
[data-cd-theme] table.ls-answers > :not(caption) > * > * {
  padding: var(--space-3) var(--space-2);
  border-width: 0 0 var(--border-width);
  border-style: solid;
  border-color: var(--color-ui-line);
  background-color: transparent;
  box-shadow: none;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: manual;
  vertical-align: middle;
}
[data-cd-theme] table.ls-answers thead :is(th, td) {
  color: var(--color-text);
  font-size: var(--text-ui);
  font-weight: var(--weight-medium);
  text-align: center;
  vertical-align: bottom;
}
[data-cd-theme] table.ls-answers tbody th {
  font-weight: var(--weight-regular);
  text-align: start;
}
[data-cd-theme] table.ls-answers :is(.ls-odd, .ls-even, .ls-col-odd, .ls-col-even) { background-color: transparent; }

@media (min-width: 768px) {
  /* every cell draws its own row rule (separate borders, no spacing): with collapsed borders
     the table paints the rules of the answer cells but the sticky first column paints its own,
     and on a row with a fractional top they snapped one pixel apart (a seam at the column
     boundary) */
  [data-cd-theme] table.ls-answers {
    border-collapse: separate;
    border-spacing: 0;
  }
  /* first column sticks while the answers scroll; the cut edge shows there is more */
  [data-cd-theme] table.ls-answers tbody th.answertext,
  [data-cd-theme] table.ls-answers thead tr > :first-child {
    position: sticky;
    inset-inline-start: 0;
    z-index: 1;
    inline-size: 10rem;                /* a minimum in auto table layout: short row labels ("Teilfrage - Y-Skala") never break at a hyphen (D113) */
    min-inline-size: 10rem;            /* also where LimeSurvey's <col> percentages squeeze it (dual scale in a scrolling box) */
    padding-inline-start: 0;
    background-color: var(--color-bg);
  }
  [data-cd-theme] table.ls-answers tbody tr:hover > th.answertext { background-color: var(--color-ui-subtle); }
  html[data-cd-theme] table.ls-answers td:is(.radio-item, .checkbox-item) {
    position: relative;
    padding: 0;
    text-align: center;
  }
  /* the cell's label is only the 24 px box (its text is hidden by LimeSurvey) */
  html[data-cd-theme] table.ls-answers td:is(.radio-item, .checkbox-item) label.ls-label-xs-visibility {
    display: inline-block;
    position: relative;
    inline-size: var(--target-min);
    block-size: var(--target-min);
    margin: 0;
    padding: 0;
    overflow: hidden;
    vertical-align: middle;
    white-space: nowrap;
    text-indent: 200%;                 /* the visually hidden option name (LimeSurvey shows it on phones) */
    border-radius: var(--radius-full);
  }
  html[data-cd-theme] table.ls-answers td:is(.radio-item, .checkbox-item) label.ls-label-xs-visibility::before,
  html[data-cd-theme] table.ls-answers td:is(.radio-item, .checkbox-item) label.ls-label-xs-visibility::after {
    inset-block-start: 10px;
    inset-inline-start: 10px;
    margin: 0;
  }
  html[data-cd-theme] table.ls-answers td.radio-item label.ls-label-xs-visibility::after {
    inset-block-start: 17px;
    inset-inline-start: 17px;
  }
  html[data-cd-theme] table.ls-answers td:is(.radio-item, .checkbox-item) label.ls-label-xs-visibility:hover::before { border-color: var(--color-ink); }
  html[data-cd-theme] table.ls-answers td:is(.radio-item, .checkbox-item) input:is([type="radio"], [type="checkbox"]) {
    inset-block-start: 50%;
    inset-inline-start: 50%;
    inline-size: var(--space-5);
    block-size: var(--space-5);
    margin: 0;
    transform: translate(-50%, -50%);
  }
}

@media (max-width: 767.98px) {
  /* LimeSurvey turns arrays into lists here (noTablesOnMobile): each subquestion a
     block with its answers as choice rows. A list does not scroll: the box lets the rows'
     hover fill reach into the card padding, as in list questions (no tab stop, no edge cue) */
  [data-cd-theme] :is(.ls-table-wrapper, .answer-container div:has(> table.ls-answers)) { overflow: visible; }
  [data-cd-theme] table.ls-answers tbody tr {
    padding-block: var(--space-4);
    border-block-end: var(--border-width) solid var(--color-ui-line);
  }
  [data-cd-theme] table.ls-answers tbody tr:first-child { padding-block-start: 0; }
  [data-cd-theme] table.ls-answers tbody tr:last-child { padding-block-end: 0; border-block-end: 0; }
  [data-cd-theme] table.ls-answers tbody :is(th, td) {
    padding: 0;
    border-width: 0;
  }
  [data-cd-theme] table.ls-answers tbody th.answertext {
    padding-block-end: var(--space-2);
    font-size: var(--text-ui);
    font-weight: var(--weight-medium);
  }
  /* rows of fields (text and number arrays): the subquestion is the heading of its labelled
     fields — 18 Medium, 24 px apart from the next row — so the groups scan */
  [data-cd-theme] table.ls-answers tbody tr:has(> td:not(.radio-item, .checkbox-item) :is(input, select, textarea)) {
    padding-block: var(--space-5);
  }
  [data-cd-theme] table.ls-answers tbody tr:has(> td:not(.radio-item, .checkbox-item) :is(input, select, textarea)):first-child { padding-block-start: 0; }
  [data-cd-theme] table.ls-answers tbody tr:has(> td:not(.radio-item, .checkbox-item) :is(input, select, textarea)):last-child { padding-block-end: 0; }
  [data-cd-theme] table.ls-answers tbody tr:has(> td:not(.radio-item, .checkbox-item) :is(input, select, textarea)) > th.answertext {
    padding-block-end: var(--space-3);
    font-size: var(--text-body-lg);
    line-height: var(--leading-snug);
  }
  /* text and number cells: label above the field, 16 px to the next label */
  [data-cd-theme] table.ls-answers tbody td:not(.radio-item, .checkbox-item) { padding-block-end: var(--space-4); }
  [data-cd-theme] table.ls-answers tbody td:not(.radio-item, .checkbox-item):last-child { padding-block-end: 0; }
  [data-cd-theme] table.ls-answers tbody td:not(.radio-item, .checkbox-item) label.ls-label-xs-visibility {
    margin-block-end: var(--space-2);
    font-size: var(--text-ui);
    font-weight: var(--weight-medium);
  }
  html[data-cd-theme] table.ls-answers td:is(.radio-item, .checkbox-item) {
    position: relative;
    margin-inline: calc(-1 * var(--space-4));
    padding: 0;
  }
  html[data-cd-theme] table.ls-answers td:is(.radio-item, .checkbox-item) + td:is(.radio-item, .checkbox-item) { margin-block-start: var(--space-2); }
  html[data-cd-theme] table.ls-answers td:is(.radio-item, .checkbox-item) label.ls-label-xs-visibility {
    display: block;
    inline-size: auto;
    block-size: auto;
    min-block-size: var(--control-height);
    margin: 0;
    padding: var(--space-3) calc(var(--space-4) - var(--border-width-thick)) var(--space-3) calc(var(--space-4) - var(--border-width-thick) + var(--space-5) + var(--space-3));
    border: var(--border-width-thick) solid transparent;
    border-radius: var(--radius-sm);
    overflow: visible;
    font-size: var(--text-body);
    font-weight: var(--weight-regular);
    line-height: var(--leading-normal);
    text-indent: 0;
    cursor: pointer;
  }
  html[data-cd-theme] table.ls-answers td:is(.radio-item, .checkbox-item) label.ls-label-xs-visibility:hover { background-color: var(--color-ui-subtle); }
  html[data-cd-theme] table.ls-answers td:is(.radio-item, .checkbox-item) input:checked + label.ls-label-xs-visibility {
    border-color: var(--color-primary-indicator);
    background-color: var(--color-selected-bg);
  }
  html[data-cd-theme] table.ls-answers td:is(.radio-item, .checkbox-item) label.ls-label-xs-visibility::before {
    inset-block-start: var(--space-3);
    inset-inline-start: calc(var(--space-4) - var(--border-width-thick));
    margin: 0;
  }
  html[data-cd-theme] table.ls-answers td.radio-item label.ls-label-xs-visibility::after {
    inset-block-start: calc(var(--space-3) + 7px);
    inset-inline-start: calc(var(--space-4) - var(--border-width-thick) + 7px);
    margin: 0;
  }
  html[data-cd-theme] table.ls-answers td:is(.radio-item, .checkbox-item) input:is([type="radio"], [type="checkbox"]) {
    inset-block-start: var(--space-3);
    inset-inline-start: var(--space-4);
    inline-size: var(--space-5);
    block-size: var(--space-5);
    margin: 0;
  }
}

/* --- 10 Buttons and navigation (D98) ------------------------------------------- */
[data-cd-theme] .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-block-size: var(--button-height);
  padding: var(--space-2) var(--space-5);
  border-width: var(--border-width-thick);
  border-style: solid;
  border-radius: var(--radius-full);
  font-size: var(--text-ui);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
  text-align: center;
  white-space: normal;
}
[data-cd-theme] .btn:focus { box-shadow: none; }
/* Primary: the Leitfarbe pill (D90, D97, D98) */
[data-cd-theme] .btn-primary,
[data-cd-theme] .btn-primary:focus {
  border-color: var(--color-cta);
  background-color: var(--color-cta);
  color: var(--color-on-cta);
}
[data-cd-theme] .btn-primary:is(:hover, :active, .active) {
  border-color: var(--color-cta-hover-border);
  background-color: var(--color-cta-hover);
  color: var(--color-on-cta);
}
/* Secondary: outline and label in the link colour (D98) */
[data-cd-theme] :is(.btn-outline-secondary, .btn-secondary, .btn-outline-primary, .btn-default),
[data-cd-theme] :is(.btn-outline-secondary, .btn-secondary, .btn-outline-primary, .btn-default):focus {
  border-color: var(--color-link);
  background-color: transparent;
  color: var(--color-link);
}
[data-cd-theme] :is(.btn-outline-secondary, .btn-secondary, .btn-outline-primary, .btn-default):is(:hover, :active, .active) {
  border-color: var(--color-link);
  background-color: var(--color-ui-subtle);
  color: var(--color-link);
}
/* The one forward action of the forms outside the question flow is the primary pill, as
   "Weiter" is: save, load, register, access code. LimeSurvey writes them as outline
   buttons (btn-outline-secondary). */
[data-cd-theme] :is(#savebutton, #loadbutton, #register_button, #form-token button[type="submit"]),
[data-cd-theme] :is(#savebutton, #loadbutton, #register_button, #form-token button[type="submit"]):focus {
  border-color: var(--color-cta);
  background-color: var(--color-cta);
  color: var(--color-on-cta);
}
[data-cd-theme] :is(#savebutton, #loadbutton, #register_button, #form-token button[type="submit"]):is(:hover, :active) {
  border-color: var(--color-cta-hover-border);
  background-color: var(--color-cta-hover);
  color: var(--color-on-cta);
}
/* the language form's submit is a secondary action beside "Weiter": outline pill (D98) */
[data-cd-theme] .form-change-lang .btn-primary,
[data-cd-theme] .form-change-lang .btn-primary:focus {
  border-color: var(--color-link);
  background-color: transparent;
  color: var(--color-link);
}
[data-cd-theme] .form-change-lang .btn-primary:is(:hover, :active) {
  border-color: var(--color-link);
  background-color: var(--color-bg);
  color: var(--color-link);
}
/* on the grey page an outline button hovers white (D98) */
[data-cd-theme] :is(#navigator-container, .form-change-lang) :is(.btn-outline-secondary, .btn-secondary, .btn-outline-primary):is(:hover, :active) {
  background-color: var(--color-bg);
}
/* Disabled: the subtle fill (grau-hell; raised in the dark), strong border, muted label,
   no opacity (D98) */
[data-cd-theme] .btn:is(:disabled, .disabled) {
  border-color: var(--color-ui-line-strong);
  background-color: var(--color-ui-subtle);
  color: var(--color-text-muted);
  opacity: 1;
}

/* Navigation: back left, forward right, one row (D98) */
[data-cd-theme] #navigator-container {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
}
[data-cd-theme] #navigator-container > * {
  flex: 1 1 0;
  inline-size: auto;
  max-inline-size: none;
  margin: 0;
  padding: 0;
}
[data-cd-theme] #navigator-container > .text-end {
  display: flex;
  justify-content: flex-end;
  text-align: start !important;        /* check-style: ignore — beats Bootstrap's !important .text-end; the flex row puts the button on the right edge */
}
[data-cd-theme] #navigator-container > :empty,
[data-cd-theme] #navigator-container > :not(:has(*)) { display: block; }   /* the empty back slot keeps "Weiter" on the right */
@media (max-width: 479.98px) {
  [data-cd-theme] #navigator-container:has(.ls-move-previous-btn, #ls-button-previous) .btn { inline-size: 100%; }   /* two buttons share the row 50/50 */
}
/* A lone forward button keeps its natural width on the left edge on phones, on the right
   edge from 640 px (D98) */
@media (max-width: 639.98px) {
  [data-cd-theme] #navigator-container:not(:has(.ls-move-previous-btn, #ls-button-previous)) > :not(:has(*)) { display: none; }
  [data-cd-theme] #navigator-container:not(:has(.ls-move-previous-btn, #ls-button-previous)) > .text-end { justify-content: flex-start; }
}

/* First-page language form: label, select, button in one wrapping row */
[data-cd-theme] #firstpage-changelang .form-change-lang {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-2) var(--space-4);
  margin: 0;
}
[data-cd-theme] #firstpage-changelang .form-change-lang > * {
  flex: 0 1 auto;
  inline-size: auto;
  max-inline-size: 100%;
  margin: 0;
  padding: 0;
}
[data-cd-theme] #firstpage-changelang .form-change-lang > label {
  flex-basis: 100%;
  padding: 0;
  font-size: var(--text-ui);
  font-weight: var(--weight-medium) !important;   /* check-style: ignore — beats Bootstrap's !important .fw-bold: labels are Medium (D99) */
}
[data-cd-theme] #firstpage-changelang select { max-inline-size: 24rem; }

/* --- 11 Footer (D92, D109) ----------------------------------------------------- */
[data-cd-theme] .sl-footer {
  margin-block-start: var(--space-footer);
  padding-block: var(--space-6);
  border-block-start: var(--border-width) solid var(--color-ui-line);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: var(--text-ui);
  line-height: var(--leading-normal);
}
/* the copyright line, then the legal row as a grid: three columns on the 40rem column,
   two below 480 px, one below 360 px (zoom) — no orphan link, no six-row stack */
.sl-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}
[data-cd-theme] .sl-footer__copy { margin: 0; }
[data-cd-theme] .sl-footer__links {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  column-gap: var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}
[data-cd-theme] .sl-footer__links > li { margin: 0; }
[data-cd-theme] .sl-footer a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-min);
  color: var(--color-link);
  text-decoration-line: underline;
  text-decoration-thickness: var(--link-underline);
  text-underline-offset: var(--link-underline-offset);
}
[data-cd-theme] .sl-footer a:is(:hover, :focus-visible) { text-decoration-thickness: var(--link-underline-hover); }
@media (max-width: 479.98px) {
  [data-cd-theme] .sl-footer__links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-4);
  }
}
@media (max-width: 359.98px) {
  [data-cd-theme] .sl-footer__links { grid-template-columns: minmax(0, 1fr); }
}

/* --- 12 Error and maintenance pages, modal ------------------------------------- */
[data-cd-theme] body.sl-error-page {
  background-color: var(--color-ui-bg);
  font-family: var(--font-sans);
}
[data-cd-theme] .sl-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-block-start: var(--space-5);
  padding: var(--space-5);
  border: var(--border-width) solid var(--color-ui-line);
  border-radius: var(--radius-md);
  background-color: var(--color-bg);
}
[data-cd-theme] .sl-card > * { margin: 0; }
[data-cd-theme] .sl-error__title {
  font-size: var(--text-h1);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  overflow-wrap: break-word;
}
[data-cd-theme] .sl-error__lead {
  font-size: var(--text-body-lg);
  line-height: var(--leading-snug);
}
[data-cd-theme] .sl-card pre {
  max-inline-size: 100%;
  overflow-x: auto;
  font-size: var(--text-small);
}
@media (max-width: 479.98px) {
  [data-cd-theme] .sl-card { padding: var(--space-4); }
}

/* the dialog: an overlay (white; the raised layer in the dark, D118), the darker backdrop of
   tokens.css */
[data-cd-theme] .modal-content {
  --bs-modal-border-radius: var(--radius-md);
  --bs-modal-border-color: var(--color-ui-line);
  --bs-modal-color: var(--color-text);
  --bs-modal-bg: var(--color-ui-overlay);
  border-color: var(--color-ui-line);
  background-color: var(--color-ui-overlay);
  color: var(--color-text);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-overlay);
  text-align: start;
}
[data-cd-theme] .modal-header { gap: var(--space-4); }
/* LimeSurvey's alert box has no title: the close button only, no rule under an empty header */
[data-cd-theme] .modal-header:has(.modal-title:empty) {
  padding-block-end: 0;
  border-block-end: 0;
}
[data-cd-theme] .btn-close {
  inline-size: var(--target-min);
  block-size: var(--target-min);
  padding: 0;
  background: transparent var(--sl-close-icon) center / var(--space-5) var(--space-5) no-repeat;
  opacity: 1;
}

/* --- 13 Public survey list (layout_survey_list.twig) ------------------------------ */
/* One framed card per survey, the whole card the link: title Bold black, arrow in the link
   colour; hover: border strong and the title underlined (web.md §0.2 B5–B6, D96) */
[data-cd-theme] .sl-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-block-start: var(--space-5);
}
[data-cd-theme] .sl-list > * { margin: 0; }
[data-cd-theme] .sl-list__lead { font-size: var(--text-body-lg); }
[data-cd-theme] .sl-list__items {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}
[data-cd-theme] .sl-list__items > li { margin: 0; }
[data-cd-theme] a.sl-card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-block-size: var(--target-min);
  padding: var(--space-5);
  border: var(--border-width) solid var(--color-ui-line);
  border-radius: var(--radius-md);
  background-color: var(--color-bg);
  color: var(--color-text);
  text-decoration: none;
}
[data-cd-theme] .sl-card-link__title {
  font-size: var(--text-body-lg);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
}
[data-cd-theme] .sl-card-link__arrow {
  flex: none;
  color: var(--color-link);
  transition: transform var(--duration-fast) ease;
}
[data-cd-theme] a.sl-card-link:hover { border-color: var(--color-ui-line-strong); }
[data-cd-theme] a.sl-card-link:is(:hover, :focus-visible) .sl-card-link__title {
  text-decoration-line: underline;
  text-decoration-thickness: var(--link-underline);
  text-underline-offset: var(--link-underline-offset);
}
[data-cd-theme] a.sl-card-link:is(:hover, :focus-visible) .sl-card-link__arrow { transform: translateX(var(--button-icon-shift)); }
@media (prefers-reduced-motion: reduce) {
  [data-cd-theme] .sl-card-link__arrow { transition: none; }
  [data-cd-theme] a.sl-card-link:is(:hover, :focus-visible) .sl-card-link__arrow { transform: none; }
}
@media (max-width: 479.98px) {
  [data-cd-theme] a.sl-card-link { padding: var(--space-4); }
}

/* --- 14 Save, load, register, access code, clear-all, end page ----------------- */
/* One column like the question pages: Bootstrap's centred 8-of-12 columns and their
   offsets go, every form starts on the column edge (D89). */
[data-cd-theme] :is(.save-form, .load-form, .register-container, .register-form, .token-page) :is([class*="col-lg-"], [class*="offset-"]) {
  flex: none;
  inline-size: auto;
  max-inline-size: 100%;
  margin-inline: 0;
  padding-inline: 0;
}
[data-cd-theme] :is(.register-container, .register-form, .token-page) :is(.container, .container-fluid) {
  max-inline-size: none;
  margin-inline: 0;
  padding-inline: 0;
}
[data-cd-theme] :is(.register-container, .register-form) .row {
  --bs-gutter-x: 0;
  margin-inline: 0;
}
[data-cd-theme] :is(.register-container, .token-page, .save-form, .load-form, .completed-wrapper) {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
}
[data-cd-theme] :is(.register-container, .token-page) > :empty { display: none; }

/* One pattern for the four forms (save, load, registration, access code): heading and intro
   on the grey page like a group intro, the fields with their submit in one white card like a
   question card. Bootstrap's grey intro box (.card.bg-light) loses its frame; on the access
   code page LimeSurvey nests the form inside that box, so its .form-token becomes the card. */
[data-cd-theme] :is(.save-message, .register-jumbotron, .token-page > .card) {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: 0 !important;                /* check-style: ignore — beats Bootstrap's !important .mb-3 */
  padding: 0 !important;               /* check-style: ignore — beats LimeSurvey's !important .p-6 */
  border: 0;
  border-radius: 0;
  background-color: transparent !important;   /* check-style: ignore — beats Bootstrap's !important .bg-light */
  color: var(--color-text);
}
[data-cd-theme] .token-page > .card { gap: var(--space-5); }
[data-cd-theme] :is(.save-message, .register-jumbotron, .token-page > .card) > :is(.card-body, .container) {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: 0;
}
[data-cd-theme] :is(.save-message, .register-jumbotron, .token-page > .card) :is(p, .text-info, .text-warning) { margin: 0; }
[data-cd-theme] :is(.save-message, .register-jumbotron) :is(.text-info, .text-warning) {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
[data-cd-theme] .register-jumbotron .row.h2 {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-body);
}
[data-cd-theme] .register-jumbotron .row.h2 > * { margin: 0; padding: 0; }
/* the card: white, 1 px line, 8 px corners, padding 24 (16 below 480 px), as .question-container */
html[data-cd-theme] :is(.save-form, .load-form) .save-survey-form,
html[data-cd-theme] .register-form form > div:not(.register-form-column-additions),
html[data-cd-theme] .token-page .form-token {
  --sl-card-pad: var(--space-5);
  padding: var(--sl-card-pad);
  border: var(--border-width) solid var(--color-ui-line);
  border-radius: var(--radius-md);
  background-color: var(--color-bg);
  color: var(--color-text);
}
@media (max-width: 479.98px) {
  html[data-cd-theme] :is(.save-form, .load-form) .save-survey-form,
  html[data-cd-theme] .register-form form > div:not(.register-form-column-additions),
  html[data-cd-theme] .token-page .form-token { --sl-card-pad: var(--space-4); }
}
[data-cd-theme] .register-form .register-form-column-additions:not(:has(*)) { display: none; }

/* Section headings under the page's h1 (the survey name): h2 role, 26 Medium (D88) */
[data-cd-theme] #main-col :is(.save-message h2, .register-jumbotron h2, .token-page > .h2, [role="heading"][aria-level="2"]:not(.assessment-heading)) {
  margin: 0;
  font-size: var(--text-h2);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
}

/* Fields: label 16 Medium above the field, 24 px to the next label (D99) */
[data-cd-theme] :is(.save-survey-form, .register-form, .form-token) {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
[data-cd-theme] :is(.save-survey-form, .register-form form > div, .form-token form > div) {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
[data-cd-theme] :is(.save-survey-form, .register-form form > div, .form-token form > div) > * {
  inline-size: auto;
  max-inline-size: 100%;
  margin: 0 !important;                /* check-style: ignore — beats Bootstrap's !important .mb-3 / .mb-2 on every row */
}
[data-cd-theme] :is(.save-survey-form, .register-form, .form-token) :is(.mb-3, .row) {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
[data-cd-theme] :is(.save-survey-form, .register-form, .form-token) label.control-label {
  inline-size: auto;
  max-inline-size: 100%;
  margin: 0;
  padding: 0;
  font-size: var(--text-ui);
  font-weight: var(--weight-medium);
}
/* the required mark: one convention on every form, "Label: *" — the star after the label
   text, black, Bold, at the label's size (D99). LimeSurvey writes a FontAwesome star before
   the text on the access-code form and after it elsewhere (with .float-start, which pulls it
   to the start): the icon goes, the label draws the star. Screen readers get LimeSurvey's own
   visually hidden "(Zwingend notwendig)"; the drawn star has empty alternative text. */
[data-cd-theme] :is(.save-survey-form, .register-form, .form-token) label .asterisk.fa { display: none; }
[data-cd-theme] :is(.save-survey-form, .register-form, .form-token) label:has(.asterisk.fa)::after {
  content: "*";
  content: "*" / "";
  margin-inline-start: var(--space-1);
  color: var(--color-text);
  font-weight: var(--weight-bold);
}
/* the "fields marked with * are mandatory" note: first in the card, muted meta text, on every
   form (registration writes it, aria-hidden and without a class, after the fields) */
[data-cd-theme] :is(.save-survey-form, .form-token) > span.large,
[data-cd-theme] .register-form [class*="mandatory"],
[data-cd-theme] .register-form form > div > div[aria-hidden="true"]:not(:has(*)) {
  color: var(--color-text-muted);
  font-size: var(--text-meta);
}
[data-cd-theme] .register-form form > div > div[aria-hidden="true"]:not(:has(*)) { order: -1; }
/* the submit row: the button on the column's end edge, as "Weiter"; "Zur Umfrage
   zurückkehren" as a link on its own row below */
[data-cd-theme] :is(.save-survey-submit, .load-survey-submit, .register-form form > div > div:has(> .float-end)) {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
}
[data-cd-theme] :is(.save-survey-submit, .load-survey-submit, .register-form form > div > div:has(> .float-end)) > .float-end {
  float: none !important;              /* check-style: ignore — beats Bootstrap's !important .float-end; the flex row places the button */
}
@media (max-width: 639.98px) {
  /* phones: the lone forward action on the left edge, as "Weiter" (D98) */
  [data-cd-theme] :is(.save-survey-submit, .load-survey-submit, .register-form form > div > div:has(> .float-end)) { justify-content: flex-start; }
}
[data-cd-theme] :is(.return-to-survey, .load-form > form > div:last-child) .url-wrapper a,
[data-cd-theme] .url-wrapper-survey-return a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-min);
}
/* the in-page language form duplicates the header's "Sprache" tool: shown only where the
   header has none (and as LimeSurvey's no-JavaScript fallback) */
[data-cd-theme]:has(#navbar .form-change-lang) #outerframeContainer .form-change-lang:not(.ls-js-hidden *),
[data-cd-theme]:has(#navbar .form-change-lang) #outerframeContainer form:has(> .form-change-lang):not(.ls-js-hidden *),
[data-cd-theme]:has(#navbar .form-change-lang) #outerframeContainer .ls-no-js-hidden:has(> .form-change-lang) {
  display: none !important;            /* check-style: ignore — the register head's wrapper carries Bootstrap's !important .d-flex */
}
/* LimeSurvey's register head wraps nothing in a ".row.h2" (the h2 follows it) */
[data-cd-theme] .register-jumbotron .card-body > .row.h2:not(:has(*)) { display: none; }

/* Clear-all: "Antworten gelöscht" (h2 role) and the restart link */
[data-cd-theme] #main-col div:has(> p[role="heading"]) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
}
[data-cd-theme] #main-col div:has(> p[role="heading"]) > a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-min);
}

/* End page: the assessment is a white card with an h2-role heading and plain rows, not
   Bootstrap's bordered table (web.md §0.2 C) */
[data-cd-theme] .completed-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
}
[data-cd-theme] .completed-text > * { margin: 0; }
[data-cd-theme] .completed-text > :is(p, div) { margin: 0; }
[data-cd-theme] .assessment-table {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-self: stretch;
  padding: var(--space-5);
  border: var(--border-width) solid var(--color-ui-line) !important;   /* check-style: ignore — LimeSurvey's .border is Bootstrap's !important utility */
  border-radius: var(--radius-md);
  background-color: var(--color-bg);
}
@media (max-width: 479.98px) {
  [data-cd-theme] .assessment-table { padding: var(--space-4); }
}
[data-cd-theme] .assessment-table :is(.border, .border-top, .assessment-heading, .assessments-container, .assessments, .assessments > div) {
  padding: 0 !important;               /* check-style: ignore — beats Bootstrap's !important .p-2 */
  border: 0 !important;                /* check-style: ignore — beats Bootstrap's !important .border / .border-top */
  text-align: start;
}
[data-cd-theme] .assessment-table .assessment-heading {
  font-size: var(--text-h2);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
}
[data-cd-theme] .assessment-table :is(.assessments-container, .assessments) {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
[data-cd-theme] .assessment-table .assessments > .fw-bold {
  font-size: var(--text-body-lg);
  font-weight: var(--weight-medium) !important;   /* check-style: ignore — beats Bootstrap's !important .fw-bold: headings are Medium (D88) */
  line-height: var(--leading-snug);
}
/* Bootstrap's .clearfix::after would be a flex item of these flex boxes (an empty gap) */
[data-cd-theme] :is(.save-message, .register-jumbotron, .token-page > .card, .card-body, .completed-text).clearfix::after { display: none; }
/* the end page's links (print answers, statistics, the survey's end URL): 44 px rows that
   follow each other without the paragraph gap */
[data-cd-theme] .completed-text > :is(.url-wrapper, a) + :is(.url-wrapper, a) { margin-block-start: calc(-1 * var(--space-4)); }
[data-cd-theme] #form-load {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
