.flex-column {
  display: flex;
  flex-direction: column;
}

.chip-container {
  padding: 8px;
}

.pre-wrap {
  white-space: pre-wrap;
}

.gray-text {
  color: var(--lit-neutral-400);
}

.target-info-line {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow-x: hidden;
  line-height: 22px;
  flex: 1;
}

lit-switch .icon-button {
  vertical-align: middle;
}

select:invalid {
  color: var(--lit-neutral-400);
}

/**
 * Interstitial for target selection
 */
.interstitial-container {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.interstitial-header {
  font-size: 1.5em;
  font-family: 'Google Sans', sans;
  padding: 4px 2px;  /* 2px left shift vs. smaller fonts below */
}

.interstitial-contents {
  width: 80%;
  /* color: #5f6368; */
  color: var(--lit-neutral-700);
}

.interstitial-target-option {
  display: flex;
  flex-direction: row;
  margin-bottom: 6px;
  margin-left: 4px;
  cursor: pointer;
}

.interstitial-target-type {
  /* width: 80px; */
  /* font-weight: bold; */
  color: var(--lit-neutral-500);
  padding: 4px;
}

.interstitial-target-option .interstitial-target-text {
  flex-grow: 1;
  flex-basis: 100%;
  padding: 4px;
  border: 1px solid var(--lit-neutral-300);
  border-radius: 4px;
  overflow: hidden;
  min-height: 28px;  /* one line of text */
  max-height: 34px;  /* two lines of text */
}

.interstitial-target-option:hover .interstitial-target-text {
  border: 1px solid var(--lit-neutral-400);
  background-color: var(--lit-mintonal-p-1);
}

/**
 * Module controls
 */
.module-toolbar {
  border-bottom: 1px solid #dadce0;
  box-sizing: border-box;
  justify-content: space-between;

  /* should match min-height? Consider moving this to shared_styles */
  line-height: 36px;
  container-type: inline-size;
}

.module-container .module-toolbar:first-child {
  /* fix for tooltip occlusion issues caused by container-type */
  z-index: 1;
}

.module-footer {
  justify-content: space-between;

  container-type: inline-size;
}

.controls-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 0 4px;
  gap: 4px;

  height: 36px; /* for proper height when wrapping */
}

.controls-group[disabled] {
  color: rgb(60, 64, 67);
  opacity: 0.38;
  pointer-events: none;
}

/* Allow contents to consume available space, but not to cause line wrapping. */
.controls-group-variable {
  flex: 1;
  overflow-x: clip;
  margin-right: 8px;
}

.flex-grow-spacer {
  flex: 1;
  margin: 0;
}

#change-target-button {
  white-space: nowrap;
  margin: 0; /* have enough already from controls-group */
}

#change-target-icon {
  display: none; /* hide by default */
  mwc-icon {
    line-height: 36px; /* vertical alignment issue */
  }
}

.vertical-separator {
  background: #dadce0;
  width: 2px;
  height: 1.2rem;
  padding: 0;
  margin: 0 8px;
}

/* Allow wrap. TODO move this to shared_styles as an option? */
.module-footer-wrappable {
  flex-wrap: wrap;
  height: unset;
  min-height: 36px;
  /* should match min-height? Consider moving this to shared_styles */
  line-height: 36px;
}

.module-footer > * { min-width: 0; }

.controls-group > * { min-width: 0; }

.controls-group label {
  white-space: nowrap;
}

/**
 * Container queries to hide some labels in narrow windows.
 * Helps in SxS mode when the module is replicated.
 *
 * Adjust the size of these so the labels are hidden in a graceful way as the
 * module is resized:
 * - Method label is on the right, hide this first as fewer things will jump.
 * - Remaining things can hide at a narrower width
 *
 * Adjust sizes based on the actual width of toolbar elements so that labels
 * will be hidden /before/ items wrap to the next row. For example, if adding
 * an additional button that is 20px wide (including margins), add 20px to
 * the widths so that the labels hide sooner.
 */
@container (width < 745px) {
  #method-label {
    display: none;
  }
}

@container (width < 685px) {
  #change-target-button, #granularity-label, #colormap-slider-label {
    display: none;
  }

  #change-target-icon {
    display: block; /* show */
  }
}

color-legend {
  /* extra space to keep other controls from jumping when legend changes */
  /* width: 400px; */
  margin-right: 16px;
}


/**
 * Pending request indicator
 */
.loading-indicator-container {
  position: relative;
  width: 100%;
}

@keyframes running-progress {
  0% { margin-left: 0; width: 0; }
  50% { margin-left: 35%; width: 65%; }
  100% { margin-left: 100%; width: 0; }
}

.loading-indicator {
  position: absolute;
  top: -2px;
  background-color: var(--lit-neutral-500);
  width: 100%;
  height: 2px;
  animation: running-progress 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.regex-input-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
}

.regex-input {
  max-width: 100px;
}

.error-input {
  border-color: var(--google-red-600);
  border-style: solid;
  border-radius: 3px;
  border-width: 2px;
  padding-top: 1px;
  padding-bottom: 1px;
}
