/* ==========================================================================
   Die Linke im Bundestag – LimeSurvey-Theme (Basis: Fruity TwentyThree)
   ========================================================================== */

/*
 * Dieses Stylesheet gestaltet das Fruity-TwentyThree-Theme, ohne die von
 * LimeSurvey erzeugte HTML-Struktur zu ersetzen. Viele Selektoren beziehen
 * sich daher auf LimeSurvey-Klassen wie .question-container und
 * .answer-container sowie auf Bootstrap-Komponenten.
 *
 * Anpassungshinweise:
 * - Farben, Schriftfamilien, Radien und Standardmaße zuerst in :root ändern.
 * - Die folgenden Abschnitte sind nach sichtbaren Bereichen und Fragetypen
 *   geordnet; mobile und reduzierte Animationen stehen bei den jeweiligen
 *   Layoutregeln.
 * - Einzelne !important-Deklarationen setzen hoch priorisierte Fruity- oder
 *   Bootstrap-Standardregeln außer Kraft.
 */


/* 1) Design-Tokens ======================================================= */
:root {
  color-scheme: light;

  /* Markenfarben und neutrale Flächen: Rot für Akzente, Dunkelrot für
     Links, Bedienelemente und Aktionen; Text bleibt nahezu schwarz. */
  --lf-red: #FF0000;
  --lf-darkred: #6F003C;
  --lf-ink: #1E1E1E;
  --lf-gray: #4A4A4A;
  --lf-line: #E5E5E5;
  --lf-bg: #FFFFFF;
  --lf-surface: #FFFFFF;
  --lf-subtle: #F6F6F6;
  --lf-placeholder: #6B6B6B;
  --lf-control-border: #747474;
  --lf-control-hover-bg: #F7F2F4;
  --lf-control-selected-bg: #F6E8EF;
  --lf-control-selected-border: var(--lf-darkred);
  --lf-error: #B42318;
  --lf-error-bg: #FEF3F2;

  /* Gemeinsame Farben für Links, Fokus, Interaktion und Fortschritt.
     Hover- und Auswahlzustände bleiben von der Grundpalette abgeleitet. */
  --lf-link: var(--lf-darkred);
  --lf-link-hover: #4A0027;
  --lf-control: var(--lf-darkred);
  --lf-btn-bg: var(--lf-darkred);
  --lf-btn-bg-hover: #4A0027;
  --lf-btn-text: #FFFFFF;
  --lf-focus: var(--lf-red);
  --lf-progress: var(--lf-red);

  /* Wiederverwendbare Maße für Karten, Lesespalte und Eingaben. */
  --lf-radius: 10px;
  --lf-container-width: 58rem;
  --lf-copy-width: 48rem;
  --lf-control-height: 3.2rem;
  --lf-choice-height: 3.4rem;

  /* Inter für Fließtext und Bedienelemente; Work Sans für Überschriften. */
  --lf-font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --lf-font-head: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Bootstrap-Variablen auf die Theme-Tokens abbilden, damit auch
     unveränderte Bootstrap-Komponenten dieselbe Farb- und Schriftbasis nutzen. */
  --bs-body-font-family: var(--lf-font-body);
  --bs-body-color: var(--lf-ink);
  --bs-body-bg: var(--lf-bg);
  --bs-primary: var(--lf-darkred);
  --bs-primary-rgb: 111, 0, 60;
  --bs-link-color: var(--lf-link);
  --bs-link-hover-color: var(--lf-link-hover);
  --bs-border-color: var(--lf-line);
  --bs-border-radius: var(--lf-radius);
}

/* 2) Typografie ========================================================== */
/* Body-Selektoren schließen Formular- und Menütexte ein, deren Schrift
   Fruity teilweise direkt an Komponenten statt am body definiert. */
body,
body p, body li, body td, body th, body label, body a,
body input, body select, body textarea, body button,
body .btn, body .dropdown-menu, body .form-control, body .form-select {
  font-family: var(--lf-font-body) !important;
}

body {
  font-weight: 400;
  color: var(--lf-ink);
  background-color: var(--lf-subtle);
  -webkit-font-smoothing: antialiased;
}

/* Fließtext bleibt 400, auch wenn ein Wrapper-Element ein kräftigeres
   Schriftgewicht vererbt. :where() hält die Selektorspezifität gering. */
:where(p, li, dd, blockquote) { font-weight: 400; }

/* Überschriften behalten Work Sans Black unabhängig davon, ob LimeSurvey
   ein semantisches h-Element oder eine Theme-Klasse rendert. */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.large-heading, .survey-name, .group-title, .group-name,
.completed-wrapper .completed-heading,
.quotamessage,
.public-stats .statsSurveyTitle {
  font-family: var(--lf-font-head) !important;
  font-weight: 900 !important;                  /* Work Sans Black */
  text-transform: none !important;
  letter-spacing: 0;
  color: var(--lf-ink);
}

/* Responsive Typografieskala. clamp() begrenzt die Größe zwischen einem
   gut lesbaren Minimum und Maximum; die Werte dazwischen wachsen mit dem Viewport. */
h1, .h1 { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem); line-height: 1.15; }
h2, .h2 { font-size: clamp(1.4rem, 1.2rem + 0.7vw, 1.9rem);  line-height: 1.2; }
h3, .h3 { font-size: 1.3rem;  line-height: 1.25; }
h4, .h4 { font-size: 1.15rem; line-height: 1.3; }
h5, .h5, h6, .h6 { font-size: 1rem; line-height: 1.4; }
.large-heading { font-size: clamp(2rem, 1.5rem + 2vw, 2.85rem); line-height: 1.1; }

.completed-wrapper .completed-heading,
.public-stats .statsSurveyTitle {
  font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem);
  line-height: 1.15;
  margin: 0 0 1rem;
}
.quotamessage { font-size: 1.5rem; line-height: 1.25; }

/* Ein gemeinsames Lesemaß verhindert überlange Zeilen bei Survey-Titel,
   Einführung, Gruppentexten und Beschreibung. */
