/*
 * Search bar and filters of list screens ({% dlight_filters form %}, dlight_admin.filters).
 *
 *   .dl-filters__bar       search, the filters always in sight, "Filtros" and "Buscar"
 *   .dl-filters__summary   number of results, the filters of the panel that are on (one tag each) and "Limpar filtros"
 *   .dl-filters__panel     the other filters: a modal on wide screens, a bottom drawer on phones
 *
 * Same height (44px), radius and colours as the .dl-btn buttons; colours from the DlightConfig variables.
 */

.dl-filters,
.dl-filters-dropdown {
  --dl-f-height: 44px;
  --dl-f-radius: 0.5rem;
  --dl-f-bg: #fff;
  --dl-f-border: var(--bs-gray-300, #d4d4d4);
  --dl-f-border-hover: var(--bs-gray-400, #a3a3a3);
  --dl-f-text: var(--bs-gray-800, #262626);
  --dl-f-muted: var(--bs-secondary-color, #737373);
  --dl-f-ring: rgba(var(--bs-primary-rgb), 0.18);
  --dl-f-panel-bg: #fff;
  --dl-f-soft: #f5f5f5;
}

.dl-filters {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

.dark-version .dl-filters,
.dark-version .dl-filters-dropdown {
  --dl-f-bg: transparent;
  --dl-f-border: #404040;
  --dl-f-border-hover: #5c5c5c;
  --dl-f-text: rgba(255, 255, 255, 0.85);
  --dl-f-muted: #a3a3a3;
  --dl-f-panel-bg: #1d1d1d;
  --dl-f-soft: #262626;
}

/* ------------------------------------------------------------------ bar */

.dl-filters__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.dl-filters__search {
  position: relative;
  flex: 1 1 18rem;
  min-width: 0;
}

.dl-filters__search-icon {
  position: absolute;
  top: 50%;
  left: 0.875rem;
  transform: translateY(-50%);
  color: var(--dl-f-muted);
  font-size: 0.875rem;
  pointer-events: none;
}

.dl-filters .dl-filters__search-input,
.dl-filters .dl-filters__input,
.dl-filters select.dl-filters__select {
  display: block;
  width: 100%;
  height: var(--dl-f-height);
  margin: 0;
  padding: 0 0.875rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--dl-f-text);
  background-color: var(--dl-f-bg);
  background-image: none;
  border: 1px solid var(--dl-f-border);
  border-radius: var(--dl-f-radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}

.dl-filters .dl-filters__search-input {
  padding-left: 2.5rem;
  padding-right: 2.5rem;
}

.dl-filters .dl-filters__search-input::-webkit-search-cancel-button {
  display: none; /* the "×" of the component clears the search on the server too */
}

.dl-filters .dl-filters__search-input::placeholder,
.dl-filters .dl-filters__input::placeholder {
  color: var(--dl-f-muted);
  opacity: 1;
}

.dl-filters .dl-filters__search-input:hover,
.dl-filters .dl-filters__input:hover,
.dl-filters select.dl-filters__select:hover {
  border-color: var(--dl-f-border-hover);
}

.dl-filters .dl-filters__search-input:focus,
.dl-filters .dl-filters__input:focus,
.dl-filters select.dl-filters__select:focus {
  outline: none;
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 3px var(--dl-f-ring);
}

/* Native select (phones and tablets): the theme's arrow. */
.dl-filters select.dl-filters__select {
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  background-size: 12px 12px;
  text-overflow: ellipsis;
}

.dl-filters .dl-filters__search-clear {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--dl-f-muted);
  transform: translateY(-50%);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dl-filters .dl-filters__search-clear:hover,
.dl-filters .dl-filters__search-clear:focus-visible {
  background: var(--dl-f-soft);
  color: var(--dl-f-text);
}

.dl-filters__visible {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

/* Wide screens: the filters of the bar are items of the bar itself, side by side with the search, and
   wrap to the next line only when they do not fit. */
@media (min-width: 768px) {
  .dl-filters__bar > .dl-filters__visible {
    display: contents;
  }
}

.dl-filters__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

/* A narrow card (the list beside its column, 0.30): the search takes the first line, and the filters of the bar
   share the second with the buttons, filling it, instead of one filter falling alone to a ragged line. */
.dl-filters {
  container-type: inline-size;
}

@container (max-width: 66rem) {
  .dl-filters__bar > .dl-filters__search {
    flex-basis: 100%;
  }

  .dl-filters__bar .dl-filters__field.is-inline {
    flex: 1 1 12rem;
  }
}

.dl-filters .dl-filters__open {
  overflow: visible; /* the theme's .btn hides what passes the edge: the badge on phones */
}

.dl-filters .dl-filters__open.is-active {
  --dl-btn-border: rgba(var(--bs-primary-rgb), 0.55);
  --dl-btn-color: var(--bs-primary);
  --dl-btn-hover-border: var(--bs-primary);
  --dl-btn-hover-color: var(--bs-primary);
}

.dl-filters__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.375rem;
  border-radius: 999px;
  background: var(--bs-primary);
  color: var(--dl-on-primary, #fff);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
}

.dl-filters.is-loading .dl-filters__submit-icon::before {
  content: "\f110"; /* fa-spinner */
  display: inline-block;
  animation: dl-filters-spin 0.8s linear infinite;
}

@keyframes dl-filters-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------ fields */

.dl-filters__field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.dl-filters__label {
  float: none;
  width: auto;
  margin: 0;
  padding: 0;
  color: var(--dl-f-text);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25rem;
}

.dl-filters__help,
.dl-filters__error {
  font-size: 0.75rem;
  color: var(--dl-f-muted);
}

.dl-filters__error {
  color: var(--bs-danger);
}

.dl-filters__control {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

/* On the bar: the name of the filter inside the control, so it shows also when a value is chosen. */
.dl-filters__field.is-inline {
  flex: 0 1 15rem;
}

.dl-filters__field--multiple.is-inline {
  flex-basis: 18rem;
}

.dl-filters__field.is-inline .dl-filters__control {
  height: var(--dl-f-height);
  border: 1px solid var(--dl-f-border);
  border-radius: var(--dl-f-radius);
  background: var(--dl-f-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dl-filters__field--multiple.is-inline .dl-filters__control {
  height: auto;
  min-height: var(--dl-f-height);
}

.dl-filters__field.is-inline .dl-filters__control:hover {
  border-color: var(--dl-f-border-hover);
}

.dl-filters__field.is-inline .dl-filters__control:focus-within {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 3px var(--dl-f-ring);
}

.dl-filters__prefix {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 0 0 0.875rem;
  color: var(--dl-f-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.dl-filters__field.is-inline .dl-filters__control > .dl-filters__input,
.dl-filters__field.is-inline .dl-filters__control > select.dl-filters__select {
  flex: 1 1 auto;
  min-width: 0;
  height: calc(var(--dl-f-height) - 2px);
  border: 0;
  box-shadow: none;
  background-color: transparent;
}

.dl-filters__field.is-inline .dl-filters__control > select.dl-filters__select {
  padding-left: 0.5rem;
  font-weight: 500;
}

.dl-filters__field.is-inline .dl-filters__control > .dl-filters__input {
  padding-left: 0.5rem;
}

.dl-filters__field.is-inline .dl-filters__control > .dl-filters__input:focus,
.dl-filters__field.is-inline .dl-filters__control > select.dl-filters__select:focus {
  box-shadow: none;
}

/* Switch: the theme's form-switch, in a box as tall as the other controls when it is on the bar. */
.dl-filters__field--switch .form-check {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 1.5rem;
  padding-left: 0;
}

.dl-filters__field--switch .form-check-input {
  flex: 0 0 auto;
  margin: 0;
  float: none;
  cursor: pointer;
}

.dl-filters__field--switch .form-check-label {
  margin: 0;
  color: var(--dl-f-text);
  font-size: 0.875rem;
  cursor: pointer;
}

.dl-filters__field--switch.is-inline {
  flex: 0 0 auto;
  justify-content: center;
  height: var(--dl-f-height);
  padding: 0 0.875rem;
  border: 1px solid var(--dl-f-border);
  border-radius: var(--dl-f-radius);
  background: var(--dl-f-bg);
}

.dl-filters__field--switch.is-inline .form-check-label {
  font-weight: 500;
  white-space: nowrap;
}

/* Options as pills (CheckboxSelectMultiple, RadioSelect): the look of .dl-chip. */
.dl-filters__options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dl-filters__option {
  position: relative;
  margin: 0;
  cursor: pointer;
}

.dl-filters__option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.dl-filters__option span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 36px;
  padding: 0 0.875rem;
  border: 1px solid var(--dl-f-border);
  border-radius: 999px;
  background: var(--dl-f-bg);
  color: var(--dl-f-text);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* Hover only with a mouse: on a touch screen it stuck on the last pill touched. */
@media (hover: hover) {
  .dl-filters__option:hover input:not(:checked) + span {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
  }
}

.dl-filters__option input:checked + span {
  border-color: var(--bs-primary);
  background: var(--bs-primary);
  color: var(--dl-on-primary, #fff);
}

.dl-filters__option input[type="checkbox"]:checked + span::before {
  content: "\f00c"; /* fa-check */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.6875rem;
}

.dl-filters__option input:focus-visible + span {
  outline: 2px solid rgba(var(--bs-primary-rgb), 0.45);
  outline-offset: 2px;
}

/* On the bar, the pills come after the name of the filter, on one line. */
.dl-filters__field--chips.is-inline {
  flex: 0 1 auto;
  flex-direction: row;
  align-items: center;
  gap: 0.625rem;
}

.dl-filters__field--chips.is-inline .dl-filters__label {
  flex: 0 0 auto;
  color: var(--dl-f-muted);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ select2 (wide screens) */

.dl-filters .select2-container {
  width: 100% !important;
  min-width: 0;
}

.dl-filters .select2-container--default .select2-selection--single,
.dl-filters .select2-container--default .select2-selection--multiple {
  display: flex;
  align-items: center;
  min-height: var(--dl-f-height);
  height: auto;
  padding: 0 2rem 0 0.875rem;
  border: 1px solid var(--dl-f-border);
  border-radius: var(--dl-f-radius);
  background: var(--dl-f-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dl-filters .select2-container--default .select2-selection--multiple {
  padding: 0.25rem 2rem 0.25rem 0.5rem;
  cursor: pointer;
}

.dl-filters .select2-container--default:hover .select2-selection {
  border-color: var(--dl-f-border-hover);
}

.dl-filters .select2-container--default.select2-container--focus .select2-selection,
.dl-filters .select2-container--default.select2-container--open .select2-selection {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 3px var(--dl-f-ring);
}

.dl-filters .select2-container--default .select2-selection--single .select2-selection__rendered {
  padding: 0;
  color: var(--dl-f-text);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.dl-filters .select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--dl-f-muted);
}

.dl-filters .select2-container--default .select2-selection--single .select2-selection__arrow {
  top: 50%;
  right: 0.625rem;
  height: 20px;
  transform: translateY(-50%);
}

.dl-filters .select2-container--default .select2-selection__clear {
  position: absolute;
  top: 50%;
  right: 1.75rem;
  margin: 0;
  color: var(--dl-f-muted);
  font-size: 1rem;
  line-height: 1;
  transform: translateY(-50%);
}

.dl-filters .select2-container--default .select2-selection--multiple .select2-selection__rendered {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}

.dl-filters .select2-container--default .select2-selection--multiple .select2-selection__choice {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0.125rem 0.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--bs-primary);
  font-size: 0.75rem;
  font-weight: 500;
}

.dl-filters .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  position: static;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.8;
}

.dl-filters .select2-container--default .select2-selection--multiple .select2-search--inline {
  display: flex;
  align-items: center;
}

.dl-filters .select2-container--default .select2-search--inline .select2-search__field {
  height: 30px;
  margin: 0 0 0 0.375rem;
  padding: 0;
  line-height: 30px;
  vertical-align: middle;
  font-size: 0.875rem;
  color: var(--dl-f-text);
}

.dl-filters .select2-container--default .select2-search--inline .select2-search__field::placeholder {
  color: var(--dl-f-muted);
}

/* An arrow in the multiple select too: it reads as a select, not as a text field. */
.dl-filters .select2-container--default .select2-selection--multiple::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.875rem;
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") no-repeat center / contain;
  transform: translateY(-50%);
  pointer-events: none;
}

.dl-filters .select2-container--default .select2-selection--multiple .select2-selection__clear {
  right: 2rem;
}

/* On the bar, with select2: the name of the filter over the left side of the select, which takes the whole
   control (filters.js measures the name into --dl-f-prefix). The list then opens as wide as the field. */
.dl-filters__control.has-select2 > .dl-filters__prefix {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  pointer-events: none; /* a click on the name opens the list */
}

.dl-filters__field.is-inline .dl-filters__control.has-select2 .select2-container--default .select2-selection--single,
.dl-filters__field.is-inline .dl-filters__control.has-select2 .select2-container--default .select2-selection--multiple {
  padding-left: calc(var(--dl-f-prefix, 4rem) + 0.5rem);
}

/* On the bar the control has the border: the select2 inside it has none. */
.dl-filters__field.is-inline .select2-container--default .select2-selection--single,
.dl-filters__field.is-inline .select2-container--default .select2-selection--multiple {
  min-height: calc(var(--dl-f-height) - 2px);
  padding-left: 0.5rem;
  border: 0;
  box-shadow: none !important;
  background: transparent;
}

.dl-filters__field.is-inline .select2-container--default .select2-selection--single .select2-selection__rendered {
  font-weight: 500;
}

/* The list of a select2: it lives outside the form (in the body, or in the panel), so it has its own class. */
.select2-dropdown.dl-filters-dropdown {
  overflow: hidden;
  border: 1px solid var(--dl-f-border);
  border-radius: var(--dl-f-radius);
  background: var(--dl-f-panel-bg);
  color: var(--dl-f-text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.select2-dropdown.dl-filters-dropdown.select2-dropdown--below {
  margin-top: 4px;
}

.select2-dropdown.dl-filters-dropdown.select2-dropdown--above {
  margin-top: -4px;
}

.dl-filters-dropdown .select2-results__option {
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
}

.dl-filters-dropdown .select2-search--dropdown {
  padding: 0.5rem;
}

.dl-filters-dropdown .select2-search--dropdown .select2-search__field {
  height: 36px;
  padding: 0 0.75rem;
  border: 1px solid var(--dl-f-border);
  border-radius: 0.375rem;
  background: var(--dl-f-bg);
  color: var(--dl-f-text);
}

/* A long search_help_text of the admin, under the bar (0.29.10). */
.dl-filters__search-help {
  display: block;
  font-size: 0.75rem;
  color: var(--dl-f-muted);
}

/* Without JavaScript: the admin's filter links (0.29.10). */
.dl-filters__noscript {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  font-size: 0.8125rem;
}

.dl-filters__noscript ul {
  margin: 0.25rem 0 0;
  padding-left: 1rem;
}

/* ------------------------------------------------------------------ summary */

.dl-filters__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--dl-f-muted);
}

.dl-filters__count strong {
  color: var(--dl-f-text);
  font-weight: 700;
}

.dl-filters__tags {
  display: contents;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dl-filters__tags > li {
  display: inline-flex;
}

.dl-filters .dl-filters__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 28px;
  padding: 0 0.625rem;
  border-radius: 999px;
  background: rgba(var(--bs-primary-rgb), 0.1);
  color: var(--dl-f-text);
  font-size: 0.75rem;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.dl-filters .dl-filters__tag:hover,
.dl-filters .dl-filters__tag:focus-visible {
  background: rgba(var(--bs-primary-rgb), 0.2);
}

.dl-filters__tag-label {
  color: var(--dl-f-muted);
}

.dl-filters__tag-value {
  max-width: 14rem;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dl-filters__tag .fa-xmark {
  font-size: 0.6875rem;
  opacity: 0.7;
}

.dl-filters .dl-filters__reset {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--bs-primary);
  font-weight: 600;
  text-decoration: none;
}

.dark-version .dl-filters .dl-filters__reset {
  color: var(--dl-primary-dark, var(--bs-primary));
}

.dl-filters .dl-filters__reset:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------------ panel: modal */

.dl-filters__panel {
  width: min(640px, calc(100vw - 2rem));
  max-width: none;
  max-height: min(85vh, 760px);
  margin: auto;
  padding: 0;
  overflow: visible; /* the select2 lists can go past the edge */
  border: 0;
  border-radius: 1rem;
  background: var(--dl-f-panel-bg);
  color: var(--dl-f-text);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.24);
}

.dl-filters__panel[open] {
  display: flex;
  animation: dl-filters-pop 0.18s ease-out;
}

.dl-filters__panel::backdrop {
  background: rgba(10, 10, 10, 0.45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

@keyframes dl-filters-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

.dl-filters__sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  max-height: inherit;
}

.dl-filters__handle {
  display: none;
}

.dl-filters__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 0.75rem;
}

.dl-filters__title {
  margin: 0;
  color: var(--dl-f-text);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
}

.dl-filters__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-right: -0.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--dl-f-muted);
  font-size: 1.125rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dl-filters__close:hover,
.dl-filters__close:focus-visible {
  background: var(--dl-f-soft);
  color: var(--dl-f-text);
}

.dl-filters__body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1rem;
  min-height: 0;
  padding: 0.75rem 1.5rem 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.dl-filters__body:focus {
  outline: none;
}

/* Pills, multiple selects and switches take the whole line. */
.dl-filters__body > .dl-filters__field--chips,
.dl-filters__body > .dl-filters__field--multiple,
.dl-filters__body > .dl-filters__field--switch {
  grid-column: 1 / -1;
}

.dl-filters__foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--dl-f-border);
  border-radius: 0 0 1rem 1rem;
  background: var(--dl-f-panel-bg);
}

html.dl-filters-lock,
html.dl-filters-lock body {
  overflow: hidden;
}

/* ------------------------------------------------------------------ phones: bottom drawer */

@media (max-width: 767.98px) {
  /* The filters of the bar go to their own line, below, and scroll sideways when they do not fit. */
  .dl-filters__bar {
    gap: 0.5rem;
  }

  .dl-filters__bar > .dl-filters__search {
    flex: 1 1 0;
    order: 1;
  }

  .dl-filters__bar > .dl-filters__actions {
    order: 2;
    margin-left: 0;
    gap: 0.5rem;
  }

  .dl-filters__bar > .dl-filters__visible {
    order: 3;
    flex: 1 1 100%;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin: 0 -1rem;
    padding: 2px 1rem 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .dl-filters__bar > .dl-filters__visible::-webkit-scrollbar {
    display: none;
  }

  .dl-filters__bar > .dl-filters__visible:first-child {
    order: 0;
  }

  .dl-filters__field.is-inline {
    flex: 0 0 auto;
    max-width: 80vw;
  }

  .dl-filters__field.is-inline .dl-filters__control > select.dl-filters__select {
    width: auto;
    max-width: 60vw;
  }

  .dl-filters__field--chips.is-inline .dl-filters__options {
    flex-wrap: nowrap;
  }

  /* "Filtros" and "Buscar" become icons: the room goes to the search. */
  .dl-filters .dl-filters__open,
  .dl-filters .dl-filters__submit {
    position: relative;
    width: var(--dl-f-height);
    padding: 0;
  }

  .dl-filters__open-label,
  .dl-filters__submit-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .dl-filters__open .dl-filters__badge {
    position: absolute;
    top: -6px;
    right: -6px;
    box-shadow: 0 0 0 2px var(--dl-f-panel-bg);
  }

  /* Inputs at 16px: below that, iOS zooms the page when one gets the focus. */
  .dl-filters .dl-filters__search-input,
  .dl-filters .dl-filters__input,
  .dl-filters select.dl-filters__select {
    font-size: 16px;
  }

  .dl-filters__panel {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 2.5rem);
    margin: 0;
    border-radius: 1.25rem 1.25rem 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
  }

  @supports not (height: 100dvh) {
    .dl-filters__panel {
      max-height: calc(100vh - 2.5rem);
    }
  }

  .dl-filters__panel[open] {
    animation: dl-filters-up 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .dl-filters__panel.is-dragging,
  .dl-filters__panel.is-keyboard {
    animation: none;
    transition: none;
  }

  .dl-filters__panel.is-settling {
    transition: transform 0.2s ease;
  }

  @keyframes dl-filters-up {
    from {
      transform: translateY(100%);
    }
  }

  .dl-filters__handle {
    display: flex;
    justify-content: center;
    padding: 0.625rem 0 0.25rem;
    touch-action: none;
    cursor: grab;
  }

  .dl-filters__handle > span {
    width: 40px;
    height: 5px;
    border-radius: 999px;
    background: var(--bs-gray-300, #d4d4d4);
  }

  .dark-version .dl-filters__handle > span {
    background: #525252;
  }

  .dl-filters__head {
    padding: 0.25rem 1rem 0.5rem;
    touch-action: none;
  }

  .dl-filters__body {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    padding: 0.5rem 1rem 1.25rem;
  }

  .dl-filters__foot {
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    border-radius: 0;
  }

  .dl-filters__foot > .btn.dl-btn {
    flex: 1 1 0;
  }

  .dl-filters__panel.is-keyboard .dl-filters__foot {
    padding-bottom: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dl-filters__panel[open] {
    animation: none;
  }
}

/* ------------------------------------------------------------------ admin change list (0.29.9) */

/* Add and Export beside the title of the list, side by side (in the old side column they were full width). */
.dl-list-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.dl-list-tools:empty {
  display: none;
}

.dl-list-tools .btn.dl-btn {
  width: auto !important;
}

.dl-list-tools .dl-export {
  margin-top: 0 !important;
}

.dl-list-tools .dl-export .dropdown-menu {
  width: auto !important;
  min-width: 10rem;
}

.dl-changelist-head .date-hierarchy {
  margin-top: -0.25rem;
}

.dl-changelist-head #change-list-date-hierarchy {
  margin-top: 0 !important;
}

/* date_hierarchy (0.30): year, month and day side by side; the next one fills as soon as the one before is
   chosen (filters.js). In the panel, the whole line; on the bar, one control split in three. */
.dl-filters__body > .dl-filters__field--date {
  grid-column: 1 / -1;
}

.dl-filters__field--date:not(.is-inline) .dl-filters__date {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 0.5rem;
}

.dl-filters__field--date.is-loading .dl-filters__date-part[data-dl-filters-date-part="day"] + .select2-container,
.dl-filters__field--date.is-loading .dl-filters__date-part[data-dl-filters-date-part="day"] {
  opacity: 0.6;
}

.dl-filters__field--date.is-inline {
  flex: 0 1 24rem;
}

.dl-filters__field--date.is-inline .dl-filters__control > select.dl-filters__date-part {
  flex: 1 1 0;
  padding-left: 0.5rem;
  padding-right: 1.5rem;
  background-position: right 0.375rem center;
}

.dl-filters__field--date.is-inline .dl-filters__control > select.dl-filters__date-part + select {
  border-left: 1px solid var(--dl-f-border);
  border-radius: 0;
}

.dl-filters__field--date.is-inline .dl-filters__control > select.dl-filters__date-part:disabled {
  color: var(--dl-f-muted);
  opacity: 0.7;
}

.dl-filters__date-apply {
  flex: 0 0 auto;
  align-self: stretch;
  margin: 3px;
  padding: 0 0.625rem;
  border: 0;
  border-radius: calc(var(--dl-f-radius) - 2px);
  background: var(--bs-primary);
  color: #fff;
  cursor: pointer;
}

/* A filter with a template of its own (a project's), in the panel. */
.dl-filters__field--custom {
  grid-column: 1 / -1;
}

.dl-changelist-head__title {
  flex: none; /* in the column of the card header: its own height (0.30; "1 1 20rem" was for a row) */
  min-width: 0;
}

.dl-changelist-head .dl-list-tools {
  flex: 0 0 auto;
}

/* Phones: the years and months of the date hierarchy on one line that scrolls sideways, like the filters of
   the bar; wrapped, a list of years filled the screen before the first row of the list. */
@media (max-width: 767.98px) {
  .dl-changelist-head .date-hierarchy {
    flex-wrap: nowrap !important;
    margin: 0 -1rem;
    padding: 2px 1rem 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .dl-changelist-head .date-hierarchy::-webkit-scrollbar {
    display: none;
  }

  .dl-changelist-head .date-hierarchy .btn {
    flex: 0 0 auto;
  }
}

/* ------------------------------------------------------------------ mode="fetch" */

.dl-filters [hidden] {
  display: none !important;
}

.dl-filters button.dl-filters__tag {
  border: 0;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

/* While the page loads the list: the results under the bar fade, so the change reads as in progress. */
[data-dl-filters-mode="fetch"].is-loading .dl-filters__count {
  opacity: 0.5;
}
