/*
 * Heartlines Design & Inhalte 1.3.3 — spacing and responsive containment.
 * Visual adjustments only. Request handlers, form values, session states,
 * billing and the previously approved AP1/AP2 changes remain untouched.
 */

/* Separate the submit action from the following explanation in every channel. */
html body.hldesign-ready.hldesign-safe #content .hlaudio-card > form + p.hlaudio-note,
html body.hldesign-ready.hldesign-safe #content .hlchat-request-card > form + p.hlchat-note,
html body.hldesign-ready.hldesign-safe #content .hlvideo-card > form + p.hlvideo-note,
html body.hldesign-ready.hldesign-safe #content .hla-auth-card > .hla-button + p {
  margin-top: 14px !important;
}

/* Free-minute explanations and longer email notes also need room above actions. */
html body.hldesign-ready.hldesign-safe #content .hlchat-request-card > p.hlchat-note + form,
html body.hldesign-ready.hldesign-safe #content .hlvideo-card > p.hlvideo-note + form {
  margin-top: 16px !important;
}
html body.hldesign-ready.hldesign-safe #content .hle-card > form > .hle-note {
  margin: 14px 0 16px !important;
}
html body.hldesign-ready.hldesign-safe #content .hle-card > form > .hle-question {
  display: block;
  min-width: 0;
}
html body.hldesign-ready.hldesign-safe #content .hle-card > form > .hle-question + .hle-button {
  margin-top: 16px !important;
}

/* Auth fields outside a form grid otherwise run straight into the next label. */
html body.hldesign-ready.hldesign-safe #content .hla-auth-card:not(.hla-register-card) > label:not(.hla-check) {
  display: block;
  margin-bottom: 16px !important;
}

/* Consistent action padding with safe wrapping, including secondary actions. */
html body.hldesign-ready.hldesign-safe #content .hlaudio-card .hlaudio-button,
html body.hldesign-ready.hldesign-safe #content .hlchat-card .hlchat-button,
html body.hldesign-ready.hldesign-safe #content .hlvideo-card .hlvideo-button,
html body.hldesign-ready.hldesign-safe #content .hle-card .hle-button,
html body.hldesign-ready.hldesign-safe #content .hlcb-card .hlcb-button,
html body.hldesign-ready.hldesign-safe #content .hla-auth-card > .hla-button {
  align-items: center;
  justify-content: center;
  box-sizing: border-box !important;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  line-height: 1.3 !important;
  text-align: center;
  white-space: normal !important;
  overflow-wrap: break-word;
}
html body.hldesign-ready.hldesign-safe #content .hlaudio-actions,
html body.hldesign-ready.hldesign-safe #content .hlvideo-actions,
html body.hldesign-ready.hldesign-safe #content .hlchat-inline-actions,
html body.hldesign-ready.hldesign-safe #content .hle-actions {
  flex-wrap: wrap;
  gap: 12px;
}

/* Keep the long registration CTA inside its card instead of clipping its label. */
html body.hldesign-ready.hldesign-safe #content .hli5-apply__cta {
  box-sizing: border-box !important;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  height: auto !important;
  padding: 12px 16px !important;
  line-height: 1.4 !important;
  text-align: center;
  white-space: normal !important;
  overflow-wrap: break-word;
}

/* The registration hint has an icon and two text rows, not three flex columns. */
html body.hldesign-ready.hldesign-safe #content .hla-draft-hint {
  display: grid !important;
  grid-template-columns: 25px minmax(0, 1fr);
  align-items: start;
  gap: 4px 10px;
}
html body.hldesign-ready.hldesign-safe #content .hla-draft-hint::before {
  grid-column: 1;
  grid-row: 1 / span 2;
}
html body.hldesign-ready.hldesign-safe #content .hla-draft-hint > strong,
html body.hldesign-ready.hldesign-safe #content .hla-draft-hint > span {
  grid-column: 2;
  min-width: 0;
  margin: 0 !important;
}

/* Long German legal headings must fit at narrow phone widths as well. */
html body.hldesign-ready.hldesign-safe #content :is(#hldp, #hlagb-user, #hlwd, #hlimp) :is(h1, h2, h3) {
  min-width: 0;
  max-width: 100%;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  hyphens: auto;
}
html body.hldesign-ready.hldesign-safe #content :is(#hldp, #hlagb-user, #hlwd, #hlimp) :is(p, li, a) {
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* The results count should use the row width instead of a shrinking title box. */
html body.hldesign-ready.hldesign-safe:not(.heartlines-home) #content .hl-core-search-list .bl-head {
  display: flex !important;
  align-items: center;
  gap: 12px;
}
html body.hldesign-ready.hldesign-safe:not(.heartlines-home) #content .berater-liste .bl-head > .sec-title {
  display: flex !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  justify-content: flex-start !important;
  gap: 12px !important;
}
html body.hldesign-ready.hldesign-safe:not(.heartlines-home) #content .berater-liste .bl-head > .sec-title > h2 {
  flex: 0 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0;
  white-space: normal !important;
  overflow-wrap: normal;
}

/* Give long legal section titles the full card width on narrow phones. */
@media (max-width: 480px) {
  html body.hldesign-ready.hldesign-safe #content :is(#hldp, #hlagb-user, #hlwd, #hlimp) h1 {
    font-size: clamp(24px, 7vw, 30px) !important;
    line-height: 1.25 !important;
  }
  html body.hldesign-ready.hldesign-safe #content :is(#hldp, #hlagb-user, #hlwd, #hlimp) h2 {
    font-size: clamp(22px, 6vw, 26px) !important;
    line-height: 1.25 !important;
  }
  html body.hldesign-ready.hldesign-safe #content :is(.hldp-section, .hlagb-section, .hlwd-section, .hlimp-section) {
    padding: 16px !important;
  }
  html body.hldesign-ready.hldesign-safe #content :is(.hldp-section__head, .hlagb-section__top, .hlwd-section__head, .hlimp-section__head) {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  html body.hldesign-ready.hldesign-safe #content :is(.hldp-section__head, .hlagb-section__top, .hlwd-section__head, .hlimp-section__head) > div {
    width: 100%;
    min-width: 0;
  }
  html body.hldesign-ready.hldesign-safe #content :is(.hldp-section__eyebrow, .hlagb-section__eyebrow, .hlwd-section__eyebrow, .hlimp-section__eyebrow) {
    font-size: 12px !important;
    line-height: 1.4 !important;
    letter-spacing: .08em;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
@media (max-width: 359px) {
  html body.hldesign-ready.hldesign-safe #content :is(#hldp, #hlagb-user, #hlwd, #hlimp) :is(p, li) {
    font-size: 15px !important;
    line-height: 1.6 !important;
  }
}
@media (max-width: 380px) {
  html body.hldesign-ready.hldesign-safe #content .advisor-detail-template .hl-v12-detail-actions .hlfp-detail-action-label {
    font-size: clamp(10px, 3.1vw, 12px) !important;
    line-height: 1.3 !important;
  }
}
