:root {
  --bf-bg: linear-gradient(180deg, #f3f7ff 0%, #f7f9ff 50%, #faf8f3 100%);
  --bf-surface: rgba(255, 255, 255, 0.82);
  --bf-surface-strong: rgba(255, 255, 255, 0.92);
  --bf-border: rgba(15, 23, 42, 0.08);
  --bf-border-strong: rgba(15, 23, 42, 0.12);
  --bf-text: #101828;
  --bf-text-soft: #667085;
  --bf-kicker: #7a8599;
  --bf-shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.06);
  --bf-shadow-card: 0 20px 50px rgba(15, 23, 42, 0.10);
  --bf-radius-xl: 36px;
  --bf-radius-lg: 28px;
  --bf-radius-md: 22px;
  --bf-radius-pill: 999px;
  --bf-button: #0f172a;
  --bf-button-text: #ffffff;
  --bf-button-soft: rgba(255, 255, 255, 0.8);
  --bf-image-bg: linear-gradient(180deg, #eef4ff 0%, #f8fbff 100%);
  --bf-shell: 1200px;
}

html body .bf-page {
  background: var(--bf-bg);
  padding-top: 84px;
}
/* robust */
html body .bf-page {
  background: var(--bf-bg);
}

html body .bf-page .hidden {
  display: none !important;
}

html body .bf-page * {
  box-sizing: border-box;
}

html body .bf-page img {
  max-width: 100%;
  display: block;
}

html body .bf-page a {
  text-decoration: none;
}

html body .bf-page button {
  font: inherit;
}

/* layout */
html body .bf-page .bf-shell {
  width: min(var(--bf-shell), calc(100% - 32px));
  margin: 0 auto;
}

html body .bf-page .bf-shell--wide {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

html body .bf-page .bf-section {
  padding: 18px 0;
}

/* hero */
html body .bf-page .bf-hero {
  padding: 22px 0 12px;
}

html body .bf-page .bf-hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 38px;
  min-height: 250px;
  box-shadow: var(--bf-shadow-card);
  background: #eaf0fa;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

html body .bf-page .bf-hero-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

html body .bf-page .bf-hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  background: linear-gradient(180deg, rgba(10, 15, 28, 0.05) 0%, rgba(10, 15, 28, 0.58) 100%);
  color: #fff;
}

html body .bf-page .bf-hero-title {
  margin: 0;
  font-size: clamp(2rem, 7vw, 4.3rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 800;
}

html body .bf-page .bf-hero-text {
  margin: 10px 0 0;
  font-size: 1rem;
  line-height: 1.5;
}

html body .bf-page .bf-kicker {
  margin: 0 0 10px;
  font-size: 0.85rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-weight: 800;
  color: var(--bf-kicker);
}

html body .bf-page .bf-hero .bf-kicker {
  color: rgba(255, 255, 255, 0.84);
}

/* section heads */
html body .bf-page .bf-section-head {
  margin-bottom: 24px;
}

html body .bf-page .bf-section-head--recommendation {
  margin-bottom: 20px;
}

html body .bf-page .bf-section-title {
  margin: 0;
  color: var(--bf-text);
  font-size: clamp(2.2rem, 8vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 800;
  max-width: 20ch;
  margin-bottom:24px;
}

html body .bf-page .bf-section-text {
  margin: 16px 0 0;
  color: var(--bf-text-soft);
  font-size: 1.08rem;
  line-height: 1.6;
}

/* buttons */
html body .bf-page .bf-back-button,
html body .bf-page .bf-primary-button,
html body .bf-page .bf-secondary-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: var(--bf-radius-pill);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

html body .bf-page .bf-back-button:hover,
html body .bf-page .bf-primary-button:hover,
html body .bf-page .bf-secondary-button:hover {
  transform: translateY(-1px);
}

html body .bf-page .bf-back-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px;
  margin-bottom: 28px;
  background: var(--bf-button-soft);
  color: var(--bf-text);
  border: 1px solid var(--bf-border);
  box-shadow: var(--bf-shadow-soft);
  font-weight: 700;
}

html body .bf-page .bf-primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 28px;
  background: var(--bf-button);
  color: var(--bf-button-text);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
  font-weight: 800;
  font-size: 1rem;
}

html body .bf-page .bf-secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  background: var(--bf-button-soft);
  color: var(--bf-text);
  border: 1px solid var(--bf-border);
  box-shadow: var(--bf-shadow-soft);
  font-weight: 700;
}

html body .bf-page .bf-primary-button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* goal grid */
html body .bf-page .bf-goal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

html body .bf-page .bf-goal-card {
  appearance: none;
  width: 100%;
  text-align: left;
  padding: 20px;
  border-radius: 28px;
  border: 1px solid var(--bf-border);
  background: var(--bf-surface-strong);
  box-shadow: var(--bf-shadow-soft);
  color: var(--bf-text);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    opacity 0.18s ease;
}

