/* AHO-MGM 1.0.131 — Accessible card legibility and precise spacing.
   A targeted finishing pass on the tested 1.0.130 UI, not a new visual layer.
   Keeps real input elements, names, business logic and selection state unchanged. */

/* Reserve independent, non-overlapping columns for icon, complete label and mark.
   No auto-hyphenation, which caused ugly splits ("Zei-tung", "Sze-ne"). */
html body.page-entry .app-shell .aho-entry-form[data-capture-ui="testing"] label.u128-choice,
html body.page-testing-capture .stat113-form[data-capture-ui="testing"] label.u128-choice {
  display:grid!important;
  grid-template-columns:32px minmax(0,1fr) 20px!important;
  grid-template-rows:auto!important;
  align-items:center!important;
  column-gap:14px!important;
  row-gap:0!important;
  min-width:0!important;
  max-width:100%!important;
  min-height:74px!important;
  height:auto!important;
  padding:15px 16px!important;
  box-sizing:border-box!important;
  overflow:visible!important;
}
html body.page-entry .app-shell .aho-entry-form[data-capture-ui="testing"] label.u128-choice .u125-choice-icon,
html body.page-testing-capture .stat113-form[data-capture-ui="testing"] label.u128-choice .u125-choice-icon {
  grid-column:1!important;
  align-self:center!important;
  margin:0!important;
  flex:0 0 32px!important;
  min-width:32px!important;
}
html body.page-entry .app-shell .aho-entry-form[data-capture-ui="testing"] label.u128-choice .aho73-choice__content,
html body.page-entry .app-shell .aho-entry-form[data-capture-ui="testing"] label.u128-choice .aho73-choice__label,
html body.page-entry .app-shell .aho-entry-form[data-capture-ui="testing"] label.u128-choice .u123-choice-label,
html body.page-testing-capture .stat113-form[data-capture-ui="testing"] label.u128-choice .u123-choice-label {
  grid-column:2!important;
  min-width:0!important;
  max-width:100%!important;
  margin:0!important;
  padding:0!important;
  align-self:center!important;
  font-size:.85rem!important;
  font-weight:760!important;
  line-height:1.45!important;
  letter-spacing:0!important;
  text-wrap:pretty!important;
  white-space:normal!important;
  word-break:normal!important;
  overflow-wrap:anywhere!important;
  hyphens:none!important;
  text-overflow:clip!important;
  overflow:visible!important;
  background:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
}
html body.page-entry .app-shell .aho-entry-form[data-capture-ui="testing"] label.u128-choice .u123-choice-mark,
html body.page-testing-capture .stat113-form[data-capture-ui="testing"] label.u128-choice .u123-choice-mark {
  grid-column:3!important;
  justify-self:end!important;
  align-self:center!important;
  margin:0!important;
  width:20px!important;
  height:20px!important;
  min-width:20px!important;
  box-sizing:border-box!important;
  flex-shrink:0!important;
}

/* Give Beratung option labels room; stop the 5-6-column squeeze on large screens.
   A wider card is preferable to shortened or unnaturally divided wording. */
html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] :is(
  .aho-choice-grid--field-contact_channels,
  .aho-choice-grid--field-occasions,
  .aho-choice-grid--field-target_groups,
  .aho-choice-grid--field-genders,
  .aho-choice-grid--field-orientations,
  .aho-choice-grid--field-referral_sources,
  .aho-choice-grid--field-topics
).u128-choice-grid {
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:12px!important;
  grid-auto-rows:auto!important;
  align-items:stretch!important;
  min-width:0!important;
}
/* Explicitly long selections remain roomy; the label never touches its check. */
html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] :is(
  .aho-choice-grid--field-referral_sources,
  .aho-choice-grid--field-target_groups
) label.u128-choice:is(
  [data-choice-value="professional_referral"],
  [data-choice-value="refugees_migrants"]
) {
  grid-column:span 2!important;
}
html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] :is(
  .aho-choice-grid--field-referral_sources,
  .aho-choice-grid--field-target_groups,
  .aho-choice-grid--field-topics
) label.u128-choice,
html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] :is(
  .aho-choice-grid--field-referral_sources,
  .aho-choice-grid--field-target_groups,
  .aho-choice-grid--field-topics
) label.u128-choice :is(.u125-choice-icon,.u123-choice-mark) {
  align-items:center!important;
  align-self:center!important;
  margin-top:0!important;
}

