/*
 * Stylesheet für BIBELHELD (modern, kinderfreundlich)
 * - Warme Farben, große Klickflächen
 * - Sticky Navbar mit sanfter Dropdown-Animation
 * - Zentrierter Content-Bereich
 * - Verbesserte Darstellung von Kapiteln und Bildern
 */

/* Dyslexic-friendly font (OpenDyslexic via jsdelivr) */
/* Base */
html { box-sizing: border-box; font-size: 16px; }
*, *::before, *::after { box-sizing: inherit; }
/* Brand tokens */
:root{
  --color-brand: #2259be; /* Book Blue */
  --color-cape: #9c2222;  /* Coral */
  --color-gold: #FFC145;  /* Gold */
  --color-leaf: #2EB67D;  /* Leaf */
  --color-ink: #1E1E2A;   /* Text */
  --color-warm-paper: #FFF9F2; /* Warm background */
  --color-cloud: #F3F6FB; /* Light card */
  --color-stone: #C7CCD6; /* Lines */
  --shadow-1: 0 2px 8px rgba(0,0,0,.06);
  --radius-card: 16px;
  --bh-shell-edge: 1rem;
  --bh-shell-max: 1200px;
  --bh-shell-align-left: max(var(--bh-shell-edge), calc((100vw - var(--bh-shell-max)) / 2 + var(--bh-shell-edge)));
  --bh-shell-align-right: max(var(--bh-shell-edge), calc((100vw - var(--bh-shell-max)) / 2 + var(--bh-shell-edge)));
}
/* Ensure outer document doesn't scroll; iframe provides scrolling */
/* Limit no-scroll rule to the app shell (parent), not stories in the iframe */
html.bh-shell, body.bh-shell { height: 100%; overflow: hidden; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; line-height: 1.5; background: var(--color-warm-paper); color: var(--color-ink); display: flex; flex-direction: column; min-height: 100dvh; }
/* Reserve space for icon glyphs before the icon font loads to avoid CLS */
i.bi { display: inline-block; width: 1em; height: 1em; }
/* Global heading typography: use system font to avoid CLS */
h1, h2, h3, h4, h5, h6, .card-title {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: .01em;
}
h1 { font-weight: 800; }
h2, h3, h4, h5, h6, .card-title { font-weight: 700; }
/* Reserve viewport for iframe area to avoid CLS */
/* Conservative default (navbar + footer) to reduce early shifts */
:root { --bh-chrome: 120px; --bh-vh: 100vh; }
/* Use dynamic viewport height where supported, fallback to JS-updated --bh-vh */
#contentWrap { min-height: calc(var(--bh-vh) - var(--bh-chrome)); }
#storyFrame { min-height: calc(var(--bh-vh) - var(--bh-chrome)); }
@supports (height: 100dvh) {
  #contentWrap { min-height: calc(100dvh - var(--bh-chrome)); }
  #storyFrame { min-height: calc(100dvh - var(--bh-chrome)); }
}
/* Respect iOS safe area so footer is not obscured by home indicator */
.footer { padding-bottom: calc(env(safe-area-inset-bottom, 0px)); margin-bottom: var(--bh-ios-bottom, 0px); }
/* Safari's collapsed/floating bottom address bar overlaps page content without reliably
   shrinking visualViewport, so dynamic detection (--bh-ios-bottom) alone can't be trusted
   here. Reserve a fixed extra buffer on iOS so the footer player always clears it. */
body.bh-ios .footer { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 48px); }


/* Stabilize major chrome heights early */
.navbar { min-height: 56px; }
#storyToolbar { min-height: 48px; }
#bhCenterControls { white-space: nowrap; }
.footer { min-height: 64px; }

/* Skip link helper: hidden until focused */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Mode toggles */
/* Kid Mode scales root font size so rem-based headings remain larger */
html.bh-kid-mode { font-size: 18px; }
html.bh-kid-mode .bh-tile-summary { display: none !important; }
html.bh-kid-mode [data-bh-music] { display: none !important; }
/* Child-focused policy: hide outbound music service links globally. */
[data-bh-music], [data-bh-music-menu] { display: none !important; }
html.bh-kid-mode .bh-filter-row,
html.bh-kid-mode .bh-tag-suggestions { display: none !important; }
html.bh-kid-mode .parents,
html.bh-kid-mode .parent-note { display: none !important; }
/* Ensure headings are larger than subtitles in Kid Mode */
html.bh-kid-mode h5,
html.bh-kid-mode .h5,
html.bh-kid-mode .card-title { font-size: 1.4rem; line-height: 1.3; }
html.bh-kid-mode .bh-tile-subtitle { font-size: 1rem; }