html body .bf-page .bf-goal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--bf-shadow-card);
  border-color: var(--bf-border-strong);
}

html body .bf-page .bf-goal-card.is-selected {
  border-color: rgba(37, 99, 235, 0.18);
  box-shadow:
    0 18px 42px rgba(37, 99, 235, 0.10),
    inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

html body .bf-page .bf-goal-card.is-dimmed {
  opacity: 0.68;
}

html body .bf-page .bf-goal-title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.2;
  letter-spacing: -0.035em;
  font-weight: 800;
  color: var(--bf-text);
}

html body .bf-page .bf-goal-text {
  margin: 10px 0 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--bf-text-soft);
}

/* recommendation */
html body .bf-page .bf-reco-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
  border-radius: 32px;
  border: 1px solid var(--bf-border);
  background: var(--bf-surface-strong);
  box-shadow: var(--bf-shadow-card);
}

html body .bf-page .bf-reco-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 3;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html body .bf-page .bf-reco-image-wrap {
  background: var(--bf-image-bg);
  min-height: 280px;
}

html body .bf-page .bf-reco-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 18px;
}

html body .bf-page .bf-reco-content {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

html body .bf-page .bf-mini-kicker {
  margin: 0 0 12px;
  color: var(--bf-kicker);
  font-size: 0.86rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-weight: 800;
}

html body .bf-page .bf-reco-title {
  margin: 0;
  color: var(--bf-text);
  font-size: clamp(1.9rem, 7vw, 3rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 800;
}

html body .bf-page .bf-reco-text {
  margin: 18px 0 0;
  color: var(--bf-text-soft);
  font-size: 1.08rem;
  line-height: 1.65;
}

html body .bf-page .bf-reco-actions {
  margin-top: 20px;
}

/* alternatives */
html body .bf-page .bf-alt-wrap {
  margin-top: 32px;
}

html body .bf-page .bf-alt-label {
  margin: 0 0 16px;
  color: var(--bf-kicker);
  font-size: 0.92rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

html body .bf-page .bf-alt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

html body .bf-page .bf-alt-card {
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid var(--bf-border);
  background: var(--bf-surface);
  box-shadow: var(--bf-shadow-soft);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

html body .bf-page .bf-alt-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--bf-shadow-card);
  border-color: var(--bf-border-strong);
}

html body .bf-page .bf-alt-image-wrap {
  background: var(--bf-image-bg);
}

html body .bf-page .bf-alt-image {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: contain;
  padding: 20px;
}

html body .bf-page .bf-alt-content {
  padding: 20px 20px 22px;
}

html body .bf-page .bf-alt-title {
  margin: 0;
  color: var(--bf-text);
  font-size: 1.25rem;
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
}

html body .bf-page .bf-alt-text {
  margin: 12px 0 0;
  color: var(--bf-text-soft);
  font-size: 1rem;
  line-height: 1.58;
}

/* toggle row */
html body .bf-page .bf-section--toggle {
  padding-top: 12px;
  padding-bottom: 8px;
  margin-bottom:34px;
}

html body .bf-page .bf-toggle-row {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* all books */
html body .bf-page .bf-books-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

html body .bf-page .bf-book-card {
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid var(--bf-border);
  background: var(--bf-surface);
  box-shadow: var(--bf-shadow-soft);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

html body .bf-page .bf-book-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--bf-shadow-card);
  border-color: var(--bf-border-strong);
}

html body .bf-page .bf-book-link {
  display: block;
  color: inherit;
}

html body .bf-page .bf-book-image-wrap {
  background: var(--bf-image-bg);
}

html body .bf-page .bf-book-image {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: contain;
  padding: 22px;
}

html body .bf-page .bf-book-content {
  padding: 20px 20px 22px;
}

html body .bf-page .bf-book-title {
  margin: 0;
  color: var(--bf-text);
  font-size: 1.18rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
}

html body .bf-page .bf-book-text {
  margin: 12px 0 0;
  color: var(--bf-text-soft);
  font-size: 0.98rem;
  line-height: 1.58;
}

html body .bf-page .bf-hide-row {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

html body .bf-page #goal-section .bf-back-button {
  margin-bottom: 28px;
}

/* tablet */
@media (min-width: 740px) {
  html body .bf-page .bf-shell,
  html body .bf-page .bf-shell--wide {
    width: min(1240px, calc(100% - 44px));
  }

  html body .bf-page .bf-section {
    padding: 22px 0;
  }

  html body .bf-page .bf-hero-card {
    min-height: 340px;
  }

  html body .bf-page .bf-hero-image {
    height: 340px;
  }

  html body .bf-page .bf-hero-overlay {
    padding: 30px;
  }

  html body .bf-page .bf-goal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  html body .bf-page .bf-reco-card {
    grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.1fr);
    min-height: 460px;
  }

  html body .bf-page .bf-reco-image-wrap {
    min-height: 460px;
  }

  html body .bf-page .bf-reco-content {
    padding: 30px 30px;
  }

  html body .bf-page .bf-alt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }

  html body .bf-page .bf-books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

    html body .bf-page .bf-reco-image {
    padding: 24px;
  }
}

