/* Compact task controls: one full-width metric strip and one calm filter band. */
body.has-redesign-ui .mayak-metric-grid.mayak-work-metrics {
  display: grid !important;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  width: 100% !important;
  max-width: 100%;
  overflow: hidden !important;
  box-sizing: border-box;
}

body.has-redesign-ui .mayak-work-metric {
  flex: none !important;
  width: auto;
  min-width: 0 !important;
  padding-inline: clamp(6px, .75vw, 13px) !important;
}

body.has-redesign-ui .mayak-work-metric span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.has-redesign-ui .mayak-work-filter-top,
body.has-redesign-ui .mayak-work-filter-footer {
  display: none !important;
}

body.has-redesign-ui .mayak-work-filters {
  margin-top: 8px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.has-redesign-ui .mayak-work-filter-primary {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, .9fr)) minmax(0, 1.1fr) minmax(0, .85fr) minmax(0, 1.1fr) minmax(0, 1.45fr) minmax(0, 1.05fr) auto;
  align-items: stretch;
  gap: 3px !important;
  margin-top: 0 !important;
  padding: 4px !important;
  border: 0 !important;
  border-radius: 10px;
  background: var(--redesign-surface-soft);
  overflow: visible !important;
}

body.has-redesign-ui .mayak-work-filter-primary > .mayak-filter-chip {
  position: relative;
  display: grid !important;
  grid-template-rows: auto minmax(22px, 1fr);
  align-content: center;
  width: 100%;
  min-width: 0 !important;
  min-height: 44px;
  gap: 0 !important;
  padding: 5px 8px 4px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  box-sizing: border-box;
  transition: background-color .14s ease, box-shadow .14s ease;
}

body.has-redesign-ui .mayak-work-filter-primary > .mayak-filter-chip:hover {
  background: var(--redesign-surface) !important;
}

body.has-redesign-ui .mayak-work-filter-primary > .mayak-filter-chip:focus-within {
  background: var(--redesign-surface) !important;
  box-shadow: inset 0 0 0 1px var(--redesign-accent);
}

body.has-redesign-ui .mayak-work-filter-primary > .mayak-filter-chip.is-active {
  background: var(--redesign-accent-soft) !important;
  box-shadow: inset 0 -2px 0 var(--redesign-accent);
}

body.has-redesign-ui .mayak-work-filter-primary > .mayak-filter-chip > span {
  min-width: 0;
  color: var(--redesign-muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .015em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.has-redesign-ui .mayak-work-filter-primary > .mayak-filter-chip.is-active > span {
  color: var(--redesign-accent);
}

body.has-redesign-ui .mayak-work-filter-primary > .mayak-filter-chip select {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 22px;
  padding: 1px 18px 0 0;
  border: 0 !important;
  outline: 0;
  background-color: transparent;
  color: var(--redesign-text);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
}

body.has-redesign-ui .mayak-work-filter-primary > .mayak-filter-reset {
  align-self: stretch;
  min-height: 44px;
  padding-inline: 10px;
  border: 0 !important;
  border-radius: 7px;
  background: transparent;
  color: var(--redesign-accent);
  white-space: nowrap;
  transition: background-color .14s ease;
}

body.has-redesign-ui .mayak-work-filter-primary > .mayak-filter-reset:not(:disabled):hover {
  background: var(--redesign-accent-soft);
}

body.has-redesign-ui .mayak-work-filter-primary > .mayak-filter-reset:disabled {
  opacity: .42;
}

@container mayak-module-workspace (max-width: 1240px) {
  body.has-redesign-ui .mayak-work-filter-primary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  body.has-redesign-ui .mayak-work-filter-primary > .mayak-filter-reset {
    width: 100%;
  }
}

@media (min-width: 1340px) {
  body.has-redesign-ui .mayak-module-page.is-task-drawer-open .mayak-work-filter-primary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@container mayak-module-workspace (max-width: 900px) {
  body.has-redesign-ui .mayak-metric-grid.mayak-work-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.has-redesign-ui .mayak-work-filter-primary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  body.has-redesign-ui .mayak-metric-grid.mayak-work-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.has-redesign-ui .mayak-work-filter-primary {
    grid-template-columns: minmax(0, 1fr);
  }
}