/* Same card hygiene and text behavior on the remaining capture pages. */
html body.page-entry .app-shell .aho-entry-form[data-capture-ui="testing"] :where(.aho-choice-grid,.u128-choice-grid) {
  min-width:0!important;
}
html body.page-entry .app-shell .aho-entry-form[data-capture-ui="testing"] :where(.u125-panel-heading,.aho-fieldset legend) {
  overflow-wrap:break-word!important;
  hyphens:none!important;
}

@media(max-width:1600px) {
  html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] :is(
    .aho-choice-grid--field-contact_channels,
    .aho-choice-grid--field-occasions,
    .aho-choice-grid--field-target_groups,
    .aho-choice-grid--field-genders,
    .aho-choice-grid--field-orientations,
    .aho-choice-grid--field-referral_sources,
    .aho-choice-grid--field-topics
  ).u128-choice-grid {grid-template-columns:repeat(3,minmax(0,1fr))!important;}
}
@media(max-width:1100px) {
  html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] :is(
    .aho-choice-grid--field-contact_channels,
    .aho-choice-grid--field-occasions,
    .aho-choice-grid--field-target_groups,
    .aho-choice-grid--field-genders,
    .aho-choice-grid--field-orientations,
    .aho-choice-grid--field-referral_sources,
    .aho-choice-grid--field-topics
  ).u128-choice-grid {grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] :is(
    .aho-choice-grid--field-referral_sources,
    .aho-choice-grid--field-target_groups
  ) label.u128-choice:is([data-choice-value="professional_referral"],[data-choice-value="refugees_migrants"])
  {grid-column:auto!important;}
}
@media(max-width:700px) {
  html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] :is(
    .aho-choice-grid--field-contact_channels,
    .aho-choice-grid--field-occasions,
    .aho-choice-grid--field-target_groups,
    .aho-choice-grid--field-genders,
    .aho-choice-grid--field-orientations,
    .aho-choice-grid--field-referral_sources,
    .aho-choice-grid--field-topics
  ).u128-choice-grid {grid-template-columns:1fr!important;}
  html body.page-entry .app-shell .aho-entry-form[data-capture-ui="testing"] label.u128-choice,
  html body.page-testing-capture .stat113-form[data-capture-ui="testing"] label.u128-choice {
    padding:14px!important;
    min-height:66px!important;
    column-gap:12px!important;
  }
}
/* Keep dark-mode text on selectable cards high-contrast. */
:root[data-theme="dark"] body.page-entry .app-shell .aho-entry-form[data-capture-ui="testing"] label.u128-choice :is(.aho73-choice__content,.aho73-choice__label),
:root[data-theme-mode="dark"] body.page-entry .app-shell .aho-entry-form[data-capture-ui="testing"] label.u128-choice :is(.aho73-choice__content,.aho73-choice__label) {
  color:#edf6fa!important;
}

/* Explicit section hooks outrank inherited #social-person and small-screen
   grid rules from the legacy generation. */
html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] #social-person .aho-choice-grid--field-target_groups.u128-choice-grid,
html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] #social-awareness .aho-choice-grid--field-referral_sources.u128-choice-grid,
html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] #social-topics .aho-choice-grid--field-topics.u128-choice-grid {
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
}
html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] :is(#social-person,#social-awareness,#social-topics)
  label.u128-choice .aho73-choice__content,
html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] :is(#social-person,#social-awareness,#social-topics)
  label.u128-choice .aho73-choice__content strong.aho73-choice__label {
  min-width:0!important;
  max-width:100%!important;
  width:auto!important;
  font-size:.85rem!important;
  line-height:1.45!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  hyphens:none!important;
  overflow:visible!important;
}
@media(max-width:1600px) {
  html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] #social-person .aho-choice-grid--field-target_groups.u128-choice-grid,
  html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] #social-awareness .aho-choice-grid--field-referral_sources.u128-choice-grid,
  html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] #social-topics .aho-choice-grid--field-topics.u128-choice-grid {
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}
@media(max-width:1100px) {
  html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] #social-person .aho-choice-grid--field-target_groups.u128-choice-grid,
  html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] #social-awareness .aho-choice-grid--field-referral_sources.u128-choice-grid,
  html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] #social-topics .aho-choice-grid--field-topics.u128-choice-grid {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}
@media(max-width:700px) {
  html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] #social-person .aho-choice-grid--field-target_groups.u128-choice-grid,
  html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] #social-awareness .aho-choice-grid--field-referral_sources.u128-choice-grid,
  html body.page-entry--social-work .app-shell .aho-entry-form[data-capture-ui="testing"] #social-topics .aho-choice-grid--field-topics.u128-choice-grid {
    grid-template-columns:1fr!important;
  }
}