.survey-name, .survey-welcome, .group-container,
.group-description, .survey-description, .survey-question-help {
  width: 100%;
  max-width: var(--lf-copy-width);
  margin-inline: auto;
  box-sizing: border-box;
}
.survey-name {
  margin-bottom: 2rem;
  font-size: clamp(2rem, 1.2rem + 2.8vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -.04em;
}
.survey-welcome { margin-bottom: 2rem; line-height: 1.7; }
.group-container { padding-inline: 0; }
.group-title, .group-name {
  width: 100%;
  margin: 0 0 2.25rem;
  font-size: clamp(1.7rem, 1.25rem + 1.5vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -.025em;
  box-sizing: border-box;
}
/* LimeSurvey rendert die Beschreibung je nach View entweder mit beiden
   Klassen am selben Element oder mit .form-heading als Kindelement. Beide
   Varianten werden auf die Lesespalte begrenzt und horizontal zentriert. */
.survey-description { width: 100%; }
.survey-description.form-heading,
.survey-description .form-heading {
  width: 100% !important;
  max-width: var(--lf-copy-width);
  margin-inline: auto !important;
  box-sizing: border-box;
}

.completed-wrapper .completed-Content { color: var(--lf-ink); }

/* Überschriften und Labels dürfen stärker sein; Inter wird maximal mit 600
   verwendet, während Fließtext und Optionen normalgewichtig bleiben. */
strong, b, th, label, .form-label, .control-label { font-weight: 600 !important; }  /* Inter max. 600 */
label, .control-label, dl, dl dt { color: var(--lf-ink); }

.text-muted, .help-block, .ls-question-help, .form-text { color: var(--lf-gray) !important; }
.ls-answers th, .ls-answers .ls-heading th { color: var(--lf-gray); }

/* Links sind unterstrichen, damit sie auch ohne Farbe als Links erkennbar sind. */
a {
  color: var(--lf-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
a:hover, a:focus { color: var(--lf-link-hover); }
.btn-link, .link-primary { color: var(--lf-link) !important; }
.btn-link:hover, .btn-link:focus { color: var(--lf-link-hover) !important; }

/* Deutlicher Tastaturfokus für interaktive Elemente. */
:focus-visible {
  outline: 3px solid var(--lf-focus) !important;
  outline-offset: 2px;
}


/* 3) Layout ============================================================== */
/* Seitenlayout: Fruity behält die Abstände einzelner Fragen; hier werden
   Dokumenthöhe, allgemeine Surveybreite und der äußere Seitenabstand gesetzt. */
html { scroll-behavior: smooth; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 0;
}
body > article, body > main, body > .outerframe { flex: 1; }
body:not(.error-page) { padding-top: 5rem; }
body:not(.error-page) .outerframe,
body:not(.error-page) .survey-container,
body:not(.error-page) #survey-content {
  width: min(100% - 2rem, var(--lf-container-width));
  max-width: var(--lf-container-width);
  margin-inline: auto;
}
/* Eigene Maximalbreite statt der wechselnden Bootstrap-Containerbreiten.
   So bleibt die Surveyfläche auf großen Viewports genauso breit wie auf
   mittleren; ein schmaler Seitenrand bleibt auf kleinen Geräten erhalten. */
body:not(.error-page) .outerframe { padding-block: clamp(2.5rem, 8vh, 6rem) 4rem; }
/* Die Container innerhalb des äußeren Rahmens dürfen dessen Breite nicht
   erneut anhand der Bootstrap-Breakpoints verkleinern. */
body:not(.error-page) .outerframe > .container,
body:not(.error-page) .outerframe > .container-md,
body:not(.error-page) .outerframe > .container-fluid,
body:not(.error-page) .outerframe .container-md,
body:not(.error-page) .container,
body:not(.error-page) .container-fluid {
  width: 100%;
  max-width: 100%;
}


/* 4) Header / Logo ======================================================= */
/* Headerfläche und Logo: die Höhe des Logos wird hier zentral festgelegt;
   .lf-logo bleibt für separat gerenderte Logos verfügbar. */
.navbar {
  background: var(--lf-bg) !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}
.navbar-brand img, .navbar-brand svg, .logo-container .logo {
  height: 4rem;
  max-height: none;
  width: auto;
}

#survey-nav .navbar-toggler .ri-more-fill { color: var(--lf-gray); }
.navbar-toggle { border-color: var(--lf-line) !important; }
.navbar-toggle .icon-bar { background-color: var(--lf-gray) !important; }

.ls-logo { display: block; max-height: 4rem; width: auto; margin: 2rem auto; }

.lf-header-progress .ls-progress-container { height: 100%; }
.lf-header-progress .ls-progress-container:focus-visible { outline-offset: 0; }

/* Schmale Navigationsleiste mit fest positionierter Fortschrittslinie.
   Die Höhe der Linie orientiert sich an der Desktop-Navigationsleiste und
   wird im mobilen Breakpoint weiter unten angepasst. */
#survey-nav {
  min-height: 4.25rem;
  padding: .55rem clamp(1rem, 4vw, 3rem);
  background: var(--lf-bg) !important;
  border-bottom: 1px solid var(--lf-line) !important;
}
#survey-nav > .container-fluid { max-width: 76rem; }
#survey-nav .navbar-brand { margin: 0; padding: .25rem 0; }
#navbar-toggler {
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--lf-line);
  border-radius: 50%;
  color: var(--lf-ink);
  background: var(--lf-bg);
}
#navbar-toggler:hover { border-color: var(--lf-control); color: var(--lf-control); }

.lf-header-progress {
  position: fixed;
  z-index: 1031;
  inset: 4.2rem 0 auto;
  height: 4px;
  background: var(--lf-line);
}
.lf-header-progress .progress {
  height: 4px;
  overflow: visible;
  background: transparent;
  border-radius: 0;
}
.lf-header-progress .progress-bar {
  border-radius: 0 999px 999px 0;
  transition: width .45s cubic-bezier(.2,.75,.25,1);
}


