/* Match the Vuexy donor primary typeface across custom and standalone shells. */
:root {
  --htt-font-family-base: "Public Sans", -apple-system, blinkmacsystemfont, "Segoe UI", Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  --htt-body-font-size: 0.9375rem;
  --htt-body-line-height: 1.375;
  --bs-body-font-family: var(--htt-font-family-base);
  --bs-body-font-size: var(--htt-body-font-size);
  --bs-body-line-height: var(--htt-body-line-height);
  --bs-font-sans-serif: var(--htt-font-family-base);
}

body,
button,
input,
textarea,
select,
.layout-wrapper,
.layout-page,
.layout-container,
.menu,
.navbar,
.card,
.modal,
.offcanvas,
.dropdown-menu,
.popover,
.tooltip,
.table,
.form-control,
.form-select,
.btn {
  font-family: var(--htt-font-family-base);
}

body {
  font-size: var(--htt-body-font-size);
  line-height: var(--htt-body-line-height);
}

/*
 * Vuexy's heading scale can leave a fixed large line-height on headings that a
 * compact component later reduces to body-sized text. Keep wrapped headings
 * proportional to their rendered font size while allowing component selectors
 * to define a more specific rhythm when needed.
 */
h1,
h2,
h3,
h4,
h5 {
  line-height: 1.25;
  white-space: normal;
}

/*
 * Bootstrap modals must sit above project overlays such as buildproc lightboxes,
 * image galleries, and sticky action rails. Vuexy's normal stack is enough for
 * base components, but Hotrothutuc has custom fixed overlays above Bootstrap.
 */
:root {
  --htt-modal-zindex: 30000;
}

.modal {
  z-index: var(--htt-modal-zindex);
}

.modal-backdrop {
  z-index: calc(var(--htt-modal-zindex) - 1);
}

.htt-quick-identity-camera-modal {
  z-index: calc(var(--htt-modal-zindex) + 20) !important;
}

.swal2-container {
  z-index: calc(var(--htt-modal-zindex) + 80) !important;
}

.tooltip,
.tooltip.buildproc-modal-tooltip {
  z-index: calc(var(--htt-modal-zindex) + 60) !important;
}

/*
 * Home procedure category cards.
 * The authenticated shell has a fixed sidebar, so viewport breakpoints can
 * overestimate the actual card width. Keep the gallery at 3 columns until the
 * real wide-desktop range, then use container queries to stack cramped card
 * footers when a card is effectively narrow.
 */
