/* CI3 diagnostic integration overrides
   Purpose: keep the baked-in diagnostic route full-width on web while retaining
   a clean stacked layout on mobile. This sits after the generated Tailwind CSS. */

html,
body,
#root {
  width: 100%;
  min-width: 320px;
}

body {
  overflow-x: clip;
}

#root :is(h1, h2, h3, h4, p, span, button, a, summary) {
  overflow-wrap: anywhere;
}

#root .line-clamp-1 {
  display: inline !important;
  overflow: visible !important;
  -webkit-box-orient: unset !important;
  -webkit-line-clamp: unset !important;
  white-space: normal !important;
}

@media (min-width: 760px) {
  #root > div > main {
    width: 100%;
    max-width: none;
    padding-right: clamp(18px, 2.5vw, 42px);
    padding-left: clamp(18px, 2.5vw, 42px);
  }

  #root > div > main > section:first-of-type > div:first-child {
    display: grid !important;
    grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr) !important;
    align-items: start !important;
    gap: clamp(24px, 4vw, 64px) !important;
  }

  #root > div > main > section:first-of-type > div:first-child > details {
    display: block !important;
    min-width: 0;
  }

  #root > div > main > section:first-of-type > div:first-child > details > summary {
    display: none !important;
  }

  #root > div > main > section:first-of-type > div:first-child > details > div {
    display: block !important;
  }

  #root > div > main .grid.grid-cols-2.gap-2 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1180px) {
  #root > div > main > section:first-of-type {
    min-height: calc(100vh - 11rem);
  }

  #root > div > main > section:first-of-type > div:first-child {
    padding: clamp(2rem, 3.5vw, 4rem) !important;
  }

  #root > div > main .grid.grid-cols-2.gap-2 {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 759px) {
  #root > div > main {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  #root > div > main > section:first-of-type > div:first-child {
    grid-template-columns: 1fr !important;
  }

  #root > div > main .grid.grid-cols-2.gap-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