/* desktop */
@media (min-width: 1100px) {
  html body .bf-page .bf-goal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  html body .bf-page .bf-books-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  html body .bf-page .bf-reco-content {
    padding: 38px 38px;
  }

  html body .bf-page .bf-reco-image {
    padding: 30px;
  }
}

@media (min-width: 1440px) {
  html body .bf-page .bf-books-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {

  html body .bf-page .bf-books-grid {
    gap: 16px;   /* vorher 12 → zu eng */
  }

  html body .bf-page .bf-book-content {
    padding: 16px 16px 18px;  /* etwas kompakter */
  }

}

@media (max-width: 480px) {

  html body .bf-page .bf-book-image {
    padding: 16px;   /* vorher 22 → zu groß */
  }

}

@media (max-width: 480px) {

  html body .bf-page .bf-section {
    padding: 14px 0;
  }

  html body .bf-page .bf-section-head {
    margin-bottom: 18px;
  }

}

@media (max-width: 480px) {

  html body .bf-page .bf-book-image {
    object-fit: cover;     /* statt contain */
    padding: 0;            /* GANZ wichtig */
    height: 100%;
  }

  html body .bf-page .bf-book-image-wrap {
    aspect-ratio: 4 / 3;   /* etwas höher → wirkt größer */
    overflow: hidden;
  }

}

@media (max-width: 480px) {

  html body .bf-page .bf-book-title {
    font-size: 1.05rem;   /* vorher ~1.18 → etwas kleiner */
    font-weight: 700;     /* statt 800 → deutlich ruhiger */
    letter-spacing: -0.02em;
    line-height: 1.15;
  }

}

@media (max-width: 480px) {

  html body .bf-page .bf-alt-label {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 14px;

    hyphens: auto;          /* automatische Silbentrennung */
    -webkit-hyphens: auto;
    -ms-hyphens: auto;

    overflow-wrap: break-word; /* fallback */
  }

}

@media (max-width: 480px) {

  html body .bf-page .bf-alt-image {
    object-fit: cover;     /* statt contain */
    padding: 0;            /* GANZ wichtig */
    height: 100%;
  }

  html body .bf-page .bf-alt-image-wrap {
    aspect-ratio: 4 / 3;   /* größer & moderner */
    overflow: hidden;
  }

}


@media (max-width: 480px) {

  html body .bf-page .bf-primary-button {
    min-height: 48px;           /* kleiner */
    padding: 0 20px;
    font-size: 0.95rem;
    font-weight: 600;           /* weniger fett */

    background: rgba(15, 23, 42, 0.9); /* etwas softer */
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  }

}

/* dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bf-bg: radial-gradient(circle at 20% 20%, #0e1a2a 0%, #0a111a 70%) fixed;
    --bf-surface: rgba(13, 20, 31, 0.74);
    --bf-surface-strong: rgba(15, 23, 36, 0.9);
    --bf-border: rgba(255, 255, 255, 0.08);
    --bf-border-strong: rgba(255, 255, 255, 0.14);
    --bf-text: #f3f6fb;
    --bf-text-soft: #b6c1d3;
    --bf-kicker: #8fa2bb;
    --bf-shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.24);
    --bf-shadow-card: 0 22px 48px rgba(0, 0, 0, 0.38);
    --bf-button: #f3f6fb;
    --bf-button-text: #0a111a;
    --bf-button-soft: rgba(255, 255, 255, 0.06);
    --bf-image-bg: linear-gradient(180deg, #0f1a2a 0%, #121d2f 100%);
  }

  html body .bf-page .bf-hero-card {
    background: #101b2a;
    border-color: rgba(255, 255, 255, 0.08);
  }

  html body .bf-page .bf-reco-badge {
    background: rgba(243, 246, 251, 0.12);
    color: #f3f6fb;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
}

/* =========================
   DARK MODE – HIGHEST PRIORITY
========================= */
@media (prefers-color-scheme: dark) {

  html body .bf-section--toggle {
    background: transparent !important;
  }

  html body .bf-primary-button {
    background: rgba(255,255,255,0.08) !important;
    color: rgba(255,255,255,0.92) !important;

    border: 1px solid rgba(255,255,255,0.12) !important;
    backdrop-filter: blur(8px) !important;

    box-shadow: none !important;
  }

  html body .bf-primary-button:hover {
    background: rgba(255,255,255,0.14) !important;
    color: #fff !important;

    transform: translateY(-1px) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35) !important;
  }

  html body .bf-primary-button:active {
    transform: translateY(0) !important;
    background: rgba(255,255,255,0.1) !important;
  }
}