*,
*:before,
*:after {
  box-sizing: border-box;
}

:host(limebb-lime-query-builder) {
  --header-background-color: rgb(var(--contrast-500));
  --limebb-lime-query-builder-background-color: rgb(var(--contrast-100));
  --limebb-lime-query-builder-border-radius: 0.75rem;
  --limebb-lime-query-builder-visual-mode-padding: 1rem;
  --limebb-lime-query-builder-group-color: rgb(var(--color-sky-lighter));
  box-sizing: border-box;
  width: calc(100% - 1.5rem);
  margin: 0.75rem auto;
  display: flex;
  flex-direction: column;
  border-radius: var(--limebb-lime-query-builder-border-radius);
  background-color: var(--limebb-lime-query-builder-background-color);
  box-shadow: var(--shadow-inflated-16);
}

.visual-mode {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: var(--limebb-lime-query-builder-visual-mode-padding);
  border: 1px solid var(--header-background-color);
  border-radius: 0 0 var(--limebb-lime-query-builder-border-radius) var(--limebb-lime-query-builder-border-radius);
}

.code-mode {
  --code-editor-max-height: 70vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.code-mode .validation-errors {
  padding: 0.75rem 1rem;
  color: rgb(var(--color-red-default));
  background-color: rgb(var(--color-red-lighter));
  border-left: 0.25rem solid rgb(var(--color-red-default));
  border-radius: 0.25rem;
  font-size: 0.875rem;
}
.code-mode .validation-errors strong {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.code-mode .validation-errors ul {
  margin: 0;
  padding-left: 1.5rem;
}
.code-mode .validation-errors li {
  margin: 0.25rem 0;
}
.code-mode .visual-mode-limitations {
  padding: 0.75rem 1rem;
  color: rgb(var(--color-blue-dark));
  background-color: rgb(var(--color-blue-lighter));
  border-left: 0.25rem solid rgb(var(--color-blue-default));
  border-radius: 0.25rem;
  font-size: 0.875rem;
}
.code-mode .visual-mode-limitations strong {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.code-mode .visual-mode-limitations ul {
  margin: 0;
  padding-left: 1.5rem;
}
.code-mode .visual-mode-limitations li {
  margin: 0.25rem 0;
}

section.description,
section.filter,
section.query-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

section h4 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: rgb(var(--contrast-1000));
}

limel-header.is-narrow {
  --header-top-right-left-border-radius: 0;
  width: calc(100% + var(--limebb-lime-query-builder-visual-mode-padding) * 2);
  margin-left: calc(var(--limebb-lime-query-builder-visual-mode-padding) * -1);
}

.query-options-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}