/**
 * One fixed column at the viewport bottom. Children stack in document order:
 * floats, corners, notices, bars. Bars sit on the screen edge.
 */

html {
  --wlj-bottom-stack-height: 0px;
}

body {
  padding-bottom: var(--wlj-bottom-stack-height);
}

.wlj-bottom-stack {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.wlj-bottom-stack__slot,
.wlj-bottom-stack__corners,
.wlj-bottom-stack__corner {
  pointer-events: none;
}

.wlj-bottom-stack__slot > *,
.wlj-bottom-stack__corner > * {
  pointer-events: auto;
}

.wlj-bottom-stack__slot:not(:has(> :not([hidden]))),
.wlj-bottom-stack__corners:not(:has(.wlj-bottom-stack__corner > :not([hidden]))) {
  display: none;
}

.wlj-bottom-stack [data-slot="floats"] {
  display: flex;
  justify-content: center;
  padding: 0 1rem 0.75rem;
}

.wlj-bottom-stack [data-slot="floats"]:not(:has(> :not([hidden]))) {
  display: none;
}

.wlj-bottom-stack__corners {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 1rem 0.75rem;
}

.wlj-bottom-stack__corner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.wlj-bottom-stack__corner--end {
  margin-inline-start: auto;
  align-items: flex-end;
}

/* Claimed nodes keep their old fixed utilities as a no-JS fallback. */
#wlj-bottom-stack .wlj-bottom-stack__item {
  position: relative;
  inset: auto;
  z-index: auto;
  transform: none;
  max-width: 100%;
}

#wlj-bottom-stack [data-slot="bars"] > .wlj-bottom-stack__item {
  width: 100%;
}

#wlj-bottom-stack [data-slot="floats"] > #wlj-market-data-controls {
  width: min(100%, 36rem);
}

#wlj-bottom-stack #sale-reports-filter-aside {
  pointer-events: none;
  padding-bottom: 0.5rem;
}

#sale-report-app {
  height: calc(100dvh - var(--wlj-bottom-stack-height, 0px));
  max-height: calc(100dvh - var(--wlj-bottom-stack-height, 0px));
}

#sale-report-app .h-screen {
  height: 100%;
  max-height: 100%;
}

#wlj-bottom-stack [x-cloak] {
  display: none !important;
}
