/* Content sizing is opt-in. Existing plain iframes retain their scroll model. */
html[data-lumabit-sizing="content"],
html[data-lumabit-sizing="content"] body,
html[data-lumabit-sizing="content"] #roadmap-webapp {
  height: auto;
  min-height: 0;
}
html[data-lumabit-sizing="content"] #roadmap-webapp > .roadmap-container:is(.grid-mode, .linear-mode),
html[data-lumabit-sizing="content"] .roadmap-container:is(.grid-mode, .linear-mode) .roadmap-main-content,
html[data-lumabit-sizing="content"] #roadmap-webapp > .roadmap-container.grid-mode .grid-view {
  height: auto;
  min-height: 0;
  overflow: visible;
  overscroll-behavior: auto;
}
html[data-lumabit-sizing="content"] .grid-view .empty-grid { min-height: 0; }

/* The host reports the visible part of the iframe, in iframe viewport pixels.
   Fixed chrome stays within that region even when the iframe is very tall. */
html[data-lumabit-viewport] [data-embed-overlay] {
  top: var(--luma-embed-top, 0px);
  bottom: var(--luma-embed-bottom, 0px);
  min-height: 0;
}
html[data-lumabit-viewport] [data-embed-overlay] > [role="dialog"] {
  max-height: var(--luma-embed-height, 100dvh);
}
html[data-lumabit-viewport] [data-embed-top] {
  top: calc(var(--luma-embed-top, 0px) + 1rem);
}
html[data-lumabit-viewport] [data-tour="hamburger-menu"] .dropdown-content {
  max-height: calc(var(--luma-embed-height, 100dvh) - 4rem);
  overflow-y: auto;
}
html[data-lumabit-viewport] [data-embed-actions] {
  max-height: calc(var(--luma-embed-height, 100dvh) - 7rem);
  overflow-y: auto;
}

html[data-lumabit-viewport] [data-embed-filter] {
  bottom: calc(var(--luma-embed-bottom, 0px) + 5rem + env(safe-area-inset-bottom));
  max-height: calc(var(--luma-embed-height, 100dvh) - 6rem);
  overflow-y: auto;
}

html[data-lumabit-viewport] [data-embed-overlay] > [role="dialog"]:not(.drawer) {
  overflow-y: auto;
}