@media (min-width: 1400px) and (max-width: 1919.98px) {
  .htt-page-workspace-home .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1920px) {
  .htt-page-workspace-home .category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.htt-page-workspace-home .category-card {
  container-type: inline-size;
}

@container (max-width: 20rem) {
  .htt-page-workspace-home .category-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .htt-page-workspace-home .category-footnote {
    display: block;
    width: 100%;
    line-height: 1.35;
  }

  .htt-page-workspace-home .category-action {
    width: 100%;
  }
}

/*
 * Home metric cards use Bootstrap columns in Blade, but the sidebar shell makes
 * xl viewport math too optimistic. Keep metrics at 3 per row until true
 * wide-desktop space is available.
 */
@media (min-width: 1920px) {
  .htt-page-workspace-home .home-grid .home-metric-col {
    flex: 0 0 auto;
    width: 16.66666667%;
  }
}

/*
 * Large Bootstrap-style spacing helpers.
 * Pattern: {m|p}{side}-custom-{size} for xs and {m|p}{side}-{breakpoint}-custom-{size}
 * for sm/md/lg/xl/xxl. Sizes: 2rem through 5rem in .5rem steps.
 */
[class*="-custom-2rem"] {
  --htt-space-custom-value: 2rem;
}

[class*="-custom-2-5rem"] {
  --htt-space-custom-value: 2.5rem;
}

[class*="-custom-3rem"] {
  --htt-space-custom-value: 3rem;
}

[class*="-custom-3-5rem"] {
  --htt-space-custom-value: 3.5rem;
}

[class*="-custom-4rem"] {
  --htt-space-custom-value: 4rem;
}

[class*="-custom-4-5rem"] {
  --htt-space-custom-value: 4.5rem;
}

[class*="-custom-5rem"] {
  --htt-space-custom-value: 5rem;
}

[class][class*="m-custom-"] { margin: var(--htt-space-custom-value) !important; }
[class][class*="mt-custom-"] { margin-block-start: var(--htt-space-custom-value) !important; }
[class][class*="mb-custom-"] { margin-block-end: var(--htt-space-custom-value) !important; }
[class][class*="ms-custom-"] { margin-inline-start: var(--htt-space-custom-value) !important; }
[class][class*="me-custom-"] { margin-inline-end: var(--htt-space-custom-value) !important; }
[class][class*="mx-custom-"] {
  margin-inline-start: var(--htt-space-custom-value) !important;
  margin-inline-end: var(--htt-space-custom-value) !important;
}
[class][class*="my-custom-"] {
  margin-block-start: var(--htt-space-custom-value) !important;
  margin-block-end: var(--htt-space-custom-value) !important;
}
[class][class*="p-custom-"] { padding: var(--htt-space-custom-value) !important; }
[class][class*="pt-custom-"] { padding-block-start: var(--htt-space-custom-value) !important; }
[class][class*="pb-custom-"] { padding-block-end: var(--htt-space-custom-value) !important; }
[class][class*="ps-custom-"] { padding-inline-start: var(--htt-space-custom-value) !important; }
[class][class*="pe-custom-"] { padding-inline-end: var(--htt-space-custom-value) !important; }
[class][class*="px-custom-"] {
  padding-inline-start: var(--htt-space-custom-value) !important;
  padding-inline-end: var(--htt-space-custom-value) !important;
}
[class][class*="py-custom-"] {
  padding-block-start: var(--htt-space-custom-value) !important;
  padding-block-end: var(--htt-space-custom-value) !important;
}

@media (min-width: 576px) {
  [class][class*="m-sm-custom-"] { margin: var(--htt-space-custom-value) !important; }
  [class][class*="mt-sm-custom-"] { margin-block-start: var(--htt-space-custom-value) !important; }
  [class][class*="mb-sm-custom-"] { margin-block-end: var(--htt-space-custom-value) !important; }
  [class][class*="ms-sm-custom-"] { margin-inline-start: var(--htt-space-custom-value) !important; }
  [class][class*="me-sm-custom-"] { margin-inline-end: var(--htt-space-custom-value) !important; }
  [class][class*="mx-sm-custom-"] { margin-inline-start: var(--htt-space-custom-value) !important; margin-inline-end: var(--htt-space-custom-value) !important; }
  [class][class*="my-sm-custom-"] { margin-block-start: var(--htt-space-custom-value) !important; margin-block-end: var(--htt-space-custom-value) !important; }
  [class][class*="p-sm-custom-"] { padding: var(--htt-space-custom-value) !important; }
  [class][class*="pt-sm-custom-"] { padding-block-start: var(--htt-space-custom-value) !important; }
  [class][class*="pb-sm-custom-"] { padding-block-end: var(--htt-space-custom-value) !important; }
  [class][class*="ps-sm-custom-"] { padding-inline-start: var(--htt-space-custom-value) !important; }
  [class][class*="pe-sm-custom-"] { padding-inline-end: var(--htt-space-custom-value) !important; }
  [class][class*="px-sm-custom-"] { padding-inline-start: var(--htt-space-custom-value) !important; padding-inline-end: var(--htt-space-custom-value) !important; }
  [class][class*="py-sm-custom-"] { padding-block-start: var(--htt-space-custom-value) !important; padding-block-end: var(--htt-space-custom-value) !important; }
}

@media (min-width: 768px) {
  [class][class*="m-md-custom-"] { margin: var(--htt-space-custom-value) !important; }
  [class][class*="mt-md-custom-"] { margin-block-start: var(--htt-space-custom-value) !important; }
  [class][class*="mb-md-custom-"] { margin-block-end: var(--htt-space-custom-value) !important; }
  [class][class*="ms-md-custom-"] { margin-inline-start: var(--htt-space-custom-value) !important; }
  [class][class*="me-md-custom-"] { margin-inline-end: var(--htt-space-custom-value) !important; }
  [class][class*="mx-md-custom-"] { margin-inline-start: var(--htt-space-custom-value) !important; margin-inline-end: var(--htt-space-custom-value) !important; }
  [class][class*="my-md-custom-"] { margin-block-start: var(--htt-space-custom-value) !important; margin-block-end: var(--htt-space-custom-value) !important; }
  [class][class*="p-md-custom-"] { padding: var(--htt-space-custom-value) !important; }
  [class][class*="pt-md-custom-"] { padding-block-start: var(--htt-space-custom-value) !important; }
  [class][class*="pb-md-custom-"] { padding-block-end: var(--htt-space-custom-value) !important; }
  [class][class*="ps-md-custom-"] { padding-inline-start: var(--htt-space-custom-value) !important; }
  [class][class*="pe-md-custom-"] { padding-inline-end: var(--htt-space-custom-value) !important; }
  [class][class*="px-md-custom-"] { padding-inline-start: var(--htt-space-custom-value) !important; padding-inline-end: var(--htt-space-custom-value) !important; }
  [class][class*="py-md-custom-"] { padding-block-start: var(--htt-space-custom-value) !important; padding-block-end: var(--htt-space-custom-value) !important; }
}

@media (min-width: 992px) {
  [class][class*="m-lg-custom-"] { margin: var(--htt-space-custom-value) !important; }
  [class][class*="mt-lg-custom-"] { margin-block-start: var(--htt-space-custom-value) !important; }
  [class][class*="mb-lg-custom-"] { margin-block-end: var(--htt-space-custom-value) !important; }
  [class][class*="ms-lg-custom-"] { margin-inline-start: var(--htt-space-custom-value) !important; }
  [class][class*="me-lg-custom-"] { margin-inline-end: var(--htt-space-custom-value) !important; }
  [class][class*="mx-lg-custom-"] { margin-inline-start: var(--htt-space-custom-value) !important; margin-inline-end: var(--htt-space-custom-value) !important; }
  [class][class*="my-lg-custom-"] { margin-block-start: var(--htt-space-custom-value) !important; margin-block-end: var(--htt-space-custom-value) !important; }
  [class][class*="p-lg-custom-"] { padding: var(--htt-space-custom-value) !important; }
  [class][class*="pt-lg-custom-"] { padding-block-start: var(--htt-space-custom-value) !important; }
  [class][class*="pb-lg-custom-"] { padding-block-end: var(--htt-space-custom-value) !important; }
  [class][class*="ps-lg-custom-"] { padding-inline-start: var(--htt-space-custom-value) !important; }
  [class][class*="pe-lg-custom-"] { padding-inline-end: var(--htt-space-custom-value) !important; }
  [class][class*="px-lg-custom-"] { padding-inline-start: var(--htt-space-custom-value) !important; padding-inline-end: var(--htt-space-custom-value) !important; }
  [class][class*="py-lg-custom-"] { padding-block-start: var(--htt-space-custom-value) !important; padding-block-end: var(--htt-space-custom-value) !important; }
}

@media (min-width: 1200px) {
  [class][class*="m-xl-custom-"] { margin: var(--htt-space-custom-value) !important; }
  [class][class*="mt-xl-custom-"] { margin-block-start: var(--htt-space-custom-value) !important; }
  [class][class*="mb-xl-custom-"] { margin-block-end: var(--htt-space-custom-value) !important; }
  [class][class*="ms-xl-custom-"] { margin-inline-start: var(--htt-space-custom-value) !important; }
  [class][class*="me-xl-custom-"] { margin-inline-end: var(--htt-space-custom-value) !important; }
  [class][class*="mx-xl-custom-"] { margin-inline-start: var(--htt-space-custom-value) !important; margin-inline-end: var(--htt-space-custom-value) !important; }
  [class][class*="my-xl-custom-"] { margin-block-start: var(--htt-space-custom-value) !important; margin-block-end: var(--htt-space-custom-value) !important; }
  [class][class*="p-xl-custom-"] { padding: var(--htt-space-custom-value) !important; }
  [class][class*="pt-xl-custom-"] { padding-block-start: var(--htt-space-custom-value) !important; }
  [class][class*="pb-xl-custom-"] { padding-block-end: var(--htt-space-custom-value) !important; }
  [class][class*="ps-xl-custom-"] { padding-inline-start: var(--htt-space-custom-value) !important; }
  [class][class*="pe-xl-custom-"] { padding-inline-end: var(--htt-space-custom-value) !important; }
  [class][class*="px-xl-custom-"] { padding-inline-start: var(--htt-space-custom-value) !important; padding-inline-end: var(--htt-space-custom-value) !important; }
  [class][class*="py-xl-custom-"] { padding-block-start: var(--htt-space-custom-value) !important; padding-block-end: var(--htt-space-custom-value) !important; }
}

@media (min-width: 1400px) {
  [class][class*="m-xxl-custom-"] { margin: var(--htt-space-custom-value) !important; }
  [class][class*="mt-xxl-custom-"] { margin-block-start: var(--htt-space-custom-value) !important; }
  [class][class*="mb-xxl-custom-"] { margin-block-end: var(--htt-space-custom-value) !important; }
  [class][class*="ms-xxl-custom-"] { margin-inline-start: var(--htt-space-custom-value) !important; }
  [class][class*="me-xxl-custom-"] { margin-inline-end: var(--htt-space-custom-value) !important; }
  [class][class*="mx-xxl-custom-"] { margin-inline-start: var(--htt-space-custom-value) !important; margin-inline-end: var(--htt-space-custom-value) !important; }
  [class][class*="my-xxl-custom-"] { margin-block-start: var(--htt-space-custom-value) !important; margin-block-end: var(--htt-space-custom-value) !important; }
  [class][class*="p-xxl-custom-"] { padding: var(--htt-space-custom-value) !important; }
  [class][class*="pt-xxl-custom-"] { padding-block-start: var(--htt-space-custom-value) !important; }
  [class][class*="pb-xxl-custom-"] { padding-block-end: var(--htt-space-custom-value) !important; }
  [class][class*="ps-xxl-custom-"] { padding-inline-start: var(--htt-space-custom-value) !important; }
  [class][class*="pe-xxl-custom-"] { padding-inline-end: var(--htt-space-custom-value) !important; }
  [class][class*="px-xxl-custom-"] { padding-inline-start: var(--htt-space-custom-value) !important; padding-inline-end: var(--htt-space-custom-value) !important; }
  [class][class*="py-xxl-custom-"] { padding-block-start: var(--htt-space-custom-value) !important; padding-block-end: var(--htt-space-custom-value) !important; }
}

/* Keep Vuexy avatar icon badges visually centered in dense table columns. */
.avatar.avatar-sm[class*="bg-label-"],
.avatar.avatar-sm > .avatar-initial {
  display: inline-grid;
  flex: 0 0 2rem;
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  min-height: 2rem;
  place-items: center;
  line-height: 1;
}

.avatar.avatar-sm[class*="bg-label-"] > i,
.avatar.avatar-sm[class*="bg-label-"] > svg,
.avatar.avatar-sm > .avatar-initial > i,
.avatar.avatar-sm > .avatar-initial > svg {
  display: inline-grid;
  width: 1rem;
  height: 1rem;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
  text-align: center;
}

/* Debugbar allowlist marker: visible only for DEBUG_BAR_ONLY_USER_IDS accounts. */
.htt-debugbar-avatar {
  position: relative;
  isolation: isolate;
}

.htt-debugbar-avatar-badge {
  position: absolute;
  top: -0.38rem;
  right: -0.38rem;
  z-index: 3;
  display: inline-grid;
  width: 1.08rem;
  height: 1.08rem;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.48), transparent 28%),
    linear-gradient(135deg, #ff3e1d, #d62525);
  box-shadow:
    0 0.32rem 0.72rem rgba(255, 62, 29, 0.32),
    0 0 0 0.18rem rgba(255, 62, 29, 0.12);
  line-height: 1;
}

