/* Shared contract-driven shell lattice helpers.
 *
 * Consumers set --bb-shell-field-width-mm/height-mm from page-layout bounds
 * and --bb-slot-x/y/w/h-mm per authored slot. This helper turns those
 * contract values into positioned field geometry and mounted tile bodies.
 */

.app-lattice-field {
  position: relative;
  width: calc(var(--bb-shell-field-width-mm, 306) * var(--bb-shell-mm-scale));
  height: calc(var(--bb-shell-field-height-mm, 306) * var(--bb-shell-mm-scale));
  margin: 0 auto;
  overflow: visible;
}

.app-lattice-field .app-shell-slot {
  position: absolute;
  left: calc(var(--bb-slot-x-mm, 0) * var(--bb-shell-mm-scale));
  top: calc(var(--bb-slot-y-mm, 0) * var(--bb-shell-mm-scale));
  width: calc(var(--bb-slot-w-mm, 50) * var(--bb-shell-mm-scale));
  height: calc(var(--bb-slot-h-mm, 50) * var(--bb-shell-mm-scale));
  z-index: var(--bb-slot-z, 1);
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  text-align: left;
  overflow: visible;
}

.app-lattice-field .app-shell-slot.bbt__tile--shell {
  --mm: var(--bb-shell-mm-scale);
}

.app-lattice-field .app-shell-slot.bbt__tile--shell .bbt__overlay {
  overflow-y: auto;
}

.app-lattice-field .app-shell-slot.bbt__tile--shell .bbt__body {
  display: block;
  overflow-y: auto;
}