/* 5) Buttons ============================================================= */
/* Gemeinsame Rundung und kurze Farbübergänge für Schaltflächen und Felder. */
.btn { border-radius: var(--lf-radius); font-weight: 600 !important; }
.btn, .form-control, .form-select, .bootstrap-select > .dropdown-toggle {
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

/* Bootstrap-Schatten nicht zusätzlich zum eigenen Fokus- und Zustandsstil
   anzeigen. Der sichtbare Tastaturfokus kommt über :focus-visible oben. */
.btn:hover, .btn:focus, .btn:active, .btn.active,
.btn-check:focus + .btn, .btn-check:checked + .btn:focus {
  box-shadow: none !important;
}

/* Primäre Survey-Aktionen wie „Weiter“ oder „Absenden“: gefüllte Pillenform,
   dunklerer Hoverzustand und klar entsättigtes deaktiviertes Aussehen. */
.btn-primary {
  background-color: var(--lf-btn-bg) !important;
  border-color: var(--lf-btn-bg) !important;
  color: var(--lf-btn-text) !important;
  min-height: 3rem;
  padding: .7rem 1.35rem;
  border-radius: 999px !important;
  box-shadow: 0 3px 10px rgb(111 0 60 / .16);
  transition: box-shadow .15s ease, background-color .15s ease;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active {
  background-color: var(--lf-btn-bg-hover) !important;
  border-color: var(--lf-btn-bg-hover) !important;
  color: var(--lf-btn-text) !important;
}
.btn-primary:disabled, .btn-primary.disabled {
  background-color: var(--lf-line) !important;
  border-color: var(--lf-line) !important;
  color: var(--lf-gray) !important;
  opacity: 1;
}

/* Sekundäre primäre Aktion: zunächst transparent, beim Aktivieren gefüllt. */
.btn-outline-primary {
  color: var(--lf-link) !important;
  border-color: var(--lf-link) !important;
  background-color: transparent !important;
}
.btn-outline-primary:hover, .btn-outline-primary:focus,
.btn-outline-primary:active, .btn-outline-primary.active {
  background-color: var(--lf-btn-bg) !important;
  border-color: var(--lf-btn-bg) !important;
  color: var(--lf-btn-text) !important;
}

/* Weniger wichtige Aktionen behalten einen neutralen Rahmen. */
.btn-outline-secondary, .btn-secondary, .btn-default {
  background-color: transparent;
  color: var(--lf-ink);
  border: 1px solid var(--lf-ink);
}
.btn-outline-secondary:hover, .btn-outline-secondary:focus,
.btn-secondary:hover, .btn-default:hover {
  background-color: transparent;
  border-color: var(--lf-link);
  color: var(--lf-link);
}

/* Umschalt-Buttons, etwa Ja/Nein- oder Geschlechtsantworten:
   unchecked = neutraler Rahmen, checked = Markenfarbe mit weißem Text. */
.btn-check:not(:checked) + .btn-primary,
.btn-check:not(:checked) + .btn {
  background-color: transparent !important;
  border: 1px solid var(--lf-control-border) !important;
  color: var(--lf-ink) !important;
}
.btn-check:not(:checked) + .btn:hover {
  border-color: var(--lf-link) !important;
  color: var(--lf-link) !important;
}
.btn-check:checked + .btn,
.btn-check:checked + .btn-primary,
.btn-check:active + .btn-primary,
.btn-check:checked .btn-primary {
  background-color: var(--lf-control) !important;
  border: 1px solid var(--lf-control) !important;
  color: var(--lf-btn-text) !important;
}

.btn:disabled, .btn.disabled,
.btn-check:disabled + .btn {
  cursor: not-allowed;
}


/* 6) Formularfelder ====================================================== */
/* Text-, Zahlen- und native Select-Felder teilen dieselbe Höhe, Innenabstände,
   Grundfarbe und Rundung. Die Varianten für Spezialfelder folgen weiter unten. */
.form-control, .form-select {
  min-height: var(--lf-control-height);
  padding: .75rem 1rem;
  background-color: var(--lf-surface);
  color: var(--lf-ink);
  border: 1px solid var(--lf-control-border);
  border-radius: var(--lf-radius);
}
/* Interaktionszustände: Hover hebt den Rahmen hervor, Fokus verwendet den
   roten Markenindikator, disabled und readonly erhalten eine ruhige Fläche. */
.form-control:hover:not(:disabled):not([readonly]),
.form-select:hover:not(:disabled) {
  border-color: var(--lf-link);
}
.form-control:focus, .form-select:focus {
  background-color: var(--lf-surface);
  color: var(--lf-ink);
  border-color: var(--lf-focus) !important;
  box-shadow: none !important;
}
.form-control::placeholder { color: var(--lf-placeholder) !important; }
.form-control:disabled, .form-select:disabled {
  background-color: var(--lf-subtle) !important;
  color: var(--lf-gray) !important;
  border-color: var(--lf-line) !important;
  cursor: not-allowed;
}
.form-control[readonly] {
  background-color: var(--lf-subtle) !important;
  color: var(--lf-gray) !important;
  border-color: var(--lf-line) !important;
  cursor: text;
}
/* LimeSurvey markiert Pflichtfelder teils mit einer eigenen Klasse. */
.form-control.ls-important-field {
  border-color: var(--lf-ink) !important;
  box-shadow: none !important;
}
/* Anhänge wie Einheiten oder Symbole bleiben visuell Teil der Eingabegruppe. */
.input-group-text, label .input-group-text, .input-group-addon {
  background-color: var(--lf-subtle) !important;
  color: var(--lf-ink) !important;
  border-color: var(--lf-gray) !important;
}
.form-change-lang #language-changer-select,
.form-change-lang #lang-select::after { color: var(--lf-link) !important; }

/* Optionstexte einfacher HTML-Selects erhalten lesbare Farben, soweit der
   Browser die native Dropdown-Darstellung über CSS steuern lässt. */
select option { color: var(--lf-ink); background-color: var(--lf-surface); }


/* 6b) bootstrap-select (Dropdown-Fragen) ================================ */
/* LimeSurvey ersetzt viele Selects durch bootstrap-select. Der äußere Wrapper
   bleibt transparent; die sichtbare Schaltfläche übernimmt die Feldgestaltung. */
.bootstrap-select,
.bootstrap-select.form-control { max-width: 100%; }
.bootstrap-select.form-control {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

/* Feste Höhe und Flex-Ausrichtung halten den ausgewählten Text vertikal mittig.
   Die festgelegte Höhe verhindert, dass der Button nach einer Auswahl wächst. */
.bootstrap-select > .dropdown-toggle,
.bootstrap-select > .dropdown-toggle.btn-light {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  height: var(--lf-control-height);
  min-height: var(--lf-control-height);
  padding: .5rem 1rem;
  line-height: 1.25;
  background-color: var(--lf-surface) !important;
  color: var(--lf-ink) !important;
  border: 1px solid var(--lf-control-border) !important;
  border-radius: var(--lf-radius);
  font-weight: 400;
}
/* Bootstrap-select verschachtelt den Anzeigetext in mehreren Wrappern. Alle
   Ebenen füllen die Buttonhöhe; Flexbox zentriert auch nachträglich eingesetzte
   Optionstexte. Äußere HTML-Absätze verlieren ihre Standardränder. */
.bootstrap-select > .dropdown-toggle .filter-option,
.bootstrap-select > .dropdown-toggle .filter-option-inner {
  display: flex;
  align-items: center;
  height: 100%;
  min-height: 0;
}
.bootstrap-select .filter-option-inner-inner {
  display: flex;
  align-items: center;
  min-height: 100%;
  color: inherit;
  line-height: 1.25;
}
.bootstrap-select .filter-option-inner-inner > * { margin-block: 0 !important; }
/* Menüliste: Hover/Fokus und aktuell ausgewählte Option unterscheiden sich
   durch eine dezente Flächenfarbe und einen schmalen Markenstreifen. */
.bootstrap-select > .dropdown-toggle:hover {
  background-color: var(--lf-control-hover-bg) !important;
  border-color: var(--lf-link) !important;
}
.bootstrap-select.show > .dropdown-toggle,
.bootstrap-select > .dropdown-toggle:focus {
  background-color: var(--lf-surface) !important;
  color: var(--lf-ink) !important;
  border-color: var(--lf-focus) !important;
}
.bootstrap-select > .dropdown-toggle:disabled {
  background-color: var(--lf-subtle) !important;
  color: var(--lf-gray) !important;
  border-color: var(--lf-line) !important;
  cursor: not-allowed;
}
.bootstrap-select .dropdown-menu {
  background-color: var(--lf-surface);
  border: 1px solid var(--lf-line);
  border-radius: var(--lf-radius);
}
.bootstrap-select .dropdown-menu li a { color: var(--lf-ink) !important; }
.bootstrap-select .dropdown-menu li a .text { color: inherit; }
.bootstrap-select .dropdown-menu li a:hover,
.bootstrap-select .dropdown-menu li a:focus,
.bootstrap-select .dropdown-menu li a.active,
.bootstrap-select .dropdown-menu li.active a {
  background-color: var(--lf-control-hover-bg) !important;
  color: var(--lf-ink) !important;
}
.bootstrap-select .dropdown-menu li.selected a,
.bootstrap-select .dropdown-menu li.selected.active a {
  background-color: var(--lf-control-selected-bg) !important;
  color: var(--lf-ink) !important;
  box-shadow: inset 3px 0 0 var(--lf-control-selected-border);
}
.bootstrap-select .dropdown-menu li a.disabled,
.bootstrap-select .dropdown-menu .bs-title-option { color: var(--lf-gray) !important; }


/* 7) Checkbox / Radio / Bildauswahl / Slider ============================ */
/* Fruity zeichnet Checkboxen und Radios teilweise über ::before/::after.
   Diese Regeln ändern nur deren Erscheinungsbild, nicht die Eingabelogik. */
.checkbox-item label::before,
.radio-item label::before,
.privacy .checkbox-item label::before {
  border-color: var(--lf-control-border) !important;
  background-color: var(--lf-surface) !important;
}
.checkbox-item input[type="checkbox"]:checked + label::before,
.radio-item input[type="radio"]:checked + label::before {
  border-color: var(--lf-control) !important;
}
body .answer-item label::after,
.radio-item label::after,
.radio-item input[type="radio"] + label::after,
.radio-item input[type="radio"]:checked + label::after {
  background-color: var(--lf-control) !important;
}
.checkbox-item input[type="checkbox"]:checked + label::after { color: var(--lf-control) !important; }
input[type="checkbox"]:checked::after,
.checkbox input[type="checkbox"]:checked::after {
  background-color: var(--lf-control) !important;
  border-color: var(--lf-control) !important;
}
.radio-item input[type="radio"]:checked + label,
.checkbox-item input[type="checkbox"]:checked + label { color: var(--lf-ink) !important; }
.checkbox-item input[type="checkbox"]:focus-visible + label::before,
.radio-item input[type="radio"]:focus-visible + label::before {
  box-shadow: 0 0 0 3px var(--lf-control-hover-bg), 0 0 0 5px var(--lf-focus) !important;
}
/* In den Karten werden Checkboxenzeichen 18px groß und vertikal zentriert.
   Textabstand = 1rem, genau wie der Abstand des Zeichens vom Kartenrand. */
.question-container .checkbox-item:not(td):not(th):not(.imageselect-listitem) label::before,
.question-container .checkbox-item:not(td):not(th):not(.imageselect-listitem) label::after {
  top: 50%;
  left: 0;
  width: 18px;
  height: 18px;
  margin-left: 0;
  transform: translateY(-50%);
}
.question-container .checkbox-item:not(td):not(th):not(.imageselect-listitem) label {
  padding-left: calc(18px + 1rem);
}
.question-container .checkbox-item:not(td):not(th):not(.imageselect-listitem) label::before {
  border-width: 2px;
}
.question-container .checkbox-item:not(td):not(th):not(.imageselect-listitem) label::after {
  font-size: 15px;
  line-height: 18px;
}

/* Antwortzeilen werden anklickbare Karten. Tabellenzellen und Bildauswahl
   sind ausgenommen, weil sie ihre eigene Geometrie und Zustände verwenden. */
:where(.checkbox-item, .radio-item):not(td):not(th):not(.imageselect-listitem) {
  min-height: var(--lf-choice-height);
  padding: .8rem 1rem;
  border: 1px solid var(--lf-line);
  border-color: var(--lf-control-border);
  border-radius: var(--lf-radius);
  background-color: var(--lf-surface);
  box-shadow: 0 1px 2px rgb(30 30 30 / .04);
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
:where(.checkbox-item, .radio-item):not(td):not(th):not(.imageselect-listitem) label {
  display: block;
  width: 100%;
  margin: 0;
  cursor: pointer;
}
:where(.checkbox-item, .radio-item):not(td):not(th):not(.imageselect-listitem):hover {
  background-color: var(--lf-control-hover-bg);
  border-color: var(--lf-control);
  box-shadow: 0 3px 10px rgb(30 30 30 / .07);
}
:where(.checkbox-item, .radio-item):not(td):not(th):not(.imageselect-listitem):focus-within {
  outline: 3px solid var(--lf-focus);
  outline-offset: 2px;
}
:where(.checkbox-item, .radio-item):not(td):not(th):not(.imageselect-listitem):has(input:checked) {
  background-color: var(--lf-control-selected-bg);
  border-color: var(--lf-control-selected-border);
  box-shadow: inset 0 0 0 1px var(--lf-control-selected-border);
}
:where(.checkbox-item, .radio-item):not(td):not(th):not(.imageselect-listitem):has(input:disabled) {
  background-color: var(--lf-subtle);
  color: var(--lf-gray);
  border-color: var(--lf-line);
}
:where(.checkbox-item, .radio-item):not(td):not(th):not(.imageselect-listitem):has(input:disabled) label { cursor: not-allowed; }
.privacy label, .privacy a { color: var(--lf-link); }

/* Bildauswahl, Slider, Rangfolge und Fortschritt sind spezialisierte Widgets.
   Hier werden nur Markenfarben und Rahmen angepasst; ihre Bedienlogik bleibt
   die des jeweiligen LimeSurvey- oder Bootstrap-Plugins. */
li.imageselect-listitem .imageselect-container input.imageselect-checkbox:checked ~ *,
input.imageselect-checkbox:checked ~ .imageselect-select::before { border-color: var(--lf-control) !important; }
input.imageselect-checkbox:checked ~ .imageselect-select::after { color: var(--lf-control) !important; }

.slider-list .slider .slider-handle,
.slider-list .slider .slider-selection { background-color: var(--lf-control) !important; }
.slider-list .slider .slider-handle.custom::before,
.slider-tick.custom::before,
.slider-list .slider .tooltip .tooltip-inner { color: var(--lf-control) !important; }

.select-sortable-lists:not(.ranking-advanced-style) .ranking-sorted-items .sortable-item,
.ranking-advanced-style .sortable-rank,
.ranking-advanced-style .ranking-advanced-item { border-color: var(--lf-control) !important; }
.ranking-advanced-style .sortable-rank .selector__dragHandle.d-none { color: var(--lf-control) !important; }

.progress { background-color: var(--lf-line); border-radius: var(--lf-radius); height: 0.5rem; }
.progress-bar { background-color: var(--lf-progress) !important; }


/* 7b) Meldungen (ohne Grün/Gelb/Violett) ================================== */
/* Systemmeldungen teilen einen neutralen Rahmen und unterscheiden sich über
   die linke Akzentkante. Erfolgshinweise behalten lesbaren Standardtext. */
.alert, .fruity_twentythree .message-box {
  background: transparent;
  color: var(--lf-ink);
  border: 1px solid var(--lf-line) !important;
  border-left: 4px solid var(--lf-gray) !important;
  border-radius: var(--lf-radius);
}
.alert-danger, .alert-error, .fruity_twentythree .message-box-error {
  border-left-color: var(--lf-error) !important;
}
.alert-warning, .fruity_twentythree .message-box-warning {
  border-left-color: var(--lf-link) !important;
}
.text-danger, .has-error .help-block, .has-error .control-label { color: var(--lf-error) !important; }
.text-success, .text-info, .text-warning,
.has-success .help-block, .has-success .control-label,
.has-success .radio, .has-success .checkbox,
.numeric-multi .ls-group-total .control-label,
.numeric-multi .dynamic-total.text-success { color: var(--lf-ink) !important; }
.has-error .form-control,
.has-error .form-select,
.form-control[aria-invalid="true"],
.form-select[aria-invalid="true"] {
  border-color: var(--lf-error) !important;
  background-color: var(--lf-error-bg);
}
.has-success .form-control, .has-success .form-control:focus {
  box-shadow: none !important;
  border-color: var(--lf-gray) !important;
}
.em-function { color: var(--lf-ink) !important; }

/* Lange Fragetexte, Hilfe- und Beschreibungstexte werden auf eine angenehme
   Zeilenlänge begrenzt. Die Antworttabellen selbst erhalten keine solche Grenze. */
.question-title-container,
.question-text,
.questionhelp,
.ls-question-help,
.form-text {
  max-width: 72ch;
}
.question-text { line-height: 1.5; }
.questionhelp, .ls-question-help, .form-text { line-height: 1.45; }

label, .form-label, .control-label { line-height: 1.4; }


/* 8) Fragetypen ========================================================== */
/* Gemeinsame Grundregeln für Fragen: viel Abstand zwischen Fragen, aber keine
   dekorative Außenkarte. So bleibt die Aufmerksamkeit bei der aktuellen Frage
   und deren Antwortmöglichkeiten. */
.question-container {
  margin: 0 0 clamp(2.75rem, 7vh, 5rem);
  padding: 0;
  border: 0;
}
.question-container .question-title-container {
  width: 100%;
  max-width: none;
  margin: 0 0 1.15rem;
  padding-inline: 0;
  box-sizing: border-box;
}
/* Fruity rendert Titel, Hilfe, Validierung und Antworten als Bootstrap-.col-12.
   Deren horizontales Gutter würde Inhalt gegenüber dem Fragetitel einrücken;
   null Innenabstand hält alle direkten Fragebereiche an derselben Kante. */
.question-container > .col-12,
.question-container > .question-title-container,
.question-container > .question-help-container,
.question-container > .question-valid-container,
.question-container > .answer-container {
  padding-inline: 0 !important;
}
/* Fragetitel sind kleiner als Gruppentitel, bleiben aber klar als Überschrift
   erkennbar. max-width begrenzt lange Titel, ohne Antworttabellen zu verengen. */
.question-container .ls-label-question {
  max-width: 44rem;
  font-family: var(--lf-font-head) !important;
  font-size: clamp(1.25rem, 1.05rem + .7vw, 1.75rem);
  font-weight: 800 !important;
  line-height: 1.2;
  letter-spacing: -.025em;
}
.question-container .ls-label-question p {
  font-family: var(--lf-font-head) !important;
  font-size: inherit;
  font-weight: 800 !important;
  line-height: inherit;
}
.question-container .ls-label-question > :last-child { margin-bottom: 0; }
.question-container .question-help-container,
.question-container .question-valid-container {
  max-width: 72ch;
  margin-block: .75rem 1rem;
}
.question-container .question-help-container { color: var(--lf-gray) !important; }
.question-container .asterisk,
.question-container .ls-question-mandatory { color: var(--lf-error) !important; }

/* Einfache Einzel- und Mehrfachauswahl im Button-Stil: das Raster erzeugt
   gleichmäßige Spalten und fällt bei schmalen Viewports automatisch um. */
:is(.list-radio, .multiple-opt) .bootstrap-buttons-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: .65rem;
  margin: 0;
}
:is(.list-radio, .multiple-opt) .bootstrap-buttons-list > li {
  width: auto;
  max-width: none;
  flex: initial;
  padding-inline: 0;
}
:is(.list-radio, .multiple-opt) .bootstrap-buttons-list .form-check { padding: 0; }
:is(.list-radio, .multiple-opt) .bootstrap-buttons-list .btn {
  display: flex;
  min-height: var(--lf-choice-height);
  align-items: center;
  justify-content: center;
  padding: .75rem 1rem;
  line-height: 1.35;
  white-space: normal;
  text-align: center;
}
:is(.list-radio, .multiple-opt) .bootstrap-buttons-list .btn p { margin: 0; }

/* Bei normalen Mehrfachauswahlen bleibt das Checkbox-Zeichen links und die
   Beschriftung daneben vertikal ausgerichtet. */
.multiple-opt .checkbox-item:not(td):not(th):not(.imageselect-listitem) {
  display: flex;
  align-items: center;
}
.multiple-opt .checkbox-item:not(td):not(th):not(.imageselect-listitem) label {
  display: flex;
  align-items: center;
  min-height: 1.5rem;
  line-height: 1.4;
}
.multiple-opt .checkbox-item:not(td):not(th):not(.imageselect-listitem) label p { margin: 0; }

/* Listenoptionen werden untereinander mit konstantem Abstand angeordnet.
   Die Auswahl mit „Sonstiges“-Textfeld erhält eine einzelne gemeinsame Karte;
   die verschachtelte Checkbox-Karte und der innere Feldrahmen werden entfernt. */
.list-radio .answers-list:not(.bootstrap-buttons-list),
.multiple-opt .answers-list,
.multiple-opt-comments .answers-list,
.list-with-comment .answers-list {
  display: grid;
  gap: .5rem;
}
.list-radio .answers-list:not(.bootstrap-buttons-list) > .answer-item,
.multiple-opt .answers-list > .answer-item,
.multiple-opt-comments .answers-list > .answer-item,
.list-with-comment .answers-list > .answer-item {
  margin: 0;
}
.multiple-opt .answers-list > .checkbox-text-item,
.multiple-opt-comments .answers-list > .checkbox-text-item {
  padding: .5rem .75rem;
  border: 1px solid var(--lf-line);
  border-radius: var(--lf-radius);
  background-color: var(--lf-surface);
}
.multiple-opt .answers-list > .answer-item:has(.othertext-item, .other-text-item),
.multiple-opt-comments .answers-list > .answer-item:has(.othertext-item, .other-text-item) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  min-height: var(--lf-choice-height);
  padding: .8rem 1rem;
  border: 1px solid var(--lf-control-border);
  border-radius: var(--lf-radius);
  background-color: var(--lf-surface);
  box-shadow: 0 1px 2px rgb(30 30 30 / .04);
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
/* Hover, Tastaturfokus und Auswahl werden auf der ganzen kombinierten Karte
   angezeigt, nicht nur auf der Checkbox oder dem Textfeld. */
.multiple-opt .answers-list > .answer-item:has(.othertext-item, .other-text-item):hover,
.multiple-opt-comments .answers-list > .answer-item:has(.othertext-item, .other-text-item):hover {
  border-color: var(--lf-control);
  background-color: var(--lf-control-hover-bg);
}
.multiple-opt .answers-list > .answer-item:has(.othertext-item, .other-text-item):focus-within,
.multiple-opt-comments .answers-list > .answer-item:has(.othertext-item, .other-text-item):focus-within {
  outline: 3px solid var(--lf-focus);
  outline-offset: 2px;
}
.multiple-opt .answers-list > .answer-item:has(.othertext-item, .other-text-item):has(input[type="checkbox"]:checked),
.multiple-opt-comments .answers-list > .answer-item:has(.othertext-item, .other-text-item):has(input[type="checkbox"]:checked) {
  border-color: var(--lf-control-selected-border);
  background-color: var(--lf-control-selected-bg);
}
/* Die innere Checkbox ist nur noch Inhalt der gemeinsamen Karte. Das Textfeld
   nimmt den übrigen Platz ein und bleibt randlos, damit kein doppelter Rahmen
   entsteht. */
.multiple-opt .answers-list > .answer-item:has(.othertext-item, .other-text-item) .checkbox-item,
.multiple-opt-comments .answers-list > .answer-item:has(.othertext-item, .other-text-item) .checkbox-item {
  flex: 0 0 auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.multiple-opt .answers-list > .answer-item:has(.othertext-item, .other-text-item) :is(.othertext-item, .other-text-item),
.multiple-opt-comments .answers-list > .answer-item:has(.othertext-item, .other-text-item) :is(.othertext-item, .other-text-item) {
  flex: 1 1 14rem;
  min-width: 0;
}
.multiple-opt .answers-list > .answer-item:has(.othertext-item, .other-text-item) :is(.othertext-item, .other-text-item) .form-control,
.multiple-opt-comments .answers-list > .answer-item:has(.othertext-item, .other-text-item) :is(.othertext-item, .other-text-item) .form-control {
  width: 100%;
  min-width: 0;
  height: 2rem;
  min-height: 2rem;
  padding-block: 0;
  border-color: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  outline: 0 !important;
}
.multiple-opt .othertext-item,
.multiple-opt-comments .othertext-item,
.list-with-comment .othertext-item { max-width: 100%; }
.multiple-opt .other-text-item .form-control,
.multiple-opt-comments .other-text-item .form-control,
.list-with-comment .other-text-item .form-control { width: min(100%, 32rem); }

/* Ja/Nein- und Geschlechtsfragen bleiben kompakte Gruppen statt breiter
   Antwortkarten. */
.yes-no .answer-container,
.gender .answer-container { max-width: 34rem; }
.yes-no .answer-item.btn,
.gender .answer-item.btn { min-width: 7rem; min-height: 2.75rem; }

/* Tabellen- und Matrixfragen: [class*="array-"] deckt die Fruity-Arraytypen
   ab, die 5-Punkt-Auswahl wird separat ergänzt. Kopfzeilen, Antwortzeilen und
   Auswahlzellen behalten eine tabellarische Ausrichtung. */
:is([class*="array-"], .choice-5-pt-radio) table.ls-answers {
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--lf-line);
  border-radius: var(--lf-radius);
}
:is([class*="array-"], .choice-5-pt-radio) table.ls-answers thead th {
  padding: .75rem .5rem;
  background-color: var(--lf-subtle);
  color: var(--lf-ink);
  border-bottom: 1px solid var(--lf-line);
  font-weight: 600;
  vertical-align: middle;
}
:is([class*="array-"], .choice-5-pt-radio) table.ls-answers tbody th {
  padding: .75rem;
  background-color: var(--lf-surface);
  color: var(--lf-ink);
  font-weight: 600;
  text-align: start;
}
:is([class*="array-"], .choice-5-pt-radio) table.ls-answers tbody td {
  padding: .5rem;
  border-bottom: 1px solid var(--lf-line);
  vertical-align: middle;
}
:is([class*="array-"], .choice-5-pt-radio) table.ls-answers tbody tr:last-child > * { border-bottom: 0; }
table.ls-answers td.radio-item,
table.ls-answers td.checkbox-item {
  min-width: 2.75rem;
  padding: .4rem !important;
  text-align: center;
}
table.ls-answers td.radio-item:has(input:checked),
table.ls-answers td.checkbox-item:has(input:checked) {
  background-color: var(--lf-control-selected-bg) !important;
  box-shadow: inset 0 -3px 0 var(--lf-control-selected-border);
}
table.ls-answers td.radio-item:focus-within,
table.ls-answers td.checkbox-item:focus-within {
  outline: 2px solid var(--lf-focus);
  outline-offset: -3px;
}
.question-container .answer-container,
.question-container table.ls-answers { max-width: 100%; }
/* Nur breite Matrix-Antworten dürfen horizontal scrollen. Ein Overflow am
   allgemeinen Antwortcontainer würde Dropdown-Menüs abschneiden. */
:is(.question-container[class*="array-"], .question-container.choice-5-pt-radio) .answer-container,
.question-container :is([class*="array-"], .choice-5-pt-radio) .answer-container { overflow-x: auto; }

/* Rangfolge und Sortierlisten werden als eigenständige Karten dargestellt.
   Verfügbare und sortierte Einträge unterscheiden sich durch Fläche bzw.
   gestrichelten Rahmen; die Drag-Handles behalten ihre Plugin-Funktion. */
.select-sortable-lists .sortable-list,
.ranking-advanced-style .sortable-list { border: 0; }
.select-sortable-lists .ranking-available-items,
.ranking-advanced-style .ranking-advanced-available-items {
  padding: .75rem;
  background-color: var(--lf-subtle);
  border: 1px solid var(--lf-line);
  border-radius: var(--lf-radius);
}
.select-sortable-lists .ranking-sorted-items,
.ranking-advanced-style .ranking-advanced-sorted-items {
  min-height: 8rem;
  padding: .75rem;
  background-color: var(--lf-control-hover-bg);
  border: 1px dashed var(--lf-control-border);
  border-radius: var(--lf-radius);
}
.select-sortable-lists .sortable-item,
.ranking-advanced-style .sortable-item {
  min-height: 2.75rem;
  margin-block: .4rem;
  padding: .65rem .8rem;
  background-color: var(--lf-surface) !important;
  color: var(--lf-ink) !important;
  border: 1px solid var(--lf-control-border) !important;
  border-radius: var(--lf-radius);
  line-height: 1.4;
  cursor: grab;
  transition: background-color .15s ease, border-color .15s ease;
}
.select-sortable-lists .sortable-item:hover,
.ranking-advanced-style .sortable-item:hover {
  background-color: var(--lf-control-hover-bg) !important;
  border-color: var(--lf-link) !important;
}
.select-sortable-lists .ranking-sorted-items .sortable-item,
.ranking-advanced-style .ranking-advanced-sorted-items .sortable-item {
  border-color: var(--lf-control-selected-border) !important;
}
.ranking-advanced-style .sortable-rank {
  min-height: 2.75rem;
  background-color: var(--lf-surface);
  border: 1px solid var(--lf-line) !important;
  border-radius: var(--lf-radius);
}
.ranking-advanced-style .sortable-rank .selector__index_row,
.ranking-advanced-style .sortable-rank .selector__dragHandle,
.ranking-advanced-style .ranking-advanced-sorted-items .selector__index_row,
.ranking-advanced-style .ranking-advanced-sorted-items .selector__dragHandle {
  color: var(--lf-link) !important;
}
.ranking-advanced-style .ranking-advanced-available-items .sortable-rank-subtitle,
.ranking-advanced-style .ranking-advanced-sorted-items .sortable-rank-subtitle {
  color: var(--lf-ink);
  font-weight: 600;
}

/* Numerische Felder bleiben kompakt. Slider erhalten eine klare Spur, einen
   markanten Griff und einen sichtbaren Tastaturfokus. */
.numeric .answer-container .form-control,
.date .answer-container .form-control,
.date-time .answer-container .form-control,
.time .answer-container .form-control { max-width: 18rem; }
.text-short .answer-container input.form-control,
.numeric .answer-container .form-control,
.date .answer-container .form-control,
.date-time .answer-container .form-control,
.time .answer-container .form-control { min-height: var(--lf-choice-height); }
.list-dropdown .answer-container .bootstrap-select { width: min(100%, 38rem); }
.numeric-multi .question-item:not(.slider-item) .form-control { max-width: 18rem; }
.numeric-multi .slider-item { max-width: var(--lf-copy-width); }
.numeric-multi .slider .slider-track,
.slider-list .slider .slider-track {
  background-color: var(--lf-line) !important;
  border-radius: 999px;
  box-shadow: none;
}
.numeric-multi .slider .slider-selection,
.slider-list .slider .slider-selection {
  background: var(--lf-control) !important;
  box-shadow: none;
}
.numeric-multi .slider .slider-handle:not(.custom),
.slider-list .slider .slider-handle:not(.custom) {
  width: 1.35rem;
  height: 1.35rem;
  background: var(--lf-surface) !important;
  border: 3px solid var(--lf-control) !important;
  box-shadow: 0 1px 4px rgb(0 0 0 / .2);
}
.numeric-multi .slider .slider-handle:focus-visible,
.slider-list .slider .slider-handle:focus-visible {
  outline: 3px solid var(--lf-focus) !important;
  outline-offset: 3px;
}
.numeric-multi .slider .tooltip-inner,
.slider-list .slider .tooltip-inner {
  background-color: var(--lf-darkred);
  color: #fff;
  border-radius: var(--lf-radius);
}
.numeric-multi .slider .tooltip-arrow { border-top-color: var(--lf-darkred); }

/* Kurze und mehrteilige Texteingaben sind begrenzt breit; längere Antworten
   bekommen eine größere Schreibfläche. */
.text-short .answer-container input.form-control,
.multiple-short-txt .answer-container input.form-control,
.multiple-opt-comments .answer-container input.form-control,
.list-with-comment .answer-container input.form-control {
  max-width: 38rem;
}
.text-short .answer-container input.form-control { min-height: var(--lf-choice-height); }
.text-long .answer-container textarea.form-control,
.text-huge .answer-container textarea.form-control {
  width: 100%;
  max-width: var(--lf-copy-width);
  min-height: 11rem;
  line-height: 1.5;
  resize: vertical;
}
/* Unterfragen mit mehreren Eingabefeldern werden durch feine Trennlinien
   strukturiert, ohne jede Zeile als eigene Karte zu rahmen. */
.multiple-short-txt .answer-container .question-item,
.numeric-multi .answer-container .question-item:not(.slider-item) {
  padding-block: .5rem;
  border-bottom: 1px solid var(--lf-line);
}
.multiple-short-txt .answer-container .question-item:last-child,
.numeric-multi .answer-container .question-item:last-child { border-bottom: 0; }
/* Hinweise und reine Textanzeigen heben sich als Informationstafel vom
   interaktiven Fragenbereich ab. Berechnete Werte erhalten eine kleine Fläche. */
.boilerplate .answer-container,
.text-display .answer-container {
  max-width: 72ch;
  padding: 1rem 1.25rem;
  background-color: var(--lf-subtle);
  border-left: 3px solid var(--lf-control-selected-border);
  border-radius: 0 var(--lf-radius) var(--lf-radius) 0;
  line-height: 1.6;
}
.equation .answer-container output,
.equation .answer-container .form-control-plaintext,
.equation .answer-container .form-control-static {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  padding: .5rem .75rem;
  background-color: var(--lf-subtle);
  border: 1px solid var(--lf-line);
  border-radius: var(--lf-radius);
  font-weight: 600;
}

/* Bildauswahl und Uploads bewahren ihre vom Theme erzeugten Inhalte und
   Vorschaubereiche; ergänzt werden nur Kartenrahmen und Markenstil. */
.imageselect-listitem .imageselect-container,
.question-container.image-select .answer-item,
.question-container.multiple-image-select .answer-item {
  border: 1px solid var(--lf-line);
  border-radius: var(--lf-radius);
  background-color: var(--lf-surface);
  transition: border-color .15s ease, background-color .15s ease;
}
.imageselect-listitem:hover .imageselect-container,
.question-container.image-select .answer-item:hover,
.question-container.multiple-image-select .answer-item:hover {
  border-color: var(--lf-link);
  background-color: var(--lf-control-hover-bg);
}
.imageselect-listitem:focus-within .imageselect-container,
.question-container.image-select .answer-item:focus-within,
.question-container.multiple-image-select .answer-item:focus-within {
  outline: 3px solid var(--lf-focus);
  outline-offset: 2px;
}
.imageselect-listitem:has(input:checked) .imageselect-container,
.question-container.image-select .answer-item:has(input:checked),
.question-container.multiple-image-select .answer-item:has(input:checked) {
  border-color: var(--lf-control-selected-border);
  background-color: var(--lf-control-selected-bg);
}
.file-upload .file-preview,
.upload-files .file-preview,
.file-upload .uploadedfiles,
.upload-files .uploadedfiles,
.question-container .file-preview,
.question-container .uploadedfiles {
  padding: .75rem;
  background-color: var(--lf-subtle);
  border: 1px solid var(--lf-line);
  border-radius: var(--lf-radius);
}
.file-upload input[type="file"]::file-selector-button,
.upload-files input[type="file"]::file-selector-button,
.question-container input[type="file"].form-control::file-selector-button {
  margin: -.375rem .75rem -.375rem -.75rem;
  margin-inline-end: .75rem;
  padding: .375rem .75rem;
  color: var(--lf-btn-text);
  background-color: var(--lf-btn-bg);
  border: 0;
  border-radius: var(--lf-radius);
}
.file-upload input[type="file"]::file-selector-button:hover,
.upload-files input[type="file"]::file-selector-button:hover,
.question-container input[type="file"].form-control::file-selector-button:hover { background-color: var(--lf-btn-bg-hover); }

/* Date-/Zeit-Picker erhalten dieselbe Oberfläche wie andere Menüs. Karten- und
   Kartenbrowser-Widgets werden nur außen eingerahmt, damit die Karte selbst
   weiterhin interaktiv bleibt. */
.tempus-dominus-widget {
  background-color: var(--lf-surface) !important;
  color: var(--lf-ink);
  border: 1px solid var(--lf-line);
  border-radius: var(--lf-radius);
  box-shadow: 0 .5rem 1.25rem rgb(0 0 0 / .12);
}
.tempus-dominus-widget .date-container-days div:not(.no-highlight):hover,
.tempus-dominus-widget .date-container-months div:not(.no-highlight):hover,
.tempus-dominus-widget .date-container-years div:not(.no-highlight):hover {
  background-color: var(--lf-control-hover-bg);
  color: var(--lf-ink);
}
.tempus-dominus-widget .active,
.tempus-dominus-widget .date-container-days div.active {
  background-color: var(--lf-btn-bg) !important;
  color: var(--lf-btn-text) !important;
}
.question-container.map .answer-container,
.question-container.map-browsing .answer-container,
.question-container.browser-detection .answer-container {
  overflow: hidden;
  border: 1px solid var(--lf-line);
  border-radius: var(--lf-radius);
}

@media (prefers-reduced-motion: reduce) {
  /* Systempräferenz respektieren: Scrollen und Zustandswechsel animieren dann
     nicht, ohne die Zustandsfarben oder Fokusmarkierungen zu entfernen. */
  html { scroll-behavior: auto; }
  .btn, .form-control, .form-select, .bootstrap-select > .dropdown-toggle,
  :where(.checkbox-item, .radio-item),
  .select-sortable-lists .sortable-item, .ranking-advanced-style .sortable-item,
  .imageselect-listitem .imageselect-container,
  .multiple-opt .answers-list > .answer-item:has(.othertext-item, .other-text-item),
  .multiple-opt-comments .answers-list > .answer-item:has(.othertext-item, .other-text-item),
  .lf-header-progress .progress-bar {
    transition: none;
  }
}


/* 9) Tabellen, Karten, Menüs, Sonstiges ================================== */
/* Allgemeine Inhaltskomponenten, die nicht zu einem einzelnen Fragetyp
   gehören, erhalten ebenfalls die neutrale Farb- und Rahmenpalette. */
.table { color: var(--lf-ink); border-color: var(--lf-line); }
.ls-even,
.table-hover tbody tr:hover td, .table-hover tbody tr:hover th {
  background-color: var(--lf-subtle) !important;
  color: inherit !important;
}
.numeric-multi .ls-group-total-separator hr { border-color: var(--lf-line) !important; }

/* Bootstrap-Karten behalten ihre Struktur, verlieren aber starke Schatten. */
.fruity_twentythree .welcome .card, .card {
  background-color: var(--lf-surface);
  border: 1px solid var(--lf-line);
  box-shadow: none !important;
  border-radius: var(--lf-radius);
}

/* Überschriften in Verwaltungs- und Übersichtsbereichen nutzen den roten
   Unterstrich als kleinen Markenakzent. */
.fruity_twentythree .side-body h3, .fruity_twentythree .list-surveys h3,
.fruity_twentythree .pagetitle {
  color: var(--lf-ink);
  border-bottom: 2px solid var(--lf-red) !important;
}
.fruity_twentythree .page-header { border-bottom: 1px solid var(--lf-line); }
.fruity_twentythree blockquote { border-left: 4px solid var(--lf-gray); }

/* Dropdowns in Navigation und Formularen verwenden eine gemeinsame Fläche;
   aktivierte oder fokussierte Einträge werden deutlich invertiert dargestellt. */
.dropdown-menu {
  background-color: var(--lf-surface);
  color: var(--lf-ink);
  border: 1px solid var(--lf-line);
  border-radius: var(--lf-radius);
}
#survey-nav .dropdown-menu li a, .dropdown-item { color: var(--lf-ink); }
.dropdown-menu li a:hover, .dropdown-menu li a:focus,
.dropdown-menu .active a, .dropdown-menu .active a:hover,
.dropdown-menu .active a:focus,
#survey-nav .dropdown-menu li a:hover, #survey-nav .dropdown-menu li a:focus,
.dropdown-item:hover, .dropdown-item:focus, .dropdown-item.active {
  background-color: var(--lf-btn-bg) !important;
  color: var(--lf-btn-text) !important;
}
.survey-nav, .ls-questionindex { border-radius: var(--lf-radius); }

/* Aktionsschaltflächen im Datum-/Zeit-Picker verwenden dieselbe Primärfarbe. */
.tempus-dominus-widget button {
  background-color: var(--lf-btn-bg) !important;
  border-color: var(--lf-btn-bg) !important;
  color: var(--lf-btn-text) !important;
}
.success-border { border-color: var(--lf-line) !important; }
.border-primary { border-color: var(--lf-darkred) !important; }
.list-group-item-success { background-color: var(--lf-surface) !important; color: var(--lf-ink) !important; }


/* 10) Footer, Fehlerseite ================================================= */
/* Der Theme-Footer ist ein ruhiger, zentrierter Navigationsbereich. */
.lf-footer {
  border-top: 1px solid var(--lf-line);
  margin-top: 2rem;
  padding: 1.5rem 1rem;
  background: var(--lf-bg);
  color: var(--lf-gray);
  font-size: 0.9rem;
}
.lf-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.lf-footer li + li::before { content: "·"; margin-right: 1.5rem; color: var(--lf-gray); }
.lf-footer a { color: var(--lf-gray); }
.lf-footer a:hover, .lf-footer a:focus { color: var(--lf-link); }

/* Fehlerseiten bekommen unabhängig vom normalen Survey-Hintergrund eine
   schlichte, helle Darstellung mit schmalem Textbereich. */
body.error-page {
  height: auto;
  min-height: 100vh;
  background-color: var(--lf-bg);
}
body.error-page .container { display: block; height: auto; }

.lf-error {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 4rem 1.5rem 2rem;
}


/* Logo und Titel geben Fehlerseiten dieselbe typografische Hierarchie wie der
   Survey, während lange Fehlermeldungen und Tracebacks umbrechen dürfen. */
.error-logo-container { margin-bottom: 2.5rem; }
.error-logo-container .logo { height: 3.5rem; width: auto; max-width: 100%; }

body.error-page .error-title {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: 0;
  margin: 0 0 1.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--lf-red);
  overflow-wrap: anywhere;
}
body.error-page .error-title p { color: var(--lf-ink) !important; }
body.error-page .error-content {
  font-size: 1.14rem;
  line-height: 1.6;
  letter-spacing: 0;
  color: var(--lf-ink);
  margin-bottom: 1.25rem;
}
body.error-page .error-link { font-size: inherit; line-height: inherit; color: var(--lf-link); }
.lf-error .error-trace {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--lf-subtle);
  color: var(--lf-ink);
  border: 1px solid var(--lf-line);
  border-radius: var(--lf-radius);
  padding: 1rem;
  font-size: 0.85rem;
}


/* Umfrageliste (Startseite): Titel und Links werden im mobilen Breakpoint
   gemeinsam mit Header, Fortschrittslinie und Fragenabständen angepasst. */
.lf-survey-list-title { text-align: center; margin: 0 0 1.5rem; }

@media (max-width: 767.98px) {
  /* Kompaktere Navigation und geringere Seitenabstände auf schmalen Geräten;
     die Lesespaltenbreite selbst wird weiter über --lf-container-width begrenzt. */
  body:not(.error-page) { padding-top: 4.5rem; }
  #survey-nav { min-height: 3.8rem; }
  #survey-nav .navbar-brand img { height: 4rem; }
  .lf-header-progress { top: 3.8rem; }
  body:not(.error-page) .outerframe { padding-block: 2.25rem 3rem; }
  .question-container { margin-bottom: 2.75rem; }
  .question-container table.ls-answers { font-size: .9rem; }
  .lf-footer ul { gap: .75rem 1.25rem; }
}