.htt-debugbar-avatar-badge i {
  font-size: 0.58rem;
  line-height: 1;
}

.htt-debugbar-avatar-badge--card {
  top: -0.28rem;
  right: -0.28rem;
  width: 1.18rem;
  height: 1.18rem;
}

.htt-debugbar-avatar-badge--card i {
  font-size: 0.64rem;
}

/* Quick identity dropdowns are portaled to <body> so scrollable modal bodies cannot clip them. */
.htt-quick-identity-action-menu[data-htt-dropdown-portal="quick-identity"] {
  z-index: 30080;
  width: min(26rem, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.5rem);
  min-width: min(19rem, calc(100vw - 1.5rem));
  overflow-wrap: anywhere;
}

@media (max-width: 575.98px) {
  .htt-quick-identity-action-menu[data-htt-dropdown-portal="quick-identity"] {
    width: calc(100vw - 1rem);
    max-width: calc(100vw - 1rem);
    min-width: 0;
  }
}

/* Project modal close standard: Vuexy .btn-close primitive, pinned for titleless/custom modals. */
.modal .modal-content > .btn-close.htt-modal-close-pinned {
  position: absolute;
  inset-block-start: -0.75rem;
  inset-inline-end: -0.75rem;
  z-index: 5;
}

#buildproc-ai-identity-modal .modal-content.buildproc-helper-modal {
  overflow: visible;
}

#buildproc-ai-identity-modal .buildproc-ai-identity-banner {
  overflow: hidden;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

@media (max-width: 575.98px) {
  .modal .modal-content > .btn-close.htt-modal-close-pinned {
    inset-block-start: 0.75rem;
    inset-inline-end: 0.75rem;
    transform: none;
  }

  .modal .modal-content > .btn-close.htt-modal-close-pinned:hover,
  .modal .modal-content > .btn-close.htt-modal-close-pinned:focus {
    transform: none;
  }
}
