/* Shared page footprint, measured from the Library header.
   Load after page styles so compact/premium variants cannot change its size. */
:root {
  --tt-page-shell-width: 1680px;
  --tt-page-shell-gutter: 12px;
  --tt-page-header-height: 110px;
}

/* Short pages reserve the same scrollbar space as the Library. */
html:has(.tt-page-shell .cu-page-header) {
  scrollbar-gutter: stable;
}

body .tt-page-shell:has(.cu-page-header) {
  box-sizing: border-box;
  width: 100% !important;
  max-width: var(--tt-page-shell-width) !important;
  margin-inline: auto;
  padding-inline: var(--tt-page-shell-gutter) !important;
}

/* Some screens add a second Bootstrap container or a capped main wrapper. */
body .tt-page-shell :where(:has(> .cu-page-header)) {
  box-sizing: border-box;
  width: 100%;
  max-width: none !important;
  padding-inline: 0;
}

body .tt-page-shell .cu-page-header {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: var(--tt-page-header-height);
  margin-inline: 0;
  border-radius: var(--cu-radius);
}

/* Extra navigation and summaries sit below the fixed header, without losing
   controls or cropping their contents to make the header fit. */
.tt-page-header-navigation {
  margin-bottom: 1rem;
}

.tt-page-header-summary.cu-page-header__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  width: 100%;
}

.tt-page-header-summary.cu-page-header__stats li {
  min-width: 0;
}

@media (min-width: 992px) {
  body .tt-page-shell .cu-page-header {
    --cu-page-header-padding-block: 18px;
    --cu-page-header-padding-inline: 22px;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    height: var(--tt-page-header-height);
    min-height: var(--tt-page-header-height);
    max-height: var(--tt-page-header-height);
    padding: var(--cu-page-header-padding-block) var(--cu-page-header-padding-inline);
    gap: 16px 24px;
    overflow: visible;
  }

  body .tt-page-shell .cu-page-header__identity {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }

  body .tt-page-shell .cu-page-header__content {
    flex: 1 1 0;
    min-width: 0;
    gap: 4px;
  }

  body .tt-page-shell .cu-page-header .cu-page-title,
  body .tt-page-shell .cu-page-header__subtitle {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body .tt-page-shell .cu-page-header .tt-page-title-help {
    min-width: 0;
    flex-wrap: nowrap;
  }

  body .tt-page-shell .cu-page-header .tt-page-title-help .cu-page-title {
    min-width: 0;
  }

  body .tt-page-shell .tt-kanban-header .cu-page-header__meta {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body .tt-page-shell .cu-page-header > :is(.cu-page-header__actions, .cu-page-header__tabs) {
    flex: 0 1 auto;
    width: auto;
    max-width: 65%;
    min-width: 0;
    margin-left: auto;
    justify-content: flex-end;
  }

  body .tt-page-shell .tt-ts-total-block li {
    height: 72px;
    min-height: 0;
    padding-block: 6px;
  }

  body .tt-page-shell .tt-kanban-toolbar {
    flex: 0 1 65%;
  }

  body .tt-page-shell .tt-kanban-filter-form {
    flex: 1 1 0;
    min-width: 0;
    flex-wrap: wrap;
  }

  body .tt-page-shell .tt-kanban-filter-form .kanban-filter {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    min-width: 0;
    width: 100%;
    gap: 8px;
  }

  body .tt-page-shell .tt-kanban-filter-form .kb-picker {
    width: 100%;
    min-width: 0;
  }

  body .tt-page-shell .tt-kanban-filter-form .kb-picker__btn > span:not(.kb-picker__caret) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 991.98px) {
  body .tt-page-shell .cu-page-header {
    height: auto;
    max-height: none;
  }
}