/* Navbar */
.navbar { background-color: var(--color-warm-paper); border-bottom: 1px solid #E9ECF2; }
.navbar > .container { position: relative; }
.bh-shell .navbar > .container,
.bh-shell #storyToolbar > .container,
.bh-shell .footer > .container {
  width: calc(100% - var(--bh-shell-align-left) - var(--bh-shell-align-right)) !important;
  max-width: none !important;
  margin-left: var(--bh-shell-align-left) !important;
  margin-right: var(--bh-shell-align-right) !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.navbar .navbar-brand { font-weight: 800; color: var(--color-ink); display: inline-flex; align-items: center; gap: .5rem; }
.navbar .navbar-brand:hover { color: var(--color-ink); }
.navbar .navbar-brand span { color: var(--color-brand); text-transform: uppercase; }
/* When brand is used as a primary button, ensure text is white */
.navbar .navbar-brand.btn { color: #fff; }
.navbar .navbar-brand.btn:hover { color: #fff; }
.navbar .navbar-brand.btn span { color: #fff; }
.navbar .nav-link { color: var(--color-ink); border-radius: .5rem; font-weight: 600; }
.navbar .nav-link:hover, .navbar .nav-link.active { background: rgba(58,124,247,.12); color: var(--color-ink); }
.navbar .navbar-toggler { border-color: rgba(0,0,0,.15); }
.navbar .navbar-toggler-icon { filter: invert(0.3); }
/* Show hamburger menu only under 450px. Between 450px and 992px keep navbar expanded. */
@media (max-width: 991.98px) {
  .navbar .navbar-toggler { display: none !important; }
}
@media (max-width: 449.98px) {
  /* No hamburger on small screens; show small language dropdown instead */
  .navbar .navbar-toggler { display: none !important; }
  #bhTopControlsSm { display: flex !important; }
  #langDropdownSm { display: inline-block !important; }
}
@media (min-width: 450px) {
  #bhTopControlsSm { display: none !important; }
  #langDropdownSm { display: none !important; }
}
/* Keep collapse on the same row between 450px and 992px */
@media (min-width: 450px) and (max-width: 991.98px) {
  .navbar .navbar-collapse {
    display: flex !important;
    flex-basis: auto !important;
    align-items: center !important;
    width: auto !important;
  }
}

/* Center the Kid Mode button in the main navbar on >=450px */
@media (min-width: 450px) {
  #btnKidMode {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2; /* stay above background */
  }
}
@media (max-width: 449.98px) {
  #btnKidMode { position: static; transform: none; display: none !important; }
  #langDropdown, #langBtn, #langMenu, #btnKlingklongGate { display: none !important; }
}
/* Stretch navbar containers to full width on small/mid screens to free horizontal space */
@media (max-width: 991.98px) {
  .navbar > .container { max-width: 100% !important; padding-left: var(--bh-shell-edge); padding-right: var(--bh-shell-edge); }
}

/* Dropdown animation (CSS only) */
.dropdown-menu { opacity: 0; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; border-radius: .5rem; }
.dropdown-menu.show { opacity: 1; transform: translateY(0); }
.dropdown-menu { max-height: 60vh; overflow-y: auto; }

/* Buttons */
.btn { border-radius: 12px; padding: 10px 14px; font-weight: 700; border-width: 2px; }
.form-control,
.form-select,
input,
select,
button,
.btn { font-family: inherit; }
.btn-outline-primary { color: var(--color-brand); border-color: var(--color-brand); background: #fff; }
.btn-outline-primary:hover { background-color: var(--color-brand); color: #fff; }
.btn-primary { background-color: var(--color-brand); border-color: var(--color-brand); color: #fff; box-shadow: var(--shadow-1); }
.bh-klingklong-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-width: 44px;
  height: 44px;
  padding: 10px;
  line-height: 1;
}
.bh-klingklong-btn .bi { display: inline-flex; align-items: center; line-height: 1; }
.bh-klingklong-label { font-weight: 800; line-height: 1; }
.bh-klingklong-btn.active,
.bh-klingklong-btn.btn-primary { background: #ff8a3d; border-color: #ff8a3d; color: #fff; }
.bh-klingklong-locked {
  cursor: not-allowed !important;
}
.bh-klingklong-locked .bi {
  color: inherit !important;
}
.bh-klingklong-lock-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: .4rem;
  line-height: 1;
}
.bh-klingklong-tooltip {
  position: fixed;
  z-index: 9999;
  max-width: min(280px, calc(100vw - 24px));
  padding: .45rem .65rem;
  border-radius: 10px;
  background: rgba(33, 37, 41, .94);
  color: #fff;
  font-size: .85rem;
  line-height: 1.35;
  box-shadow: 0 12px 24px rgba(0, 0, 0, .18);
  pointer-events: none;
}
.bh-pin-group {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.bh-pin-group .bh-pin-input {
  width: 52px;
  height: 56px;
  padding: 0;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0;
}
.btn-primary:hover { filter: saturate(110%); }
/* Cape-red kept only for the Player-Steuerung (footer audio controls) — see bh-tokens.css .btn-danger */
:root { --color-cape-strong: #B22222; }

/* Play button: vertically center icon with label text */
.btn-play { display: inline-flex; align-items: center; }
.btn-play .bi { display: inline-flex; align-items: center; line-height: 1; }

/* Inline SVG icon fallback for shapes that render incorrectly via -webkit-mask-image on iOS Safari
   (self-intersecting paths, e.g. the shuffle icon) — sized/aligned to match .bi icons. */
.bh-icon-svg { display: inline-block; width: 1em; height: 1em; vertical-align: -.125em; fill: currentColor; }

/* Welcome & iframe container */
#contentWrap { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#contentWrap.container-fluid { padding-left: 0; padding-right: 0; }
#contentWrap > .row { flex: 1 1 auto; min-height: 0; display: flex; }
#contentWrap > .row > [class^="col-"],
#contentWrap > .row > [class*=" col-"] { min-height: 0; display: flex; }
#storyFrame { background: #fff; border-radius: .5rem; box-shadow: 0 2px 4px rgba(0,0,0,.1); min-height: 0; flex: 1 1 auto; height: auto; }
#welcomeMessage, #storyTiles { display: none !important; }
#welcomeMessage { background: #fff9f0; border-radius: .5rem; box-shadow: 0 2px 4px rgba(0,0,0,.1); }

/* Active story link */
.story-link.active { font-weight: 700; color: #b32f45; }

/* Story content helpers (applies inside iframe, too, when classes exist) */
.main { padding: 1rem; max-width: 1200px; margin: 0 auto; }
.header { margin-top: 1.25rem; }
.chapter .row { margin-bottom: 1.5rem; }
.chapter .col-md-6 img { width: 100%; height: auto; border-radius: .5rem; display: block; }
.verse, .crafts, .games, .summary, .prayer, .blessing, .theology, .song, .takeaway, .reflections, .content { background: #fff; border-radius: .5rem; box-shadow: 0 1px 2px rgba(0,0,0,.06); padding: 1rem; margin-top: 1rem; }
/* Song lyrics stay in the HTML (source for the future line-by-line synced lyric view)
   but are not shown in the story pages for now. */
.song { display: none; }
.song pre {
  max-width: 100%;
  margin: .75rem 0 0;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  overflow-x: hidden;
  font-family: 'Noto Serif', Georgia, serif;
  font-size: 1rem;
  line-height: 1.65;
}
.bh-song-lyrics {
  max-width: 100%;
  line-height: 1.65;
  overflow-wrap: break-word;
}
.bh-song-lyrics .bh-lyric-blank {
  height: 1em;
}
.bh-song-lyrics .bh-lyric-has-trans {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  column-gap: .3em;
}
.bh-song-copyright {
  margin-top: 1.1rem;
  line-height: 1.45;
}
.bh-song-copyright p {
  margin: 0 0 .55rem;
}
@media (max-width: 575.98px) {
  .song { padding: .85rem; }
  .song pre,
  .bh-song-lyrics { font-size: .95rem; line-height: 1.7; }
  .bh-song-copyright { font-size: .86rem; line-height: 1.45; }
  .bh-song-lyrics .bh-lyric-has-trans { flex-wrap: wrap; }
  .bh-song-lyrics .bh-trans {
    flex-basis: 100%;
    padding-left: 1.25em;
    color: #636e72;
  }
}
@media (max-width: 420px) {
  .song pre,
  .bh-song-lyrics { overflow-wrap: anywhere; }
}
/* Highlight Bible verse blocks consistently (match PDF coral accent) */
.verse { border-left: 6px solid var(--color-cape); margin-bottom: 10px; }
/* "Bibelvers" label always renders in the brand wordmark font, all-caps, in brand coral */
.verse h4.bh-section-title { color: var(--color-cape); margin-top: 0; text-transform: uppercase; font-family: Rubik, 'Noto Sans', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; }
/* Back-compat if a story still uses a leading <strong> label */
.verse strong { color: var(--color-cape); text-transform: uppercase; font-family: Rubik, 'Noto Sans', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; }

/* Hero + Tags */
.bh-hero h2 { color: #fff; }
.bh-tag { display: inline-block; padding: .2rem .6rem; border-radius: 999px; background: #fff; border: 1px solid #E9ECF2; color: var(--color-ink); font-size: .8rem; line-height: 1.2; box-shadow: var(--shadow-1); font-family: inherit; }

/* Tile tag overlays */
.bh-tile-media { position: relative; overflow: hidden; }
.bh-tile-media .bh-tile-tags { position: absolute; inset: 0; pointer-events: none; }
/* Ensure image fills and centers within ratio for consistent cropping */
.bh-tile-media > img.card-img-top {
  display: block;
  position: absolute !important;
  top: 50%;
  left: 50%;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%);
  height: 100%;
  width: auto;
  min-width: 100%;
  min-height: 100%;
}
.bh-tile-media .bh-tag { position: absolute; z-index: 2; background: rgba(255,255,255,.9); -webkit-backdrop-filter: saturate(120%) blur(2px); backdrop-filter: saturate(120%) blur(2px); border-color: rgba(0,0,0,.1); }
/* For safety: neutralize Bootstrap .ratio > * rule for tags if they are direct children in other contexts */
.ratio > .bh-tag { position: absolute; top: auto !important; right: auto !important; bottom: auto !important; left: auto !important; width: auto !important; height: auto !important; }
.bh-tile-media .bh-tag--date { top: 8px; left: 8px; right: auto; bottom: auto; }
.bh-tile-media .bh-tag--hero { top: 8px; left: 8px; right: auto; bottom: auto; }
.bh-tile-media .bh-tag--age { bottom: 8px; left: 8px; top: auto; right: auto; opacity: 1; transform: none; }
.bh-tile-media .bh-tag--reading { bottom: 8px; right: 8px; top: auto; left: auto; opacity: 1; transform: none; }

/* Detail view tags under subtitle */
.bh-detail-tags { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: .25rem; }
.bh-detail-tags .bh-tag--reading { position: static; top: auto; right: auto; bottom: auto; left: auto; }

/* Footer */
.footer { background: var(--color-warm-paper); color: var(--color-ink); border-top: 1px solid #E9ECF2; margin-top: auto; }
/* Centering anchor for absolute-positioned audio controls; be robust to container variants */
.footer > .container,
.footer > .container-fluid,
.footer .container,
.footer .container-fluid { position: relative; }
.footer #bhFooterActions { display: flex; gap: .5rem; align-items: center; }
/* Danke uses same base button sizing as Share; only colors differ */
.footer #bhFooterActions .btn,
.footer #bhFooterActions .bmc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1; padding: 10px 14px; border-width: 2px; }
.footer #bhFooterActions .bmc-btn { background-color: #FFDD00; color: #000; border: 2px solid #000; border-radius: 12px; font-weight: 700; text-decoration: none; }
.footer #bhFooterActions .bmc-btn:hover { filter: brightness(0.95); color: #000; }
.footer #bhFooterActions .bmc-btn img { height: 1.1rem; width: auto; display: inline-block; }
.footer #bhFooterActions .btn i { font-size: 1.1rem; line-height: 1; display: inline-block; }
/* Under 770px show icon-only (hide text labels) to keep one row */
@media (max-width: 769.98px) {
  .footer #bhFooterActions .btn span { display: none !important; }
}
/* Hide Danke button on very small screens (<400px) */
@media (max-width: 399.98px) {
  .footer #bhFooterActions .bmc-btn { display: none !important; }
}
/* Under 992px hide copyright text; show only copyright button */
@media (max-width: 991.98px) {
  .footer .bh-copyright-text { display: none !important; }
}
/* On touch devices (iOS/Android), always hide long copyright text to free space */
@media (hover: none) and (pointer: coarse) {
  .footer .bh-copyright-text { display: none !important; }
}

/* Footer audio controls centered */
.footer .bh-audio-controls { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: .5rem; z-index: 2; }
html.bh-icons-pending:not(.bh-icons-ready) body.is-landing .footer .bh-audio-controls { visibility: hidden; pointer-events: none; }
.footer .bh-audio-controls .btn { padding: 8px 12px; border-radius: 999px; touch-action: manipulation; }
.footer .bh-audio-controls .btn i { font-size: 1.25rem; line-height: 1; }
.footer .bh-audio-controls #bhBtnRepeat:not(.is-active),
.footer .bh-audio-controls #bhBtnRepeat:not(.is-active):hover,
.footer .bh-audio-controls #bhBtnRepeat:not(.is-active):focus,
.footer .bh-audio-controls #bhBtnRepeat:not(.is-active):active { background: #fff; color: var(--color-cape-strong); border-color: var(--color-cape-strong); box-shadow: none; }
.footer .bh-audio-controls #bhBtnRepeat.is-active,
.footer .bh-audio-controls #bhBtnRepeat.is-active:hover,
.footer .bh-audio-controls #bhBtnRepeat.is-active:focus,
.footer .bh-audio-controls #bhBtnRepeat.is-active:active { background: var(--color-brand); color: #fff; border-color: var(--color-brand); }
.footer .bh-audio-controls #bhBtnShuffle:not(.is-active),
.footer .bh-audio-controls #bhBtnShuffle:not(.is-active):hover,
.footer .bh-audio-controls #bhBtnShuffle:not(.is-active):focus,
.footer .bh-audio-controls #bhBtnShuffle:not(.is-active):active { background: #fff; color: var(--color-cape-strong); border-color: var(--color-cape-strong); box-shadow: none; }
.footer .bh-audio-controls #bhBtnShuffle.is-active,
.footer .bh-audio-controls #bhBtnShuffle.is-active:hover,
.footer .bh-audio-controls #bhBtnShuffle.is-active:focus,
.footer .bh-audio-controls #bhBtnShuffle.is-active:active { background: var(--color-brand); color: #fff; border-color: var(--color-brand); }
.footer .bh-audio-controls .btn.is-active { background: var(--color-cape-strong); border-color: var(--color-cape-strong); color: #fff; }
@media (max-width: 575.98px) {
  .footer #bhFooterCpr,
  .footer #bhFooterActions { display: none !important; }
  .footer > .container,
  .footer > .container-fluid,
  .footer .container,
  .footer .container-fluid { flex-wrap: wrap; row-gap: .5rem; }
  .footer .bh-audio-controls { position: static; left: auto; transform: none; order: 3; width: 100%; justify-content: center; gap: .25rem; }
}
.card { border-radius: var(--radius-card); box-shadow: var(--shadow-1); border: 1px solid #E9ECF2; overflow: hidden; }

/* Focus visible for accessibility */
:focus-visible { outline: 3px solid var(--color-gold); outline-offset: 2px; }

/* Story toolbar layout helpers: Zur Übersicht on the left, the
   Lesemodus/A±/Drucken tool group anchored together on the right. */
#storyToolbar .container { justify-content: space-between; }
#bhCenterControls { display: flex; align-items: center; gap: .5rem; }
#storyToolbar .vr { display: none !important; }

/* Print (used by our export) */
@media print { .navbar, .footer, #exportBtn { display: none !important; } }

/* Small screens */
@media (max-width: 768px) {
  .navbar .nav-link { margin-bottom: .25rem; }
}

/* Mobile optimizations */
/* Under 800px: hide tile summaries and tile button labels (icons only) */
@media (max-width: 800px) {
  .bh-tile-summary { display: none !important; }
  .bh-tile-btn-label { display: none !important; }
}
/* Interleave-on-mobile styles (also injected in iframe by JS) */
/* Default: duplicates hidden on larger screens */
img.bh-inline-img { display: none !important; }
@media (max-width: 840px) {
  /* Hide originals only when inline duplicates are ready */
  .chapter .row[data-bh-interleaved="1"][data-bh-inline-ready="1"] .col-md-6:first-child img { display: none !important; }
  /* If supported, hide originals when inline images exist */
  @supports selector(:has(*)) {
    .chapter .row[data-bh-interleaved="1"]:has(img.bh-inline-img) .col-md-6:first-child img { display: none !important; }
  }
  /* Show inline duplicates inside text on small screens; keep natural aspect */
  img.bh-inline-img { display: block !important; max-width: 100%; width: auto; height: auto; object-fit: contain; }
}

/* (reverted svg icon baseline; using icon font) */

/* Avoid two-line tile buttons between ~1016px and 1225px: show icons only */
@media (min-width: 1016px) and (max-width: 1225px) {
  .bh-tile-btn-label { display: none !important; }
}

/* Toolbar tweaks for very small screens */
@media (max-width: 650px) {
  /* Back button: show icon only to avoid overlap */
  #storyToolbar .container { flex-wrap: wrap; }
  #storyToolbar #btnBack { font-size: 0; }
  #storyToolbar #btnBack i { font-size: 1rem; margin-right: 0; }
  /* Export: icon only */
  #storyToolbar #btnExport { font-size: 0; }
  #storyToolbar #btnExport i { font-size: 1rem; margin-right: 0; }
  /* Reading: icon only */
  #storyToolbar #btnReading { font-size: 0; }
  #storyToolbar #btnReading i { font-size: 1rem; margin-right: 0; }
}

/* Music services dropdown: keep custom caret icon, hide Bootstrap's default ::after caret */
[data-bh-music-menu] .dropdown-toggle::after { display: none !important; }
.bh-hero-start-overlay { position: fixed; inset: 0; z-index: 20000; display: none; }
.bh-hero-start-overlay.show { display: block; }
#bhHeroStartFrame { width: 100%; height: 100%; border: 0; display: block; background: transparent; }
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); align-items: center; justify-content: center; }
.modal.show { display: flex; }
.modal-dialog { margin: 1rem; max-width: 90vw; width: auto; }
.modal-content { background: #fff; border-radius: .5rem; box-shadow: 0 10px 20px rgba(0,0,0,.15); max-height: 90vh; overflow: auto; }
.modal-header, .modal-body, .modal-footer { padding: 1rem; }
.modal-header { border-bottom: 1px solid #eee; }
.modal-footer { border-top: 1px solid #eee; }
#bhPrivacyOverlay .modal-title { font-size: 1.15rem; font-weight: 800; }
#bhPrivacyOverlay .modal-body { font-size: 1rem; line-height: 1.6; }
#bhPrivacyOverlay .bh-privacy > p:first-child { font-size: .9rem; margin-bottom: 1rem !important; }
#bhPrivacyOverlay .bh-privacy h6 {
  font-size: 1.05rem;
  line-height: 1.3;
  font-weight: 800;
  color: var(--color-deep, #1b2a41);
  margin: 1.35rem 0 .55rem;
  padding-left: .65rem;
  border-left: 4px solid var(--color-cape, #e96f5d);
}
#bhPrivacyOverlay .bh-privacy h6:first-of-type { margin-top: 0; }
#bhPrivacyOverlay .bh-privacy ul { padding-left: 1.4rem; margin-bottom: 1rem; }
#bhPrivacyOverlay .bh-privacy li { margin-bottom: .4rem; }
#pdfOptionsModal .modal-dialog { width: 75vw; max-width: 75vw; margin-left: auto; margin-right: auto; }
@media (min-width: 1500px) {
  #pdfOptionsModal .modal-dialog { width: 33.333vw; max-width: 33.333vw; }
}

/* === App Promo: iOS App Store popup (Apple's native Smart App Banner covers the top-banner role) === */
#bhAppPromoOverlay .modal-dialog { max-width: 340px; margin: 1.5rem; }
#bhAppPromoOverlay .modal-content.bh-app-promo {
  position: relative;
  text-align: center;
  padding: 2.25rem 1.75rem 1.75rem;
  border-radius: 20px;
  border: 0;
}
#bhAppPromoOverlay .bh-app-promo-close {
  position: absolute;
  top: .85rem;
  right: .85rem;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background-color: var(--color-cloud);
  opacity: 1;
}
#bhAppPromoOverlay .bh-app-promo-close:hover { background-color: var(--color-stone); }
#bhAppPromoOverlay .bh-app-promo-icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(0,0,0,.2);
  margin: 0 auto 1.25rem;
  display: block;
}
#bhAppPromoOverlay .bh-app-promo-title { font-size: 1.2rem; font-weight: 800; line-height: 1.3; margin-bottom: .6rem; }
#bhAppPromoOverlay .bh-app-promo-body { font-size: .92rem; line-height: 1.5; color: #5E6472; margin-bottom: 1.5rem; }
#bhAppPromoOverlay .btn-primary { width: 100%; justify-content: center; }
