:root { --fmh-rail-w: 4.85rem; }
/* t299 refined sticky right side rail */
.fmh-rail {
  --fmh-rail-w: 4.85rem;
  position: fixed;
  top: calc(var(--fmh-header-h, 100px) + var(--fmh-menubar-h, 50px) + 1.15rem);
  right: 0;
  z-index: 140; /* below clean header/drawer (200) & menubar (190) */
  transform: none;
  max-height: calc(100vh - var(--fmh-header-h, 100px) - var(--fmh-menubar-h, 50px) - 1.25rem);
  overflow-x: visible;
  overflow-y: auto;
  font-family: var(--font-sans, system-ui, sans-serif);
  pointer-events: none;
  scrollbar-width: thin;
}
@media (max-width: 899px) {
  :root { --fmh-rail-w: 2.85rem; }
  .fmh-rail {
    top: calc(var(--fmh-header-h, 100px) + 0.5rem);
    max-height: calc(100vh - var(--fmh-header-h, 100px) - 1rem);
  }
}

.fmh-rail__stack {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  width: var(--fmh-rail-w);
}

/* Toggle sits ABOVE the panel — never overlaps items */
.fmh-rail__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: var(--fmh-rail-w);
  min-width: 0;
  height: 1.85rem;
  padding: 0 0.35rem 0 0.45rem;
  box-sizing: border-box;
  border-radius: 999px 0 0 999px;
  border: 1px solid color-mix(in srgb, var(--color-primary, #e77600) 40%, #e7ddd3);
  border-right: none;
  background: rgba(255, 252, 248, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--color-primary, #e77600);
  cursor: pointer;
  box-shadow: -3px 3px 14px rgba(60, 68, 67, 0.12);
  align-self: stretch;
}
.fmh-rail__toggle:hover,
.fmh-rail__toggle:focus-visible {
  background: #fff;
  outline: none;
}
.fmh-rail__toggle-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.fmh-rail__chev {
  transition: transform 0.25s ease;
}
.fmh-rail.is-collapsed .fmh-rail__chev {
  transform: rotate(180deg);
}

.fmh-rail__panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  width: var(--fmh-rail-w);
  padding: 0.45rem 0.35rem 0.5rem;
  border-radius: 16px 0 0 16px;
  border: 1px solid color-mix(in srgb, var(--color-primary, #e77600) 38%, #e7ddd3);
  border-right: none;
  background: rgba(255, 252, 248, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: -6px 8px 28px rgba(60, 68, 67, 0.14);
  transition: width 0.28s ease, padding 0.28s ease, opacity 0.2s ease, border-color 0.2s ease;
  overflow: visible;
}

.fmh-rail.is-collapsed .fmh-rail__panel {
  width: 0;
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  border-color: transparent;
  box-shadow: none;
  pointer-events: none;
  overflow: hidden;
}

.fmh-rail__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  min-height: 3.55rem;
  padding: 0.4rem 0.2rem 0.35rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--color-navy, #002337);
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.fmh-rail__item:hover,
.fmh-rail__item:focus-visible {
  background: #fff;
  border-color: color-mix(in srgb, var(--color-primary, #e77600) 45%, #eee);
  outline: none;
  transform: translateX(-2px);
}

/* Soft orange accent bar on the left of each tile */
.fmh-rail__item::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.45rem;
  bottom: 0.45rem;
  width: 2px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--color-primary, #e77600) 55%, transparent);
  opacity: 0.55;
}
.fmh-rail__item:hover::before,
.fmh-rail__item:focus-visible::before {
  opacity: 1;
}

.fmh-rail__icon {
  color: var(--color-primary, #e77600);
  display: block;
}
.fmh-rail__label {
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  letter-spacing: 0.01em;
  max-width: 100%;
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  hyphens: auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fmh-rail__phone {
  display: none;
}

/* Hover flyout label to the left */
.fmh-rail__item::after {
  content: attr(data-flyout);
  position: absolute;
  right: calc(100% + 0.55rem);
  top: 50%;
  transform: translateY(-50%) translateX(4px);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  background: rgba(0, 35, 55, 0.92);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}
.fmh-rail__item:hover::after,
.fmh-rail__item:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .fmh-rail__panel,
  .fmh-rail__chev,
  .fmh-rail__item,
  .fmh-rail__item::after { transition: none; }
}

/* t316: slim mobile rail stays visible while scrolling */
@media (max-width: 767px) {
  .fmh-rail {
    display: block;
    --fmh-rail-w: 2.85rem; /* ~46px */
    top: 45%;
    right: 0;
    transform: translateY(-55%);
    z-index: 140; /* below header/drawer */
  }
  .fmh-rail__stack {
    width: var(--fmh-rail-w);
  }
  .fmh-rail__toggle {
    width: var(--fmh-rail-w);
    height: 1.65rem;
    padding: 0 0.2rem;
    background: rgba(255, 255, 255, 0.88);
  }
  .fmh-rail__toggle-label { display: none; }
  .fmh-rail__panel {
    width: var(--fmh-rail-w);
    padding: 0.35rem 0.25rem 0.4rem;
    background: rgba(255, 255, 255, 0.88);
    gap: 0.28rem;
  }
  .fmh-rail__item {
    min-height: 2.65rem;
    padding: 0.3rem 0.15rem;
    gap: 0;
    background: rgba(255, 255, 255, 0.65);
  }
  .fmh-rail__item::before { display: none; }
  .fmh-rail__item::after { display: none; } /* no hover flyout on touch */
  .fmh-rail__label {
    display: block;
    font-size: 9px;
    line-height: 1.15;
    letter-spacing: 0.01em;
    font-weight: 700;
    max-width: 100%;
    white-space: normal;
    overflow: hidden;
    hyphens: none;
    word-break: keep-all;
  }
  .fmh-rail__item {
    min-height: 2.85rem;
    padding: 0.28rem 0.1rem 0.22rem;
    gap: 0.12rem;
  }
  .fmh-rail {
    --fmh-rail-w: 3.35rem; /* room for short labels */
  }
  .fmh-rail__icon {
    width: 18px;
    height: 18px;
  }
  /* t332: sticky CTA clearance handled in t332 block (top+bottom pin) */
  body.has-sticky-cta-visible .fmh-rail {
    transform: none;
  }
  html.fmh-consent-open .fmh-rail {
    opacity: 0.2;
    pointer-events: none;
  }
}

html.fmh-consent-open .fmh-rail,
body.nav-open .fmh-rail {
  opacity: 0.35;
  pointer-events: none;
}

/* t321: more destinations, keep tidy */
.fmh-rail__panel {
  gap: 0.28rem;
  padding: 0.4rem 0.3rem 0.45rem;
  max-height: min(78vh, 40rem);
  overflow-y: auto;
  overflow-x: visible;
  scrollbar-width: thin;
}
.fmh-rail__item {
  min-height: 3.05rem;
  padding: 0.32rem 0.15rem 0.28rem;
  gap: 0.15rem;
}
.fmh-rail__label {
  font-size: 0.58rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  -webkit-line-clamp: unset;
  display: block;
}
.fmh-rail__icon {
  width: 20px;
  height: 20px;
}
@media (max-width: 767px) {
  .fmh-rail__panel {
    max-height: min(72vh, 30rem);
    gap: 0.22rem;
    padding: 0.32rem 0.18rem 0.36rem;
  }
  .fmh-rail__item {
    min-height: 2.85rem;
  }
  .fmh-rail__label {
    display: block;
    font-size: 9px;
  }
  .fmh-rail__item--consult {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-primary, #e77600) 55%, transparent);
  }
}


/* t331: short vs full labels */
.fmh-rail__label-short { display: none; }
.fmh-rail__label-full { display: block; }
.fmh-rail__item--consult {
  background: color-mix(in srgb, var(--color-primary, #e77600) 14%, #fff);
  border-color: color-mix(in srgb, var(--color-primary, #e77600) 40%, transparent);
}
.fmh-rail__item--consult .fmh-rail__icon {
  color: var(--color-primary, #e77600);
}
.fmh-rail__item--consult .fmh-rail__label {
  color: var(--color-navy, #002337);
  font-weight: 800;
}


/* ===== t332: mobile rail fits all 7 items + labels (390×844 & 375×667) ===== */
@media (max-width: 767px) {
  .fmh-rail {
    /* Always pin between header and sticky-CTA strip so content cannot spill */
    top: calc(var(--fmh-header-h, 64px) + 0.25rem) !important;
    bottom: calc(5.35rem + env(safe-area-inset-bottom, 0px)) !important;
    max-height: none !important;
    height: auto !important;
    transform: none !important;
    display: flex;
    flex-direction: column;
    overflow-x: visible;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  body.has-sticky-cta-visible .fmh-rail {
    top: calc(var(--fmh-header-h, 64px) + 0.25rem) !important;
    bottom: calc(5.35rem + env(safe-area-inset-bottom, 0px)) !important;
    max-height: none !important;
    transform: none !important;
  }
  .fmh-rail__stack {
    gap: 0.2rem;
    max-height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
  }
  .fmh-rail__toggle {
    height: 1.4rem;
    flex: 0 0 auto;
  }
  .fmh-rail__panel {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    gap: 0.08rem;
    padding: 0.2rem 0.12rem 0.3rem;
    overflow-x: visible;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .fmh-rail__panel::-webkit-scrollbar { display: none; }
  .fmh-rail__item {
    min-height: 0;
    height: auto;
    padding: 0.16rem 0.08rem 0.14rem;
    gap: 0.05rem;
    flex: 0 0 auto;
  }
  .fmh-rail__icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
  }
  .fmh-rail__label {
    display: block;
    font-size: 8px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: 0;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    padding-bottom: 1px;
  }
  .fmh-rail__item--consult {
    padding-bottom: 0.18rem;
  }
}
@media (max-width: 767px) and (max-height: 700px) {
  .fmh-rail {
    bottom: calc(5.1rem + env(safe-area-inset-bottom, 0px)) !important;
  }
  .fmh-rail__panel { gap: 0.05rem; padding: 0.14rem 0.1rem 0.22rem; }
  .fmh-rail__item { padding: 0.1rem 0.06rem 0.09rem; gap: 0.03rem; }
  .fmh-rail__icon { width: 14px; height: 14px; }
  .fmh-rail__label { font-size: 7.5px; line-height: 1.05; }
  .fmh-rail__toggle { height: 1.25rem; }
}

/* ===== t345: slim frosted-glass mobile rail (content-sized, not full-height bar) ===== */
@media (max-width: 767px) {
  .fmh-rail {
    --fmh-rail-w: 2.875rem; /* ~46px */
    top: calc(var(--fmh-header-h, 64px) + 0.35rem) !important;
    bottom: auto !important;
    max-height: calc(100dvh - var(--fmh-header-h, 64px) - 5.6rem - env(safe-area-inset-bottom, 0px)) !important;
    height: auto !important;
    transform: none !important;
    display: block !important;
    overflow: visible !important;
    right: 0;
    pointer-events: none;
  }
  body.has-sticky-cta-visible .fmh-rail {
    top: calc(var(--fmh-header-h, 64px) + 0.35rem) !important;
    bottom: auto !important;
    max-height: calc(100dvh - var(--fmh-header-h, 64px) - 5.6rem - env(safe-area-inset-bottom, 0px)) !important;
    transform: none !important;
  }
  .fmh-rail__stack {
    pointer-events: auto;
    width: var(--fmh-rail-w);
    max-height: inherit;
    gap: 0.28rem;
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .fmh-rail__toggle {
    width: var(--fmh-rail-w);
    height: 1.35rem;
    flex: 0 0 auto;
    padding: 0 0.15rem;
    border-radius: 12px 0 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-right: none;
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: -2px 2px 10px rgba(15, 34, 54, 0.12);
    color: #0f2236;
  }
  .fmh-rail__toggle-label { display: none; }
  .fmh-rail__panel {
    width: var(--fmh-rail-w);
    flex: 0 0 auto !important;
    min-height: 0;
    max-height: none;
    height: auto !important;
    gap: 0.1rem;
    padding: 0.28rem 0.14rem 0.34rem;
    border-radius: 14px 0 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-right: none;
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: -3px 4px 16px rgba(15, 34, 54, 0.14);
    overflow: visible;
  }
  .fmh-rail__item {
    min-height: 0;
    height: auto;
    padding: 0.2rem 0.06rem 0.16rem;
    gap: 0.08rem;
    flex: 0 0 auto;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #0f2236;
  }
  .fmh-rail__item:hover,
  .fmh-rail__item:focus-visible {
    background: rgba(255, 255, 255, 0.35);
    transform: none;
  }
  .fmh-rail__icon {
    width: 17px;
    height: 17px;
    color: var(--color-primary, #e77600);
  }
  .fmh-rail__label {
    display: block;
    font-size: 9.5px;
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: 0;
    color: #0f2236;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    padding-bottom: 0;
  }
  .fmh-rail__item--consult {
    background: rgba(231, 118, 0, 0.16);
    border-color: rgba(231, 118, 0, 0.45);
    box-shadow: none;
    padding-bottom: 0.2rem;
  }
  .fmh-rail__item--consult .fmh-rail__label {
    color: #0f2236;
    font-weight: 800;
  }
}
@media (max-width: 767px) and (max-height: 700px) {
  .fmh-rail {
    max-height: calc(100dvh - var(--fmh-header-h, 64px) - 5.2rem - env(safe-area-inset-bottom, 0px)) !important;
  }
  .fmh-rail__panel { gap: 0.06rem; padding: 0.2rem 0.1rem 0.26rem; }
  .fmh-rail__item { padding: 0.12rem 0.04rem 0.1rem; gap: 0.04rem; }
  .fmh-rail__icon { width: 16px; height: 16px; }
  .fmh-rail__label { font-size: 9px; line-height: 1.08; }
  .fmh-rail__toggle { height: 1.2rem; }
}

/* ===== t345b: readable nowrap labels + clearer glass ===== */
@media (max-width: 767px) {
  .fmh-rail {
    --fmh-rail-w: 3rem; /* 48px */
  }
  .fmh-rail__panel {
    background: rgba(255, 255, 255, 0.48);
    backdrop-filter: blur(10px) saturate(1.2);
    -webkit-backdrop-filter: blur(10px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-right: none;
    box-shadow: -2px 4px 14px rgba(15, 34, 54, 0.12);
  }
  .fmh-rail__toggle {
    background: rgba(255, 255, 255, 0.48);
    backdrop-filter: blur(10px) saturate(1.2);
    -webkit-backdrop-filter: blur(10px) saturate(1.2);
  }
  .fmh-rail__label {
    font-size: 9px !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    word-break: normal !important;
    hyphens: none !important;
    max-width: none;
    width: auto;
    color: #0f2236 !important;
  }
  .fmh-rail__item {
    overflow: visible;
  }
  .fmh-rail__item--consult {
    background: rgba(231, 118, 0, 0.18) !important;
    border: 1px solid rgba(231, 118, 0, 0.5) !important;
  }
  .fmh-rail__item--consult .fmh-rail__label {
    color: #0f2236 !important;
  }
}

/* ===== t345c: rail fully inside viewport; labels fit in ~52px ===== */
@media (max-width: 767px) {
  .fmh-rail {
    --fmh-rail-w: 3.25rem; /* 52px */
    right: 0 !important;
    left: auto !important;
    width: var(--fmh-rail-w) !important;
    max-width: var(--fmh-rail-w);
    overflow: visible;
  }
  .fmh-rail__stack,
  .fmh-rail__panel,
  .fmh-rail__toggle {
    width: var(--fmh-rail-w) !important;
    max-width: var(--fmh-rail-w);
    box-sizing: border-box;
  }
  .fmh-rail__panel {
    overflow: hidden; /* keep labels inside glass */
    padding: 0.28rem 0.12rem 0.34rem;
  }
  .fmh-rail__item {
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
  }
  .fmh-rail__label {
    font-size: 8.5px !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    max-width: 100% !important;
    width: 100% !important;
    text-align: center;
    letter-spacing: -0.01em;
  }
  .fmh-rail__icon {
    width: 16px;
    height: 16px;
  }
}


/* ===== t660: no floating Erstinformation bar (desktop + mobile) ===== */
.sticky-cta,
.sticky-cta.fmh-beratung-popup,
#sticky-smart-cta {
  display: none !important;
}
body.has-sticky-cta-visible {
  padding-bottom: 0 !important;
}

/* ===== t660: mobile drawer — search first, then menu groups, then CTAs ===== */
@media (max-width: 899px) {
  .nav > .nav-search,
  .nav.nav--drawer > .nav-search {
    order: -5 !important;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    margin: 0 0 0.85rem;
  }
  .nav > .nav-group {
    order: 1 !important;
  }
  .nav > .nav-leads,
  .nav.nav--drawer > .nav-leads {
    order: 3 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    margin: 0.85rem 0 0 !important;
    padding: 0.75rem 0 0 !important;
    border-top: 1px solid color-mix(in srgb, var(--color-primary, #e77600) 28%, var(--color-border, #e0d8ce));
    border-bottom: 0 !important;
    gap: 0 !important;
  }
  .nav > .nav-project {
    order: 4 !important;
  }
}


/* ===== t663: mobile house band is a swipe strip that stops at the end ===== */
@media (max-width: 767px) {
  .house-band--swipe {
    margin-inline: 0;
    width: 100%;
    max-width: 100%;
    cursor: default;
    touch-action: pan-x pan-y;
    padding-left: 1rem;
    padding-right: calc(var(--fmh-rail-w, 3.25rem) + 12px);
    box-sizing: border-box;
  }
  .house-band--swipe .house-band__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;
    scrollbar-width: none;
  }
  .house-band--swipe .house-band__viewport::-webkit-scrollbar { display: none; }
  .house-band--swipe .house-band__track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: max-content;
    max-width: none;
    gap: 0.85rem;
    padding: 0.25rem 0 1rem;
    transform: none !important;
    will-change: auto;
  }
  .house-band--swipe .house-band__track > .house-band__card {
    flex: 0 0 auto;
    width: min(18.5rem, calc(100vw - var(--fmh-rail-w, 3.25rem) - 4.25rem));
    scroll-snap-align: start;
  }
  .house-band--swipe .house-band__controls,
  .house-band--swipe [data-house-band-controls] {
    display: none !important;
  }
  .house-band--swipe::before,
  .house-band--swipe::after {
    display: none !important;
  }
  /* Peek + a quiet swipe hint instead of clickable arrows */
  .house-band--swipe .house-band__hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 0.15rem 0 0;
    font-size: 0.82rem;
    color: #5a6570;
  }
  .house-band--swipe .house-band__hint::before,
  .house-band--swipe .house-band__hint::after {
    content: "";
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    border: 1px solid #d7cfc4;
    background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e77600' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 6l6 6-6 6'/></svg>") center / 14px no-repeat;
  }
  .house-band--swipe .house-band__hint::before {
    transform: scaleX(-1);
  }

  /* t775: running band is back on the Häuser pages (category pages too) */
}


/* ===== t665: quieter phones — no pop-in extras ===== */
/* t696: keep orange arrows visible under the band on phones; only hide the scrubber */
@media (max-width: 767px) {
  .house-band__scrub {
    display: none !important;
  }
  #fmh-compare-toast,
  .fmh-compare-toast {
    display: none !important;
  }
  html.fmh-reveal-pending .reveal:not(.is-visible),
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .house-band--swipe .house-band__viewport {
    overscroll-behavior-x: contain;
  }
}


/* ===== t667 (t775: band visible again on Häuser pages) ===== */
.house-band--marquee .house-band__scrub {
  display: none !important;
}

/* Mobile + tablet: one tile under another. Desktop: at least three, never a cramped pair. */
.haeuser-katalog__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  width: 100%;
  max-width: 100%;
}
.haeuser-katalog__grid > .house-band__card {
  width: 100%;
  max-width: 36rem;
  margin-inline: auto;
}
@media (min-width: 900px) {
  .haeuser-katalog__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.35rem;
  }
  .haeuser-katalog__grid > .house-band__card {
    max-width: none;
    margin-inline: 0;
  }
}
@media (min-width: 1280px) {
  .haeuser-katalog__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}


/* ===== t668: transparenter glass rail; mobile content uses the full width ===== */
.fmh-rail__toggle {
  background: rgba(255, 252, 248, 0.18);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: -1px 1px 8px rgba(60, 68, 67, 0.04);
  border-color: color-mix(in srgb, var(--color-primary, #e77600) 14%, transparent);
}
.fmh-rail__toggle:hover,
.fmh-rail__toggle:focus-visible {
  background: rgba(255, 255, 255, 0.34);
}
.fmh-rail__panel {
  background: rgba(255, 252, 248, 0.16);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  box-shadow: -2px 3px 12px rgba(60, 68, 67, 0.04);
  border-color: color-mix(in srgb, var(--color-primary, #e77600) 12%, transparent);
}
.fmh-rail__item {
  background: rgba(255, 255, 255, 0.08);
}
.fmh-rail__item:hover,
.fmh-rail__item:focus-visible {
  background: rgba(255, 255, 255, 0.28);
}
.fmh-rail__item--consult {
  background: rgba(231, 118, 0, 0.10);
}
.fmh-rail__label {
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.85), 0 1px 2px rgba(255, 255, 255, 0.55);
}

@media (max-width: 767px) {
  .fmh-rail__toggle,
  .fmh-rail__panel {
    background: rgba(255, 255, 255, 0.12) !important;
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    box-shadow: -2px 3px 12px rgba(15, 34, 54, 0.08);
    border-color: rgba(255, 255, 255, 0.42);
  }
  .fmh-rail__item {
    background: transparent;
  }
  .fmh-rail__item--consult {
    background: rgba(231, 118, 0, 0.10) !important;
    border-color: rgba(231, 118, 0, 0.38) !important;
  }

  /* Content uses the full view; the rail floats as glass on top instead of shoving the page left */
  main#main .container,
  main#main .page-hero .container,
  main#main .section .container,
  main#main > .container {
    width: min(100% - 2rem, var(--max, 72rem)) !important;
    max-width: none;
    margin-left: auto;
    margin-right: auto;
    padding-right: 0;
    box-sizing: border-box;
  }

  /* t672: keep the homepage hero clear of the rail (headline + request card) */
  .hero.hero--premium .container,
  .hero.hero--premium .hero__grid,
  .hero.hero--premium .container.hero__grid {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 18px !important;
    padding-right: calc(var(--fmh-rail-w, 3.25rem) + 0.85rem) !important;
    margin-inline: 0;
  }

  .house-band--swipe {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .house-band--swipe .house-band__track > .house-band__card {
    width: min(18rem, calc(100vw - 5.25rem));
  }

  /* Keep the favorite heart just left of the overlay so it stays tappable */
  .house-band__card .ml-heart--card {
    right: calc(var(--fmh-rail-w, 3.25rem) - 0.45rem);
  }
}


/* ===== t669/t696: orange arrows sit under the looping band on every screen ===== */
.house-band--marquee .house-band__controls,
.house-band--row .house-band__controls {
  position: static;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 1.35rem 1.75rem;
  max-width: 26rem;
  width: 100%;
  margin: 0.95rem auto 0.4rem;
  padding: 0 1rem;
}
.house-band--marquee .house-band__arrow--prev,
.house-band--marquee .house-band__arrow--next,
.house-band--row .house-band__arrow--prev,
.house-band--row .house-band__arrow--next {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  width: 56px;
  height: 56px;
  z-index: 2;
  background: var(--color-primary, #e77600);
  color: #fff;
  border: 2px solid var(--color-primary, #e77600);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
}
.house-band--marquee .house-band__arrow--prev,
.house-band--row .house-band__arrow--prev { order: 1; }
.house-band--marquee .house-band__arrow--next,
.house-band--row .house-band__arrow--next { order: 3; }
.house-band--marquee .house-band__controls::before {
  content: "Mit den Pfeilen durch die Häuser blättern";
  order: 2;
  flex: 1 1 auto;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.3;
  color: #5a6570;
}
@media (max-width: 767px) {
  .house-band--marquee .house-band__controls,
  .house-band--row .house-band__controls {
    gap: 2.75rem;
    max-width: none;
    margin: 0.7rem auto 0.35rem;
  }
  .house-band--marquee .house-band__controls::before {
    display: none;
  }
  .house-band--marquee .house-band__arrow--prev,
  .house-band--marquee .house-band__arrow--next,
  .house-band--row .house-band__arrow--prev,
  .house-band--row .house-band__arrow--next {
    width: 52px;
    height: 52px;
  }
}
@media (min-width: 768px) {
  .house-band--marquee .house-band__arrow--prev:hover,
  .house-band--marquee .house-band__arrow--next:hover,
  .house-band--marquee .house-band__arrow--prev:focus-visible,
  .house-band--marquee .house-band__arrow--next:focus-visible {
    background: var(--color-navy, #002337);
    border-color: var(--color-navy, #002337);
    color: #fff;
    transform: none !important;
  }
}


/* ===== t670: after the hero, the house band uses the full width — no right fade cutting the next house ===== */
@media (min-width: 768px) {
  .house-band--marquee::after {
    display: none;
  }
}


/* ===== t673: the rail covers nothing — page content yields a column on the right ===== */
@media (max-width: 767px) {
  main,
  main#top,
  main#main,
  .site-footer,
  footer.site-footer {
    padding-right: calc(var(--fmh-rail-w, 3.25rem) + 12px);
    box-sizing: border-box;
  }
  /* Hero photo stays full-bleed; its inner padding already clears the rail */
  .hero.hero--premium {
    width: calc(100% + var(--fmh-rail-w, 3.25rem) + 12px);
    max-width: none;
    margin-right: calc(-1 * (var(--fmh-rail-w, 3.25rem) + 12px));
  }
  .house-band--swipe {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .house-band--swipe .house-band__track > .house-band__card {
    width: min(18rem, calc(100vw - var(--fmh-rail-w, 3.25rem) - 4.25rem));
  }
  .house-band__card .ml-heart--card {
    right: 0.65rem;
  }
}

@media (min-width: 768px) {
  main,
  main#top,
  main#main,
  .site-footer,
  footer.site-footer {
    padding-right: var(--fmh-rail-clear, 5.1rem);
    box-sizing: border-box;
  }
  .hero.hero--premium {
    width: calc(100% + var(--fmh-rail-clear, 5.1rem));
    max-width: none;
    margin-right: calc(-1 * var(--fmh-rail-clear, 5.1rem));
  }
  main .fmh-menubar:not(.fmh-menubar--footer), main#top .fmh-menubar:not(.fmh-menubar--footer) {
    width: 100% !important;
    max-width: 100% !important;
  }
  .house-band {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
  }
  .house-band--marquee::after {
    display: block;
  }
}


/* ===== t677: rail clearly more opaque, with more white so icons and labels stay readable ===== */
.fmh-rail__toggle {
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  box-shadow: -2px 3px 14px rgba(60, 68, 67, 0.12);
  border-color: color-mix(in srgb, var(--color-primary, #e77600) 28%, #e4ddd4);
}
.fmh-rail__toggle:hover,
.fmh-rail__toggle:focus-visible {
  background: rgba(255, 255, 255, 0.96);
}
.fmh-rail__panel {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px) saturate(1.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
  box-shadow: -3px 6px 22px rgba(60, 68, 67, 0.13);
  border-color: color-mix(in srgb, var(--color-primary, #e77600) 24%, #e4ddd4);
}
.fmh-rail__item {
  background: rgba(255, 255, 255, 0.82);
}
.fmh-rail__item:hover,
.fmh-rail__item:focus-visible {
  background: #fff;
}
.fmh-rail__item--consult {
  background: color-mix(in srgb, var(--color-primary, #e77600) 16%, #fff);
}
.fmh-rail__label {
  text-shadow: none;
}

@media (max-width: 767px) {
  .fmh-rail__toggle,
  .fmh-rail__panel {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(14px) saturate(1.08);
    -webkit-backdrop-filter: blur(14px) saturate(1.08);
    box-shadow: -2px 4px 16px rgba(15, 34, 54, 0.14);
    border-color: rgba(228, 221, 212, 0.98);
  }
  .fmh-rail__item {
    background: rgba(255, 255, 255, 0.88);
  }
  .fmh-rail__item--consult {
    background: color-mix(in srgb, var(--color-primary, #e77600) 18%, #fff) !important;
    border-color: rgba(231, 118, 0, 0.48) !important;
  }
}


/* ===== t679: no transparency at all — solid white rail on desktop and phones ===== */
.fmh-rail__toggle,
.fmh-rail__panel {
  background: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: -3px 6px 22px rgba(60, 68, 67, 0.16);
  border-color: #e4ddd4 !important;
}
.fmh-rail__toggle:hover,
.fmh-rail__toggle:focus-visible {
  background: #ffffff !important;
}
.fmh-rail__item {
  background: #ffffff !important;
}
.fmh-rail__item:hover,
.fmh-rail__item:focus-visible {
  background: #fff7ef !important;
}
.fmh-rail__item--consult {
  background: #fff3e6 !important;
  border-color: color-mix(in srgb, var(--color-primary, #e77600) 45%, #e4ddd4) !important;
}
.fmh-rail__label {
  text-shadow: none !important;
}
@media (max-width: 767px) {
  .fmh-rail__toggle,
  .fmh-rail__panel {
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: -2px 4px 16px rgba(15, 34, 54, 0.16);
    border-color: #e4ddd4 !important;
  }
  .fmh-rail__item {
    background: #ffffff !important;
  }
  .fmh-rail__item--consult {
    background: #fff3e6 !important;
    border-color: rgba(231, 118, 0, 0.48) !important;
  }
}
