/* Clean fixed-height workspace for the analysis dashboard. */
html:has(.analysis-report-header),
body:has(.analysis-report-header),
#root:has(.analysis-report-header) {
  height: 100%;
  overflow: hidden !important;
}

#root > div:has(.analysis-report-header) {
  height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

main:has(.analysis-report-header) {
  height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  background: #fff !important;
}

main:has(.analysis-report-header) > div,
main:has(.analysis-report-header) > div > div,
main:has(.analysis-report-header) > div > div > div,
main:has(.analysis-report-header) > div > div > div > div {
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

main:has(.analysis-report-header) .analysis-report-header {
  display: none !important;
}

main:has(.analysis-report-header) [data-radix-tabs-root],
main:has(.analysis-report-header) .analysis-report-header + div {
  display: flex !important;
  flex: 1 1 0% !important;
  flex-direction: column !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

main:has(.analysis-report-header) [data-radix-tabs-root] > div,
main:has(.analysis-report-header) .analysis-report-header + div > div {
  height: 100% !important;
  min-height: 0 !important;
  flex: 1 1 0% !important;
  overflow: hidden !important;
}

main:has(.analysis-report-header) [role="tabpanel"] {
  min-height: 0 !important;
}

main:has(.analysis-report-header) [role="tabpanel"][data-state="inactive"] {
  display: none !important;
}

main:has(.analysis-report-header) [role="tabpanel"][data-state="active"] {
  display: block !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

main:has(.analysis-report-header) .bottom-action-bar {
  display: none !important;
}

main:has(.analysis-report-header) .executive-canvas {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

main:has(.analysis-report-header) .analysis-scroll-area {
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

/* The report sidebar stays compact so the dashboard remains the focus. */
@media (min-width: 1200px) {
  #root > div:has(.analysis-report-header) > aside[class~="md:flex"] {
    width: 248px !important;
    min-width: 248px !important;
    overflow: hidden !important;
    border-right: 1px solid #dce3e8;
    box-shadow: none !important;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  #root > div:has(.analysis-report-header) > aside[class~="md:flex"] {
    width: 72px !important;
    min-width: 72px !important;
    overflow: hidden !important;
    border-right: 1px solid #dce3e8;
    box-shadow: none !important;
  }

  #root > div:has(.analysis-report-header) > aside[class~="md:flex"] > div:first-child a span,
  #root > div:has(.analysis-report-header) > aside[class~="md:flex"] > nav span,
  #root > div:has(.analysis-report-header) > aside[class~="md:flex"] > nav p,
  #root > div:has(.analysis-report-header) > aside[class~="md:flex"] > div:last-child a span,
  #root > div:has(.analysis-report-header) > aside[class~="md:flex"] > div:last-child p {
    display: none !important;
  }

  #root > div:has(.analysis-report-header) > aside[class~="md:flex"] > nav > div > div:nth-child(2) {
    display: none !important;
  }

  #root > div:has(.analysis-report-header) > aside[class~="md:flex"] a,
  #root > div:has(.analysis-report-header) > aside[class~="md:flex"] button {
    justify-content: center !important;
  }

  #root > div:has(.analysis-report-header) > aside[class~="md:flex"] nav {
    padding-inline: 8px !important;
  }
}

@media (max-width: 767px) {
  main:has(.analysis-report-header) {
    height: calc(100dvh - 61px) !important;
  }

  main:has(.analysis-report-header) .analysis-scroll-area {
    scrollbar-gutter: auto;
  }
}
