html.cas-embed {
  background: #fff;
  color-scheme: light;
  scroll-padding-top: 1rem !important;
}

html.cas-embed body {
  min-height: 0;
  background: #fff;
}

/* Embed height is based on the content wrapper, not the iframe viewport.
   Remove in-flow viewport minimums so a host resize cannot change the value
   that the child reports back to the host. */
html.cas-embed .app,
html.cas-embed .hero,
html.cas-embed .letter-page {
  min-height: 0 !important;
}

/* Chat history remains an internal scroller, but its footprint in the normal
   document flow must not change when the host changes the iframe height. */
html.cas-embed .chat-log {
  max-height: 440px !important;
}

html.cas-embed .masthead,
html.cas-embed .analysis-masthead,
html.cas-embed .topbar,
html.cas-embed body > .site-footer,
html.cas-embed body > footer,
html.cas-embed .app > footer,
html.cas-embed #root > .footer {
  display: none !important;
}

/* The strategic-priorities appendix is intentionally a wide comparison table.
   Keep its horizontal scroll local so it cannot widen the host iframe. */
html.cas-embed .atable {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

/* Docket filter groups are intentionally single-line controls. On narrow
   frames, scroll the control strip rather than expanding the document. */
html.cas-embed .filter-group {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

html.cas-embed .filter-group > * {
  flex: 0 0 auto;
}

.cas-embed-context {
  box-sizing: border-box;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 14px 0 10px;
  font: 600 0.72rem/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cas-embed-context a {
  color: inherit;
  text-underline-offset: 0.2em;
}

@media (max-width: 640px) {
  .cas-embed-context {
    width: min(100% - 28px, 1180px);
    padding-top: 10px;
  }
}
